When setting DEBUG=True Django returned a 500 error. ALLOWED_HOSTS are set, static files are served correctly,...all should be in order. After a bit of digging it seems related to admin.autodiscover() in urls.py. The problem is fixed when I uncomment admin.autodiscover(). The website works but I loose access to the admin interface since admin.autodiscover is left out.
I'm not quite sure what's going on here. Anyone know how to fix this issue? Thanks,
asked 18 Dec '14, 09:46 nathandh8 |
Based on the last statement in your error log you have a python search path issue. You can easily fix the path via these instructions. One helpful way to check the path is via the python shell. answered 18 Dec '14, 12:42 aaront ♦♦ Thanks for the quick response. The paths seem to be added correctly in httpd.conf:
Checking to see if they were added correctly in the shell:
I feel like I'm overlooking something here as all seems to be set up correctly? Thanks!
(18 Dec '14, 15:22)
nathandh8
If you 'ls' each of those paths does a module named Order exist in any of them?
(18 Dec '14, 22:22)
johns
Under /home/nnn/webapps/ecommerce/src my dir structure looks like: accounts carts ecommerce orders --models.py ----where class Order is defined products ... App works fine locally as well as on production but only with DEBUG set to TRUE. Don't quite understand why no error is displayed in those cases.
(19 Dec '14, 08:25)
nathandh8
I notice the 'orders' directory has a lowercase O, are you using a file-system locally that is not case-sensitive? The file-system on the server is case-sensitive, so try making it a capitol O.
(19 Dec '14, 23:17)
johns
Thanks for all your help. The issue is reseolved. Turned out is was related to the following lines in orders.model.py from django.contrib.auth import get_user_model User = get_user_model() Don't quite understand why but I can do without the user model here so I just left it out.
(20 Dec '14, 10:09)
nathandh8
|