On Jul 12, 9:34 am, "Sells, Fred" <[EMAIL PROTECTED]> wrote: > 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" > As you said, this part is only to test that mod_python is installed correctly: > <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 access rule, this works like this (read the section 'Order Directive'): http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html: > <Directory "C:/all/www/html"> > Order allow,deny > Allow from all > </Directory> > This section is the one that does the work : > <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--------------------- > ------------ > As you configured the httpd.conf you are saying: "hey look my project is in the folder '/all/djdev'" so if you don't specify the path starting with the name '/mysite' it won't find your project; another solution to avoid to write of the '/mysite' is to add your app to your PYTHONPATH environment variable, please read the python manual. > <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'), > ) > Hope this helps. > --------------------------------------------------------------------------- > 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. > --------------------------------------------------------------------------- > > settings.py > 3KDownload > > urls.py > 1KDownload > > urls.py > 1KDownload > > detail.html > 1KDownload --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---