running django webapp on apache using mod_wsgi

I am new to working with apache and mod_wsgi. But I do have little experience in django, so from some tutorials I tried to run django app through apache webserver using mod_wsgi.
I created mysite in /var/www/
then in mysite/application I created application.wsgi …

import os
import sys


os.environ['PYTHON_EGG_CACHE'] = '/var/www/mysite/.python-egg'

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

and in /etc/httpd/sites-available I created file named mysite.conf …

<VirtualHost *:80>
   DocumentRoot /var/www/mysite/   
<Directory /var/www/mysite>
Options FollowSymLinks
AllowOverride None
  Order allow,deny
  Allow from all
  SetEnv DJANGO_SETTINGS_MODULE mysite.settings
WSGIDaemonProcess mysite processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup mysite

then I ran a2ensite mysite.conf didn’t showed any error.
then in /etc/httpd/hosts/ I added one line my-ipddress
I gave permission chmod 777 to all the above files and to folder /var/www/mysite.Now when I open on browser I see apahce’s default page nothing from django

and I am using fedora 21.

Source: apache

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.