Install Python
# cd /usr/ports/lang/python24
# make install clean
Install Django
# cd /usr/ports/www/py-django
# make install clean
Test Django
# cd /home/user/
# django-admin.py startproject mysite
# cd /home/user/mysite
# python manage.py runserver 192.168.0.220:80
visit http://192.168.0.220 with your Web browser. You’ll see a “Welcome to Django” page. It worked!
# CONTROL-C
Install Flup
# cd /usr/ports/www/py-flup
# make install clean
# cd /home/user/mysite
# chmod +x manage.py
# ./manage.py runfcgi method=prefork socket=/tmp/mysite.sock pidfile=django.pid
Install Lighttpd
# cd /usr/ports/www/lighttpd
# make install clean
# cd /usr/local/etc/
# cp lighttpd.conf.sample lighttpd.conf
Configure Lighttpd
# vi lighttpd.conf
server.modules = ( "mod_rewrite", "mod_redirect", "mod_evasive", "mod_alias", "mod_access", "mod_fastcgi", # "mod_expire", # "mod_compress", "mod_accesslog" ) $HTTP["host"] == "www.testdjango.com" { server.name = "www.testdjango.com" server.document-root = "/home/user/mysite" fastcgi.server = ( "/mysite.fcgi" => ( "main" => ( "socket" => "/tmp/mysite.sock", "check-local" => "disable" ) ) ) url.rewrite-once = ( "^(/.*)___FCKpd___0quot; => "/mysite.fcgi$1" ) }
# /usr/local/etc/rc.d/lighttpd start
visit http://192.168.0.220 with your Web browser. You’ll see a “Welcome to Django” page. It worked!