When I try to follow the example from <Python Web Development with Django>, to set up the Automatic admin Application, I face this problem “No module named urls “:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Exception Type: TemplateSyntaxError
Exception Value:
Caught an exception while rendering: No module named urls
The answer is really simply because Django’s Backwards-incompatible changes:
Merged newforms-admin into trunk
# OLD:
from django.conf.urls.defaults import *urlpatterns = patterns(”,
(r’^admin/’, include(’django.contrib.admin.urls’)),
)# NEW:
from django.conf.urls.defaults import *
from django.contrib import adminadmin.autodiscover()
urlpatterns = patterns(”,
(r’^admin/(.*)’, admin.site.root),
)
After solving this issue, I found a mark on the book’s cover page showed “Covers Django 1.0″, which means, in some part of this book, sample codes maybe written in previous Django pattern, so be caution to face this same kind of problem again. Good Luck~
No Comments Now!
Be the first to comment on this entry.