I am new to Django that needs help: although I am changing some URLs in my urls.py, I keep getting the same error message from Django. Here is the corresponding line from my .py settings:
ROOT_URLCONF = 'mydjango.urls'
Here is my urls.py:
from django.conf.urls.defaults import *
Therefore, I expect that whenever I am http://mydjango.yafz.org/polls/randomTest1/ , the mydjango.polls.views.randomTest1 function should run because in my polls / views .py I have the corresponding function:
def randomTest1(request): # mainText = request.POST['mainText'] return HttpResponse("Default random test")
However, I continue to receive the following error message:
Page not found (404) Request Method: GET Request URL: http://mydjango.yafz.org/polls/randomTest1 Using the URLconf defined in mydjango.urls, Django tried these URL patterns, in this order: 1. ^$ 2. ^polls/$ 3. ^polls/(?P<poll_id>\d+)/$ 4. ^polls/(?P<poll_id>\d+)/results/$ 5. ^polls/(?P<poll_id>\d+)/vote/$ 6. ^admin/ 7. ^polls/randomTest/$ The current URL, polls/randomTest1, didn't match any of these.
I am surprised because again and again I check urls.py and no
^polls/randomTest/$
but there
^polls/randomTest1/'
It seems that Django is somehow storing the previous contents of urls.py, and I just don't know how to make my last changes effective.
Any ideas? Why do I keep seeing the old version of regular expressions when I try to load this page even if I change my urls.py?
source share