Search code examples
djangodjango-admindjango-viewsdjango-wsgi

Run Django project using wsgi


Hi i am trying to host the django site using WSGI app.My project resides in /opt/labs and the contents of this are django/ labs_site/ content/ home/

labs_site was the initial project that was derived from startproject and from labs_site/urls.py i link to content,home and other modules

i have followed the documentation in https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/ till renaming labs_site/wsgi.py as os.environ.setdefault("DJANGO_SETTINGS_MODULE", "labs_site.settings")

So after this what is the next step that i should follow.I want to run the project without the runserver


Solution

  • modify your apache settings now. If setting up wsgi file was your first step, then next step should be modifying your apachee config to point towards that file.

    The link you posted points towards this page: https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/

    that has all the necessary information. You can just choose between putting all that into http.conf file or creating site file for it under sites-available & sites-enabled folders in /etc/apache.

    After that - restart your apache server by /etc/init.d/apache2 or service apache2 restart - whichever works.

    Then since its your first time, youll see some errors in your /var/log/apache2/error.log. Fix them... and try again :)

    Good luck.