1.1 --- a/WebStack/Django.py Tue Oct 31 22:02:44 2006 +0000
1.2 +++ b/WebStack/Django.py Sun Nov 05 23:12:14 2006 +0000
1.3 @@ -24,7 +24,7 @@
1.4 from WebStack.Helpers import Environment
1.5 from WebStack.Helpers.Request import decode_value, FileContent, Cookie
1.6 from WebStack.Helpers.Response import ConvertingStream
1.7 -from django.utils.httpwrappers import HttpResponse
1.8 +from django.http import HttpResponse
1.9 from StringIO import StringIO
1.10
1.11 class Transaction(WebStack.Generic.Transaction):
2.1 --- a/docs/Django/NOTES.txt Tue Oct 31 22:02:44 2006 +0000
2.2 +++ b/docs/Django/NOTES.txt Sun Nov 05 23:12:14 2006 +0000
2.3 @@ -10,9 +10,27 @@
2.4 3. Add URL mappings to the instance's urls.py file - see below for a
2.5 description of how this should be done.
2.6 4. Add WebStack handlers to the application directory.
2.7 + 5. Add the application to the INSTALLED_APPS definition in the settings.py
2.8 + file.
2.9 + 6. Configure Django in mod_python.
2.10
2.11 -URL mappings
2.12 -------------
2.13 +Create a Django instance
2.14 +------------------------
2.15 +
2.16 +For example:
2.17 +
2.18 +django-admin.py startproject djangoinstance
2.19 +
2.20 +Create an application
2.21 +---------------------
2.22 +
2.23 +For example:
2.24 +
2.25 +cd djangoinstance
2.26 +mkdir webstack
2.27 +
2.28 +Add URL mappings
2.29 +----------------
2.30
2.31 The docs/Django/urls.py file contains definitions for the example applications
2.32 based on a Django instance called "djangoinstance" (in a directory of that
2.33 @@ -46,3 +64,29 @@
2.34
2.35 Here, within the instance and application, the "authapp" handler (provided by
2.36 the authapp.py from examples/Django) must contain a function called "auth".
2.37 +
2.38 +Add the application to the settings
2.39 +-----------------------------------
2.40 +
2.41 +For example:
2.42 +
2.43 +INSTALLED_APPS = (
2.44 + 'django.contrib.auth',
2.45 + 'django.contrib.contenttypes',
2.46 + 'django.contrib.sessions',
2.47 + 'django.contrib.sites',
2.48 + 'djangoinstance.webstack', # Application added here!
2.49 +)
2.50 +
2.51 +Django and mod_python
2.52 +---------------------
2.53 +
2.54 +For example:
2.55 +
2.56 +<Location "/django/">
2.57 + SetHandler python-program
2.58 + PythonHandler django.core.handlers.modpython
2.59 + SetEnv DJANGO_SETTINGS_MODULE djangoinstance.settings
2.60 + PythonDebug On
2.61 + PythonPath "['/home/paulb/Software/Python', '/home/paulb/Software/Python/WebStack', '/home/paulb/Software/Python/WebStack/examples/Common'] + sys.path"
2.62 +</Location>