Questions tagged [django-flatpages]

Django flatpages app is a built-in application that allows to store “flat” HTML content in a database and handles the management for you via Django’s admin interface and a Python API.

Django comes with an optional flatpages application. It lets you store simple “flat” HTML content in a database and handles the management for you via Django’s admin interface and a Python API.

A flatpage is a simple object with a URL, title and content. Use it for one-off, special-case pages, such as “About” or “Privacy Policy” pages, that you want to store in a database but for which you don’t want to develop a custom Django application.

A flatpage can use a custom template or a default, systemwide flatpage template. It can be associated with one, or multiple, sites.

The content field may optionally be left blank if you prefer to put your content in a custom template.

114 questions
1
vote
0 answers

Django flatpages catch all

I am using the catch all pattern for flatpages in Django, like this:- urlpatterns = [ path('somepath/', include('project.somepathapp.urls')), path('anotherpath/', include('project.anotherpathapp.urls')), etc. ] urlpatterns += [ …
bodger
  • 1,112
  • 6
  • 24
1
vote
2 answers

Template does not exist django flatpages

Made a cms project in django, but its not loading my default template for flatpages, attached are the images. Thanks INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', …
Shoyeb Sheikh
  • 2,659
  • 2
  • 10
  • 19
1
vote
1 answer

How to use Django's flatpages with multiple sites and the same url?

I have 5 sites, each on their own domain, running under one django project. Currently all the sites have the same contact page, as provided by flatpages under the url /contact/. However it would be far nicer to create a contact page for each site,…
ghickman
  • 5,893
  • 9
  • 42
  • 51
1
vote
1 answer

Content of Django flatpages not stored

I have added the flatpages package and tried to add a flatpage in the admin interface. The title and URL are added, but not the content of the page. The content of a flatpage is edited in the YAHOO.widget.Editor. Does anyone know why the content of…
Wouter
  • 25
  • 3
1
vote
1 answer

Django flat pages with .html extension

I am trying to set up django flat pages that would be accessible via a url like /pages/page1.html instead of /pages/page1. Followed the flatpages docs, and instead of the flatpages middleware used this code in the root urls.py (in the same folder…
ccpizza
  • 28,968
  • 18
  • 162
  • 169
1
vote
0 answers

How to add standard Django models to fixtures output?

I try to test extended version of Django flatpages and need to create fixture for it. It's incredibly straightforward to create one for a custom model. For example, to create a fixture for a auth.User model, I should execute the following command in…
1
vote
0 answers

Django 1.10: Flatpage site migration runtime error

I'm currently beginning a project in Django 1.10, trying to use the included flat pages application. After installing the apps within my (base) settings file: INSTALLED_APPS =…
1
vote
1 answer

Django - passing flatpage.title variable as part of an include

I'm using Django flatpages and trying to pass the title of a flatpage as part of an html include. {% block navbar %} {% include 'navbar.html' with active='{{flatpage.title}}' %} {% endblock %} This is so I can highlight the whereabouts in the…
jayuu
  • 443
  • 1
  • 4
  • 17
1
vote
1 answer

Use Django flatpages without sites

Is there any that I can have a catch all site with flatpage framework in Django? I have one site but you can get to it through a few DNS names that change constantly. I need to map these all to a single site and flatpages seems bent on me…
Zac Bowling
  • 6,508
  • 1
  • 27
  • 26
1
vote
2 answers

Using Django Flatpages in production: how to archive changes for recovery purposes

I am using Django Flatpages in a production site. I'd like to figure out the best way to make sure if an admin makes a mistake editing a file, old version of the page can be retrieved. We have backups and such, but that's a bit more cumbersome to…
OverClocked
  • 1,177
  • 1
  • 11
  • 19
1
vote
2 answers

Use Django Flatpages with TinyMCE

I'm trying to achive the Django TinyMCE widget with Django Flatpages (into Admin). I already read this Embedding tinyMCE in django flatpage I did the sabe but is not working. Here is my admin.py code: from django.contrib.flatpages.admin import…
Lara
  • 2,170
  • 6
  • 22
  • 43
1
vote
1 answer

How to use model-form in flatpages django?

I stuck in code where i want to use model-form in flatpage template. I create model-form and that form need to serve in flatpage template with save functionality.
Pinto
  • 11
  • 2
1
vote
0 answers

Django static text model

So basically I have surveys application and there's main user dashboard. There he can see his surveys, new surveys, etc and there's also some static about text. What I want to do is make that text not static - let administrator edit it. What are my…
Marijus
  • 4,195
  • 15
  • 52
  • 87
1
vote
1 answer

What is the content field for in Django admin for Flatpages?

I've installed Flatpages and have a few pages set up to load off of specific templates. Though the templates I'm using now are doing just fine, I'd love to be able to easily make parts of it editable by other non-technical admins. So I've been…
Michelle Glauser
  • 1,097
  • 16
  • 28
1
vote
1 answer

How to add flatpages to django suit menu

How do I add flatpages app to django suit menu? I have tried the following configurations. from settings.py 'MENU': ( {'app': 'dongledb', 'label': 'Dongles', 'icon': 'icon-fire'}, {'app': 'projapp', 'label': 'Manage', 'icon':…