1.1 --- a/docs/Django/NOTES.txt Tue Oct 31 22:02:44 2006 +0000
1.2 +++ b/docs/Django/NOTES.txt Sun Nov 05 23:12:14 2006 +0000
1.3 @@ -10,9 +10,27 @@
1.4 3. Add URL mappings to the instance's urls.py file - see below for a
1.5 description of how this should be done.
1.6 4. Add WebStack handlers to the application directory.
1.7 + 5. Add the application to the INSTALLED_APPS definition in the settings.py
1.8 + file.
1.9 + 6. Configure Django in mod_python.
1.10
1.11 -URL mappings
1.12 -------------
1.13 +Create a Django instance
1.14 +------------------------
1.15 +
1.16 +For example:
1.17 +
1.18 +django-admin.py startproject djangoinstance
1.19 +
1.20 +Create an application
1.21 +---------------------
1.22 +
1.23 +For example:
1.24 +
1.25 +cd djangoinstance
1.26 +mkdir webstack
1.27 +
1.28 +Add URL mappings
1.29 +----------------
1.30
1.31 The docs/Django/urls.py file contains definitions for the example applications
1.32 based on a Django instance called "djangoinstance" (in a directory of that
1.33 @@ -46,3 +64,29 @@
1.34
1.35 Here, within the instance and application, the "authapp" handler (provided by
1.36 the authapp.py from examples/Django) must contain a function called "auth".
1.37 +
1.38 +Add the application to the settings
1.39 +-----------------------------------
1.40 +
1.41 +For example:
1.42 +
1.43 +INSTALLED_APPS = (
1.44 + 'django.contrib.auth',
1.45 + 'django.contrib.contenttypes',
1.46 + 'django.contrib.sessions',
1.47 + 'django.contrib.sites',
1.48 + 'djangoinstance.webstack', # Application added here!
1.49 +)
1.50 +
1.51 +Django and mod_python
1.52 +---------------------
1.53 +
1.54 +For example:
1.55 +
1.56 +<Location "/django/">
1.57 + SetHandler python-program
1.58 + PythonHandler django.core.handlers.modpython
1.59 + SetEnv DJANGO_SETTINGS_MODULE djangoinstance.settings
1.60 + PythonDebug On
1.61 + PythonPath "['/home/paulb/Software/Python', '/home/paulb/Software/Python/WebStack', '/home/paulb/Software/Python/WebStack/examples/Common'] + sys.path"
1.62 +</Location>