Opened 17 years ago

Closed 17 years ago

#5084 closed (fixed)

urls.py not working under apache

Reported by: danf@… Owned by: Malcolm Tredinnick
Component: HTTP handling Version: dev
Severity: Keywords: urls.py apache
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi all,

Been looking hard for an explanation on this. Can't seem too see what is wrong, looks ok.
Seems to work fine under manage.py runserver, but when I use apache, I just get this error. I am going to http://dfcbu001s/mysite/polls/ (internal server)
From what I can read, it is not making any sense?

Thanks.

Output:

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: 

^polls/$ 
^polls/(?P<poll_id>\d+)/$ 
^polls/(?P<poll_id>\d+)/results/$ 
^polls/(?P<poll_id>\d+)/vote/$ 
The current URL, /mysite/polls/, didn't match any of these.

httpd.conf ->

<Location "/mysite/">
  SetHandler python-program
  PythonHandler django.core.handlers.modpython
  PythonPath "['/root/django'] + sys.path"
  SetEnv DJANGO_SETTINGS_MODULE mysite.settings
  PythonDebug On
</Location>

urls.py ->

from django.conf.urls.defaults import *

urlpatterns = patterns('mysite.polls.views',
    (r'^polls/$', 'index'),
    (r'^polls/(?P<poll_id>\d+)/$', 'detail'),
    (r'^polls/(?P<poll_id>\d+)/results/$', 'results'),
    (r'^polls/(?P<poll_id>\d+)/vote/$', 'vote'),
)

Change History (1)

comment:1 by danf@…, 17 years ago

Resolution: fixed
Status: newclosed

Fixed it. Read the docs closer. Apache needs mysite/ included before each url. Sorry

Note: See TracTickets for help on using tickets.
Back to Top