Error configuring Django to run customized comments framework
I'm having an issue with setting up a Django website which uses the Django comments framework on my server. The site runs fine when run locally (using manage.py runserver) but when pushed live I'm getting the error:
ImproperlyConfigured at /
The COMMENTS_APP setting refers to a non-existing package.My serv开发者_开发问答er is an apache/mod_wsgi setup. My site contains 2 applications called weblog and weblog_comments. I've appended my site's path and it's parent directories to my django.wsgi file as per the guide located here: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango I can comment out the COMMENTS_APP line from my settings.py and the site runs fine so I know site is on the python path correctly.
My custom comment model is called WeblogComment and extends the default Comment model. It only extends this to add methods to the model, it doesn't change Comment model fields thus It has proxy=True in it's Meta class.
Any advice would be great.
See if alternate WSGI script described at end of:
http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html
makes a difference. If it does, would be nice if can help us work out why. Still trying to get some confirmation on why so can work out if people using Django wrong, of whether Django WSGI adapter by itself is inadequate.
BTW, also just ensure that all code is readable by Apache user and that you don't have any special directories listed in your user account PYTHONPATH that aren't duplicated in WSGI script sys.path setup.
Graham, I've got the site working now by adding the WSGIDaemonProcess and WSGIProcessGroup directives to my virtual host file as per your suggestion here: multiple django sites with apache & mod_wsgi.
This seems to have worked. I probably should have mentioned I'm running another Django site as well as a Wordpress blog on the same box under different domains/virtual hosts. To be quite honest, I'm not quite sure why this is now working. Maybe you have an idea?
精彩评论