Django

Apache2-vel

  1. Telepítés:
    apt-get install python-imaging python-pythonmagick python-markdown python-textile python-docutils
    apt-get install python-django libapache2-mod-wsgi
    # MySQL támogatással
    apt-get install python-mysqldb
  2. Dummy projekt összelövése:
    cd /var/www-private/django/
    django-admin startproject tiaTest
  3. WSGI config:
    /var/www-private/django/tiaTest/tiaTest.wsgi
    import os
    import sys
    sys.path.append('/var/www-private/django/tiaTest')
    os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
    import django.core.handlers.wsgi
    application = django.core.handlers.wsgi.WSGIHandler()
  4. WSGI beállítása az Apache site-ban:
    /etc/apache2/sites-enabled/001-private
    <VirtualHost *:80>
        ServerName localhost
        ServerAlias 127.0.0.1
        # ...
        WSGIScriptAlias /django/tiaTest/ /var/www-private/django/tiaTest/tiaTest.wsgi
        # ...
    </VirtualHost>
  5. Mostmár megy a default oldal, de állítsuk be a site-ot:
    settings.py
    # ...
    TIME_ZONE = 'Europe/Budapest'
    LANGUAGE_CODE = 'hu-hu'
    # ...