L
L
Les Alterman2015-12-11 17:31:02
Django
Les Alterman, 2015-12-11 17:31:02

How to set admin settings in django?

How to set up the admin panel in Django? It is necessary to do there so that one item of settings is not displayed in the settings for adding an article. The tutorial says that in admin.py you need to configure the admin panel. Here is the code:

class ArticleAdmin(admin.ModelAdmin)
    fields = ['arcticle_title', 'article_text', 'article_date',
admin.site.register(Article, ArticleAdmin)

Error in class ArticleAdmin(admin.ModelAdmin), does not recognize ModelAdmin

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey K, 2015-12-11
@Les_Alterman

https://docs.djangoproject.com/en/1.9/ref/contrib/...
admin.ModelAdmin

V
Viktor Melnikov, 2015-12-14
@Viteran33

Do you have this line? from django.contrib import admin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question