to my admin section.
It worked before but now that I have another view added in, anything
beyond the index regex is getting fed into the "url/" section rather
than admin:
I've included my urls.py section and the 500 error.
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'Stumpy.views.home', name='home'),
# url(r'^Stumpy/', include('Stumpy.foo.urls')),
# show the index from /
url(r'^$', 'shortener.views.index'),
# get a url for redirection /shorty
url(r'^(?P<short>\w+)/$', 'shortener.views.detail'),
# send a url to be shortened from /url/someencodedurl
url(r'^url/(?P<url>\S+)/$', 'shortener.views.submit'),
# Uncomment the admin/doc line below to enable admin
documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
judging by the 500 error it seems to be sending it to the submit view
Environment:
Request Method: GET
Request URL: http://192.168.11.4:8001/admin/
Django Version: 1.3 SVN-16009
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sites',
'django.contrib.messages', 'django.contrib.staticfiles',
'django.contrib.admin', 'django.contrib.admindocs', 'shortener']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/home/mugen/programming/django/django/core/handlers/base.py" in
get_response
111. response = callback(request, callback_args, **callback_kwargs)
File "/home/mugen/programming/Stumpy/shortener/views.py" in detail
11. thisurl = url.objects.get(shorturl=short) File "/home/mugen/
programming/django/django/db/models/manager.py" in get
132. return self.get_query_set().get(args, **kwargs) File "/home/mugen/
programming/django/django/db/models/query.py" in get
349. % self.model._meta.object_name)
Exception Type: DoesNotExist at /admin/
Exception Value: url matching query does not exist.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment