G
G
GeekFromUa2016-10-11 07:18:49
Django
GeekFromUa, 2016-10-11 07:18:49

How to make a Django page with site settings in the admin panel?

Please give advice on how to do it better and more conveniently. That is, the main parameters of the site, which the admin could change without opening the code. For example, the same meta data, the main title and the like. Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Gasoid, 2016-10-11
@Gasoid

add your command
it will turn out like this, for example:

python manage.py options --title "ДРугой титл"

python manage.py options --keywords "ключ1, ключ2"

options is your custom command, see djanga
documentation for details

Z
zelsky, 2016-10-11
@zelsky

Like shell but for templates?
in fact, if the title is formed according to the model instance, then.
$ manage.py shell
>> obj = MyModel.objects.filter(field=whatuneed)
>> obj.title="My new title"
>>obj.save()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question