It actually very easy to setup wsgi and Django.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| $ sudo apt-get install pip $ sudo pip install Django
$ sudo apt-get install libapache2-mod-wsgi
<VirtualHost *:80> ServerAdmin ycshao0402@gmail.com ServerName image.ycshao.com DocumentRoot /var/www/image WSGIScriptAlias / "/var/www/image/wsgi.py"
... <virtualHost>
$ service apache2 restart
$ chown -R www-data /dir/to/your/site
|
And wsgi.py will look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| import os import os.path import sys
sys.path.append(os.path.join(os.path.dirname(__file__)))
os.environ['DJANGO_SETTINGS_MODULE'] = 'img_site.settings'
from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
|