Django get_model method tries to get Django's Flatpages application instead of my Flatpages application

StackOverflow https://stackoverflow.com/questions/19722618

문제

I have overrided the Django's Flatpages application and write my own Flatpages application. Django Oscar project is importing Flatpage Model with get_model method.

FlatPage = get_model('flatpages', 'FlatPage')

when i run development server

python manage.py runserver 0.0.0.0:80

it imports my Flatpage application but when i use uwsgi-nginx server it imports Django's own flatpage application.

It is also same, importing Django's Flatpage when i do not use nginx and use gunciorn.

gunicorn dhr.wsgi:application -b 0.0.0.0:80

Any ideas?

도움이 되었습니까?

해결책

The problem is most likely a path issue. Add a debugging statement that prints out the result of os.getcwd() and sys.path. Try making your path under uwsgi / gunicorn more similar to development.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top