I am using ubuntu 12.04 and I did the following:
sudo apt-get install python-mysql
sudo python setup.py install (install Django 1.6.2)
sudo apt-get install mysql-server-...
sudo apt-get install apache2
sudo apt-get install libapache2-mod-wsgi
Here are my configuration files:
/home/firstweb.wsgi:
import os
import sys
sys.path = ['/var/www/firstweb'] + sys.path
os.environ['DJANGO_SETTINGS_MODULE'] = 'firstweb.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
/etc/apache/sites-availables/firstweb.conf:
<VirtualHost *:80>
WSGIScriptAlias / /home/adel/firstweb.wsgi
ServerName firstweb.com
Alias /static /var/www/firstweb/static/
<Directory /var/www/firstweb/>
order allow,deny
Allow from all
</Directory>
</VirtualHost>
then I did:
a2ensite firstweb.conf
cd /var/www/
django-admin.py startproject firstweb
apachectl restart
vi /etc/hosts
and add the following (192.168.0.123
is my wlan ip)
192.168.0.123 firstweb.com
I use mysql and I create a database and change the settings.py
and the syncdb
works fine
But when I enter the www.firstweb.com in browser the default page of Apache appears (it works....)
and the Django default page does not appear!!
what is wrong with my configuration?
thank you.
Copyright Notice:Content Author:「Adel」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22271104/unable-to-deploy-django-on-ubuntu-with-apache-mod-wsgi