1

I haven't dealt with Django for some time and now when I returned to it, django 1.4 was released. I think my issue related to new release because earlier I haven't had such problem.

I have created project with myapp and also added easy-news app and everything worked fine, including admin site. But when I decided to add another app which needed admin.py. I've got an issue. When I add admin.py to my project I receive an error:

AttributeError at /admin/

'module' object has no attribute 'site'

for this string:

(r'^admin/', include(admin.site.urls)),

I have spent half a day trying to solve it but I don't understand where it comes from. Any suggestions? Thank you!

4

1 回答 1

0

您是否包含admin.autodiscover()在项目的 urlconf 中?

这个:

(r'^admin/', include(admin.site.urls)),

也必须在项目的 urlconf 中,而不是在应用程序中。

希望这可以帮助 :)

于 2012-06-30T21:36:30.767 回答