I'm a django newbie. I worked through the 4 part tutorial, and then got the mysite demo working under Apache. I went through a lot of trial and error to get it working under Apache, and am concerned that even though it works, I'm missing the big picture. I have to admit that I'm a little confused on matching up paths in the different places. Here are the snippets and I attached the entire files just in case... (this is on windows XP, although I'm using Unix path notation)
project root is /all/djdev/mysite all subsequent paths are relative to
this root
----------------apache's httpd.conf file----------------------------------
DocumentRoot "C:/all/www/html"
<Directory /all/www/html/test> ##not sure if I even need this; part of
mod_python install notes.
AddHandler mod_python .py
PythonHandler test_mod_python
PythonDebug On
</Directory>
<Directory "C:/all/www/html">
Order allow,deny
Allow from all
</Directory>
<Location "/mysite/">
PythonPath "['/all/djdev'] + sys.path"
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
</Location>
________________________________________________________
----------------------------templates/polls/detail.html---------------------
------------
<form action="/mysite/polls/{{ poll.id }}/vote/" method="post">
## I had to add the /mysite prefix, which makes this form "aware" of its
parent, which is not portable. What am I missing?
_________________________________________________________
----------settings.py------------------------------
ROOT_URLCONF = 'mysite.urls'
TEMPLATE_DIRS = ("/all/djdev/mysite/templates", )
INSTALLED_APPS =
('django.contrib.auth','django.contrib.contenttypes','django.contrib.session
s',
'django.contrib.sites','mysite.polls','django.contrib.admin',)
___________________________________________________________
------------------------urls.py---------------------------------------------
-----------
urlpatterns = patterns('mysite.polls.views', (r'^mysite/polls/',
include('mysite.polls.urls')),)
____________________________________________________
---------------------polls/urls.py------------------------------------------
-------------------------------
urlpatterns = patterns('mysite.polls.views',
(r'^$', 'index'),
(r'^(?P<poll_id>\d+)/$', 'detail'),
(r'^(?P<poll_id>\d+)/results/$', 'results'),
(r'^(?P<poll_id>\d+)/vote/$', 'vote'),
)
---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
settings.py
Description: Binary data
urls.py
Description: Binary data
urls.py
Description: Binary data
{{ poll.question }}
{% if error_message %}{{ error_message }}
{% endif %} xxx
{% for choice in poll.choice_set.all %}
{% endfor %}

