Django: "No module named urls" error for /admin/

http://2057.javaeye.com/blog/797322

No module named urls问题的解决方法如下:
Python代码
  1. # OLD:  
  2. from django.conf.urls.defaults import *  
  3.   
  4. urlpatterns = patterns('',  
  5.     (r'^admin/', include('django.contrib.admin.urls')),  
  6. )  
# OLD:
from django.conf.urls.defaults import *

urlpatterns = patterns('',
    (r'^admin/', include('django.contrib.admin.urls')),
)

Python代码
  1. # NEW:  
  2. from django.conf.urls.defaults import *  
  3. from django.contrib import admin  
  4.   
  5. admin.autodiscover()  
  6.   
  7. urlpatterns = patterns('',  
  8.     (r'^admin/(.*)', admin.site.root),  

posted @ 2011-03-03 22:33  拂晓风起-Kenko  阅读(4349)  评论(0编辑  收藏  举报