简体   繁体   中英

Django Internal Server Error

I'm new at this and stuck. What would cause Django to run without error when I do python manage.py runserver but then throw Internal Server Error when I try to access it through the web? I have another project giving the Congratulations on your first Django-powered page, and I got the same result with the same .wsgi file initially with this project.

It wasn't until I tried to install this script in massivecoupon project that I got Internal Server Error:

http://github.com/coulix/Massive-Coupon---Open-source-groupon-clone

UPDATE:

I set Debug to True in settings.py and now I am getting the django error:

ViewDoesNotExist at / Could not import massivecoupon.engine.views. Error was: No module named libs

Quick answer: check your apache/tomcat access.log and error.log

Next, the other (not really dup) question I quoted above may be a different situation, but I recommend looking into the same things:

Your PYTHONPATH may not contain your project directory, or your DJANGO_SETTINGS_MODULE may not contain 'mysite.website', at least from apache's point of view. Whatever user apache runs as for your website needs to have that set up for it, like in its .profile . Or if you're using mod_python , they need to be set up in the .htaccess or apache's httpd.conf . Or if you're using mod_wsgi , it needs to be in the wsgi setup file -- passenger_wsgi.py or the like -- whatever apache's module will be looking for.

Next:

  • check if the files it needs to access are accessible by what apache runs your django site as
  • make sure your database is accessible by that user
  • and that the database setup/password is accessible by that user
  • make sure you have SITE_ID=1 set
  • make sure that you have a site record added into the database

You can use in command line


    [user]$ python manage.py check

Regards

First off check the Apache error log. If there is nothing in Apache error log, due to it being an internal error to your code or Django while handling a request, set DEBUG to True in Django site settings file and restart Apache so details of error display in the browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM