Opened 8 years ago

Closed 8 years ago

#5084 closed (fixed)

urls.py not working under apache

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

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 Changed 8 years ago by danf@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to fixed
  • Status changed from new to closed

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