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
2
votes
2 answers

Django 1.1 beta 1 - Flatpages Error, Debug = False, with 404.html

The Django flatpages application has a well-known and oft-discussed-on-the-web bug related to a missing 404.html "Page Not Found" template in your project's templates directory. If you have DEBUG = False in your settings.py file, and you're missing…
Jim McGaw
  • 768
  • 6
  • 13
2
votes
1 answer

How can you get future-dated posts in Django?

I just want to do a basic site in Django and the flatpages app is super simple, but it doesn't support a couple of things that I need, namely custom fields and future-dating. That is setting a publish date to some point in the future rather than…
rick
  • 4,103
  • 9
  • 37
  • 41
2
votes
2 answers

Using flatpages to create a simple facebook app, but CSRF problem caused by signed_request

I am trying to create a simple, html-only facebook app for a client's fb page. I would like to use django's flatpages so that the client and his staff can change the content of the app through the django admin of their site. The problem is that…
Marconius
  • 711
  • 1
  • 6
  • 15
2
votes
2 answers

Django: reverse() and get_absolute_url() returns different output for same object?

When used with flatpages reverse() and get_abolute_url() returns different outputs: >>> about = FlatPage.objects.get(id=2) >>> >>> about >>> >>> about.url >>> '/about-us/' >>> >>>…
Cody
  • 2,480
  • 5
  • 31
  • 62
2
votes
1 answer

Django Flatpages Variables

Is it possible to enter {{ variable }} into a django flatpage and if so, how?
MacPython
  • 17,901
  • 10
  • 42
  • 48
2
votes
2 answers

Django flatpages template tag doesn't work with template inheritance

I have a Django (1.6) application that inherits a base template. I would like to include one of my (currently working) flatpages into the application landing page, something that the Django docs say is possible. Here is my template: {% extends…
tatlar
  • 3,080
  • 2
  • 29
  • 40
2
votes
1 answer

Can't use {{MEDIA_URL}} in Django Flatpages?

A rather simple question which I will elaborate on if needed in order to solve the problem. I attempted to use a simple call to {{ MEDIA_URL }} in order to show an image on an About Us Django flatpage, but it seems the flatpage is ignoring the fact…
fildred13
  • 2,280
  • 8
  • 28
  • 52
2
votes
0 answers

Extending Django Flatpages - logout

I'm creating a simple Django app (1.3.1) running off virtualenv. It's up and running on WebFaction. It's simple enough to only warrant using Flatpages - there is still a bit of enhancement I'd like to make to FlatPages so I'm simply extending the…
niceguydave
  • 401
  • 2
  • 12
2
votes
2 answers

Django 1.4 in windows 7 "No FlatPage matches the given query"

I already searched for everything I could, but this annoying error is still there. The admin interface (localhost:8000/admin/) works fine, but no one else. Obs.: Im using Apress - Practical Django Projects (2nd edition) to learn Django. I'll post my…
Vinicius
  • 123
  • 9
1
vote
1 answer

DatabaseError: no such table: django_template

Im getting this error when trying to access a customized version of flatpages in my admin: DatabaseError: no such table: django_template On settings I have flatpages, the middleware and of course my custom flatpages installed... what could be the…
maumercado
  • 1,453
  • 4
  • 23
  • 47
1
vote
3 answers

django-cms, django flatpages, tiny mce not displaying

I've implemented both django-cms and flatpages, but can not get tiny_mce to display in either. urls.py (r'^tinymce/', include('tinymce.urls')), from django.conf import settings if settings.DEBUG: urlpatterns += patterns('', …
Ana
1
vote
4 answers

How can I specify a prepopulated value for many to many relationships in django 1.0 (flatpages)?

Django flatpages uses a many-to-many relationship with the django Site model class FlatPage(Model) ... sites = ManyToManyField(Site) You must select a site when creating a new flatpage. While I might utilize multiple sites later, right now…
Marco
  • 1,471
  • 11
  • 17
1
vote
2 answers

How to get page parent when using Django flatpages?

Since Django urls are arbitrary, including those set when you create flatpages. How can you figure out what a page's parent is? That is if I create a page /about/contact/, then when I am on the contact page (in the template), how can I figure out…
rick
  • 4,103
  • 9
  • 37
  • 41
1
vote
2 answers

Why does Django's flatpages allow logging a 404 error?

A funny thing I've noticed about Django's flatpages app: it allows core/handlers/base.py to log a warning Not Found: $page. As a result of that, my Sentry logs are full with 404s for legitimate and working pages. It seems to happen because first…
Nikolai Prokoschenko
  • 8,465
  • 11
  • 58
  • 97
1
vote
1 answer

Login required for django Flatpages

Is there an easy way to put login required decorator to all my Flatpages? Do I need to modify my url conf? (r'',include('django.contrib.flatpages.urls')), Thanks, Fred
Speccy
  • 694
  • 8
  • 30