as a newbie to django (I have some experience with other python web frameworks like turbogears and bottle, but learning django). I am trying to automatically create admin controls for my application model.
in the main URLS.py I have:
change
from django.contrib import admin
admin.autodiscover()
and after that:
urlpatterns = patterns('',
url(r'^appname/',include('appname.urls')),
url(r'^admin/',include(admin.site.urls))
Please note that this is in the main urls.py and not in the urls.py application
after the tutorial (which worked for me in the tutorial ..) I created the admin.py file in the appname folder and there:
from appname.models import Appname
from django.contrib import admin
class appnameAdmin(admin.ModelAdmin):
fieldsets = [various field sets and fields etc ]
admin.site.register(Appname,AppnameAdmin)
and in setting.py I uncommented
'django.contrib.admin'
I get no errors in the command prompt window and the main admin screen appears (auth and sites)
admin.py manage.py, , , , AppnameAdmin :
admin.site.register(Appname)
.
, - -
django 1.4 + python 2.72