N
N
nurzhannogerbek2018-06-06 13:22:37
Django
nurzhannogerbek, 2018-06-06 13:22:37

Edit static pages in Django admin?

Hello!
Please help me figure it out. There are two pages: home and license . The home page has a slider whose content is generated dynamically ( Slide.objects.all()) and static content. And the license page consists only of static content. It is necessary to give the opportunity to edit static content through the admin panel. Django comes with a flatpages app out of the box, but it's quite clear how to properly compose a home page. Advise what to do?
URLs.py:

from django.contrib.flatpages import views

urlpatterns += [
    url(r'^home/$', views.flatpage, {'url': '/home/'}, name='home'),
    url(r'^license/$', views.flatpage, {'url': '/license/'}, name='license'),
]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Web Dentist, 2018-06-06
@kgb_zor

Try using ajax to request data for home.

T
timur14, 2018-06-06
@timur14

https://github.com/jazzband/django-flatblocks - this is in case you need to edit some block on the page, through the admin panel, there can be several such blocks on the page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question