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
1 answer

How to extend the Django FlatPage view to include another context?

I'm trying to extend the flatpage django app to include some bootstrap carousel functionality. At this point i created a new django app called "carousel" and inside model.py i define a model class called "CarouselImage" that have an ImageField to…
1
vote
1 answer

How to keep Django Flat Pages under version control?

Django flatpages is a very basic CMS Django-reversions enables a backup of models past versions access in the admin https://github.com/etianen/django-reversion How can I keep the flatpages app models under reversion? The models are not explicitly…
jordn
  • 25
  • 4
1
vote
2 answers

django flatpage redirects

I want to make sure all of my flatpages have the www subdomain and redirect to it if they don't. I've looked at some middlewares that redirect to www, but (1), they usually redirect all urls to www and (2), the ones I've found don't work with…
Joe
  • 4,553
  • 9
  • 51
  • 57
1
vote
1 answer

Best way to store and serve static content in bulk

I have an application that generates static pages. say roughly around 10 html pages/min. These pages are going to be served to users. On server side, I am using Django as development framework with Gunicorn to run my App server and I am using Nginx…
lalit
  • 3,283
  • 2
  • 19
  • 26
1
vote
1 answer

Search index for flat HTML pages

I'm looking to add search capability into an existing entirely static website. Likely, the new search functionality itself would need to be dynamic, as the search index would need to be updated periodically (as people make changes to the static…
Joe J
  • 9,985
  • 16
  • 68
  • 100
1
vote
1 answer

How to set a Flatpage as the Homepage in Django

How can I set a Flatpage as the Homepage? My urls.py is (r'', include('django.contrib.flatpages.urls')), In the admin section I set the URL of the Flatpage to "/". I get this error Firefox has detected that the server is redirecting the…
Cato Johnston
  • 44,131
  • 10
  • 39
  • 42
1
vote
2 answers

Django flatpages: sort list

{% load flatpages %} {% get_flatpages as flatpages %} The code above will render a simple unordered list containing flatpages. I would…
jerivas
  • 243
  • 2
  • 16
0
votes
3 answers

How can you have Wordpress-like custom fields using Django flatpages?

One of the features that makes a CMS like WordPress powerful is the ability to add additional fields that may be used in the template. WordPress has what it calls custom fields. Is there a way to do that using Django's flat pages? If not, is there…
rick
  • 4,103
  • 9
  • 37
  • 41
0
votes
0 answers

Change dockerized Django default app from git ignored .env

I need to modify the default flatpages app which is in django.contrib and tinymce in site-packages. Both in gitignored env directory installed from requirements.txt when Docker is starting. How it should be properly done? Dockerfile; I've tried to…
Robb
  • 45
  • 1
  • 5
0
votes
0 answers

DatabaseError when trying to print all flatpages in Django template

I have a Django app that I have just added flatpages to. The issue I am running into is printing out the list of all flatpages that I have created. The reason I want to do this is so that I can print them out in a header navigation template so that…
soqqq
  • 1
0
votes
0 answers

Add extra context to a Django Flatpages template

The flatpage() view in Django's Flatpages app passes a single context item to templates, flatpage. I'd like to add more data to the context and the only way I can think of is to copy both the flatpage() and render_flatpage() functions from the…
Phil Gyford
  • 13,432
  • 14
  • 81
  • 143
0
votes
1 answer

django flatpages works with DEBUG=True, doesn't work with DEBUG=False

I can see that django looks for 500.html when DEBUG is False. What could be the problem?
Alex Kreimer
  • 1,106
  • 2
  • 11
  • 25
0
votes
1 answer

Extending Django FlatPages to use MPTT

Preface: I was writing my own Page app that used MPTT and a custom page model. This was working for me, but FlatPages is more refined than my custom Page Model and so I'm leaning toward just extending it. from django.db import models from…
Francis Yaconiello
  • 10,829
  • 2
  • 35
  • 54
0
votes
1 answer

Publish a custom Django Flatpage at a set date and time

I have a custom Flatpage model: from django.contrib.flatpages.models import FlatPage class MyFlatPage(FlatPage): publish = models.DateTimeField() so that I can add a publish date in the future. Now, I don't have a proper list of flatpages on…
HBMCS
  • 686
  • 5
  • 25
0
votes
1 answer

Add a field to a Django FlatPage proxy model

This is my models.py: from django.contrib.flatpages.models import FlatPage class FlatPageManager(models.Manager): def search(self, query=None): qs = self.get_queryset() if query is not None: or_lookup =…
HBMCS
  • 686
  • 5
  • 25