[python] django

Jirka Vejrazka jirka.vejrazka na gmail.com
Středa Říjen 31 20:43:08 CET 2007


Je to sice uz s krizkem po funuse, ale tady mam postup (pro Debian) z
nasi interni knowledgebase, kdyz jsem to instaloval pred par mesici.
Dneska uz to muze byt trochu jinak. Ale treba to nekomu pomuze...


# apt-get install python-django

>From this point, commands are exact:

# su - www-data
$ cd /data/django
$ django-admin startproject sandbox

edit: /data/django/sandbox/settings.py

DATABASE_ENGINE = 'postgresql'           # 'postgresql', 'mysql',
'sqlite3' or 'ado_mssql'.
DATABASE_NAME = 'sandbox'             # Or path to database file if
using sqlite3.
DATABASE_USER = 'apache'             # Not used with sqlite3.
DATABASE_PASSWORD = 'some_password'         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not
used with sqlite3.

# Local time zone for this installation. All choices can be found here:
# http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
TIME_ZONE = 'Europe/London'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'en-uk'


# apt-get install python-psycopg (django failed without it)


As root, edit /etc/apache2/sites-available/default. In section related
to virtualhost listening on localhost port 81, add the following:

# Django stuff


SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/data/django'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE sandbox.settings
PythonDebug On


as www-data user:
$ cd /var/www
$ ln -s /usr/share/python-support/python-django/django/contrib/admin/media media

As root, restart Apache:
/etc/init.d/apache2 reload


Vcera jsem se nedostal k mailu  :-(

  Jirka


Další informace o konferenci Python