so i have a django application and i find this url:
http:
and I get the following:
Request Method: GET
Request URL: http:
"stories" does not exist
and then I look through urls.py and see:
url(r'^stories/$',
StoryShowView.as_view(
context_object_name='story_list',
template_name='accounts/viewAndAddStory.html')
),
and finally, I look at my setupins.py and see:
APPEND_SLASH = True
shouldn't, with APPEND_SLASH installed, as mentioned above, a URL without a slash 301 is redirected to a URL with a slash, and then to load a web page?
if I manually add a slash to the URL, then the page will load as expected, and everyone has tea and knocks in the early morning.
UPDATE:
I also have this entry in my settings.py:
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
UPDATE:
from the error message on the page when I try to access the URL:
Django Version: 1.3.1
RESOLVED: so om hit the money, dear. The problem was in my urls - right below, I had this:
if settings.DEBUG:
urlpatterns += patterns('',
url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:],
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True})
)
, , MEDIA_URL MEDIA_ROOT settings.py - ('')
URL-, , , css. media_root (, css etc) media_url (url, ), .