Hi All,
I'm newbie Django user, appreciate any assist and pointers to get my
first app running. I know I'm missing something really basic here,
but just couldn't find it so I'm stuck.
When I try to run my script on the browser (
http://server1/mysite/
time), I get the following error messages:
Using the URLconf defined in mysite.urls, Django tried these URL
patterns, in this order:
1. ^time/$
The current URL, /mysite/time/, didn't match any of these.
I have the following script inside "mysite" directory:
views.py:
from django.http import HttpResponse
import datetime
def current_datetime(request):
now = datetime.datetime.now()
html = "<html><body>It is now %s.</body></html>" % now
return HttpResponse(html)
urls.py:
from django.conf.urls.defaults import *
from mysite.views import current_datetime
urlpatterns = patterns ('',
(r'^time/$', current_datetime),
)
Note that I still get the message "It worked!" web page when I comment
out the raw string in the urls.py. I have the following setup.
Django 0.96.2-1
mod_python 3.3.1-5
Apache 2.2.6
Python 2.5.1-15
Here's my httpd.conf setup:
<Location "/mysite">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
PythonPath "['/home/user1/Web/django_projects'] + sys.path"
</Location>
Regards,
--gene