debian lenny django mod-wsgi

01/04/2010 by - Apache

aptitude install libapache2-mod-wsgi python-imaging gettext python-mysqldb

## download django src/svn

## apache cfg

### DJANGO begin ###
Alias  /media/ /var/www/htdocs/website/django/website/media/
WSGIScriptAlias / /var/www/htdocs/website/django/website/apache/django.wsgi
WSGIDaemonProcess nuovacigat user=website group=website  processes=1 threads=1 maximum-requests=1000 display-name=website.dj
WSGIProcessGroup website
### DJANGO end ###

## cat  /var/www/htdocs/website/django/website/apache/django.wsgi

import os
import sys

sys.stdout = sys.stderr

#Calculate the path based on the location of the WSGI script.

apache_configuration= os.path.dirname(__file__)project = os.path.dirname(apache_configuration)workspace = os.path.dirname(project)sys.path.append(workspace)
sys.path.append(‘/var/www/htdocs/website/django/django-website’)      <–  django fw
sys.path.append(‘/var/www/htdocs/website/django/website’)       <– app
import django.core.handlers.wsgi
os.environ[‘DJANGO_SETTINGS_MODULE’] = ‘website.settings’
application = django.core.handlers.wsgi.WSGIHandler()



Lascia un commento

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.