Django: "No module named urls" error for /admin/
http://2057.javaeye.com/blog/797322
No module named urls问题的解决方法如下:- # OLD:
- from django.conf.urls.defaults import *
- urlpatterns = patterns('',
- (r'^admin/', include('django.contrib.admin.urls')),
- )
# 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 admin
- admin.autodiscover()
- urlpatterns = patterns('',
- (r'^admin/(.*)', admin.site.root),
- )
kenkofox@qq.com
https://github.com/kenkozheng
欢迎投简历给我,一线大厂工作机会