I am trying to experiment with django. And, I'm at a loss.
My
problem is that I just don't conceptually understand how to
match up
where everything is supposed to go on the filesystem and how
to
configure Apache and mod_python to be aware of it.
I am running Apache2 on Ubuntu Edgy with mod_python 3.2.8.
And, I
have gotten my Django pages to render in a text based web
browser
(with the builtin web server).
Here's a little information about what my file system looks
like:
/usr/local/www/myDomain.com/docroot (where my HTML went
before
Django -- my DocumentRoot)
/usr/local/www/myDomain.com/linkshare (where I put my
Django project
files)
/usr/local/www/myDomain.com/linkshare/polls (where I put
the polls
app I've created from the tutorial)
/usr/local/lib/python2.4/site-packages/django (where I
installed
Django)
So, I am confused what I should use for the paths for some
of the
directives (look for the 3 places I put
"whatGoesHere" in the snippet
from apache2.conf below):
<Location '/whatGoesHere'>
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE whatGoesHere.settings
PythonDebug On
</Location>
<VirtualHost *:80>
DocumentRoot /usr/local/www/myDomain.com/docroot
ServerName www.myDomain.com
ServerAlias myDomain.com *. myDomain.com
PythonPath "['whatGoesHere'] + sys.path"
</VirtualHost>
Do I need a DocumentRoot directive in my VirtualHost?
My urls.py file looks like the following. I assume it's
right because
http://localhost:8000/pol
ls works in my text browser. Although,
http://localhost:8000/
doesn't render. I'm not sure how to get a
default view.
urlpatterns = patterns('',
(r'^polls/$', 'linkshare.polls.views.index'),
(r'^polls/(?P<poll_id>d+)/$',
'linkshare.polls.views.detail'),
(r'^polls/(?P<poll_id>d+)/results/$',
'linkshare.polls.views.results'),
(r'^polls/(?P<poll_id>d+)/vote/$',
'linkshare.polls.views.vote'),
# Uncomment this for admin:
(r'^admin/', include('django.contrib.admin.urls')),
--~--~---------~--~----~------------~-------~--~----~
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
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|