On 04/03/2014 03:36, Walter Wang wrote:
> I tried my best to follow the various guides out there, but the
> official documentation here
> https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/ has
> different instructions than the instructions here,
> https://www.digitalocean.com/community/articles/using-mod_wsgi-to-serve-applications-on-ubuntu-12-04
+1 for official documents, assuming you are using Django 1.6
Good clear guidance on mod_wsgi with Apache
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/
Good guidance on wsgi if a little verbose
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
>
>
> I have been at this for over a week now, and I can't figure out how to
> deploy django with mod_wsgi and apache on a linux web server.
>
> Can someone give or point to me a step to step instruction on how to
> deploy django?
>
> Specifically,
> 1. what do I do with the httpd.conf file?
> 2. wsgi file? what's the difference between "making a wsgi file" and a
> wsgi.py file? For example
As per the docs for version 1.6 it is wsgi.py
>
> "wsgi file"
>
> import os
> import sys
> sys.path.append('~/public_html/domain1.com/')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'MyTestProject.settings'
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
Your project is named MyTestProject.settings here
>
> "wsgi.py"
>
> import os
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mywebsite.settings")
Your project is named mywebsite.settings here
>
> from django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
>
> Thank you for any help.
Perhaps you renamed part of your project?
If your project is named mywebsite located at /usr/local/www/domain1.com
then the wsgi.py file should contain something like the following six lines:
import os
import sys
sys.path.append('/usr/local/www/domain1.com')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mywebsite.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Alan
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5315C3F1.5040600%40p-o.co.uk.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment