$sudo apt-get install libapache2-mod-wsgi
now check django in python:
$python
import django
Must be
Python 2.5.2 (r252:60911, Jan 3 2011, 21:39:33)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
else run
$export PYTHONPATH=$PYTHONPATH:/usr/lib/pymodules/python2.6/
mkdir ~/www/
vi django.wsgi
#!/usr/bin/env python
import os, sys
path = '/home/USER/www'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings' #point to settings.py file
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
django-admin startproject myproject
cd myproject
django-admin runapp myapp
cd /etc/apache2/conf.d/
sudo vi wsgi.conf
Listen 7080
WSGIScriptAlias / /home/gennad/www/mysite/django.wsgi
ESC+:x
Now go to http://localhost:7080
Комментариев нет:
Отправить комментарий