On 30 January 2010 19:59, Sector7B <joe.greenaw...@gmail.com> wrote: > 1. Reading the documentation for deploying using mod_wsgi. It says > not to use just 'settings' in django.wsgi The example has > sys.path.append('/path/to/app/mysite') > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'. > this doesn't work because of namespace path problems, my workaround > is: > sys.path.append('/path/to/app') > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' > My fear is that it would put multiple projects into play under /path/ > to/app like /path/to/app/mysite2 etc... The bigger question is my > solution doesn't match the examples.
If you're app is called mysite, and it's hosted at '/path/to/mysite' your .wsgi should contain: sys.path.append('/path/to') os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'. This is what I use, and it works for me. Read and digest this - it has more information than the Django docs one: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango > 4. After deploying to apache, in my virtual host i have: > WSGIScriptAlias / /opt/local/www/mysite/apache/django.wsgi. Thinking > that http://dev.polls.com would take me right to the polls app. > However I still have to do http://dev.polls.com/polls to get to polls > app. Assuming you've followed the tutorial to the letter, and are using app specific urls.py, simply change your urlpattern in the site urls.py from: (r'^polls/', include('mysite.polls.urls')) to (r'', include('mysite.polls.urls')) Note that this should be the last pattern you declare, otherwise it will override the over patterns. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.