django-flatpages

Django flatpages backup?

我是研究僧i 提交于 2020-01-22 07:15:06
问题 I'm using flatpages in a site that I'm developing in a locally server. I need to backup the flatpage's data for use it in the final server. Does anyone know how to do it? 回答1: On your local server run this: python manage.py dumpdata flatpages --indent=2 > backup.json Then copy backup.json to your final server and load it with: python manage.py loaddata backup.json 来源: https://stackoverflow.com/questions/617860/django-flatpages-backup

Django flatpages backup?

点点圈 提交于 2020-01-22 07:15:04
问题 I'm using flatpages in a site that I'm developing in a locally server. I need to backup the flatpage's data for use it in the final server. Does anyone know how to do it? 回答1: On your local server run this: python manage.py dumpdata flatpages --indent=2 > backup.json Then copy backup.json to your final server and load it with: python manage.py loaddata backup.json 来源: https://stackoverflow.com/questions/617860/django-flatpages-backup

Why does django return 301 and 302 as server response codes after a user logs in and a flatpage is displayed?

独自空忆成欢 提交于 2019-12-23 10:53:06
问题 I'm creating a django app. Users login and are shown a static web page that is managed by the flatpages app. Here are typical status messages from the dev server: [15/Aug/2013 18:43:16] "GET / HTTP/1.1" 200 1263 [15/Aug/2013 18:43:23] "POST / HTTP/1.1" 302 0 [15/Aug/2013 18:43:23] "GET /home HTTP/1.1" 301 0 [15/Aug/2013 18:43:23] "GET /home/ HTTP/1.1" 200 4529 The first line is for the login page at /. This is served successfully, code 200. The second line is the form input. The server

How can I get the reverse url for a Django Flatpages template

前提是你 提交于 2019-12-04 07:48:42
问题 How can I get the reverse url for a Django Flatpages template 回答1: Include flatpages in your root urlconf: from django.conf.urls.defaults import * urlpatterns = patterns('', ('^pages/', include('django.contrib.flatpages.urls')), ) Then, in your view you can call reverse like so: from django.core.urlresolvers import reverse reverse('django.contrib.flatpages.views.flatpage', kwargs={'url': '/about-us/'}) # Gives: /pages/about-us/ In templates, use the {% url %} tag (which calls reverse

Django flatpages backup?

北慕城南 提交于 2019-12-02 23:09:24
I'm using flatpages in a site that I'm developing in a locally server. I need to backup the flatpage's data for use it in the final server. Does anyone know how to do it? On your local server run this: python manage.py dumpdata flatpages --indent=2 > backup.json Then copy backup.json to your final server and load it with: python manage.py loaddata backup.json 来源: https://stackoverflow.com/questions/617860/django-flatpages-backup

Extending Django Flatpages to accept template tags

和自甴很熟 提交于 2019-11-30 04:18:27
I use django flatpages for a lot of content on our site, I'd like to extend it to accept django template tags in the content as well. I found this snippet but after much larking about I couldn't get it to work. Am I correct in assuming that you would need too "subclass" the django flatpages app to get this to work? Is this best way of doing it? I'm not quite sure how to structure it, as I don't really want to directly modify the django distribution. Pierre-Jean Coudert 1. A simple page view wich will render template tags by loading a template for each page: in url.py url(r'^page/(?P<slug>.*)/$

Extending Django Flatpages to accept template tags

萝らか妹 提交于 2019-11-29 01:50:39
问题 I use django flatpages for a lot of content on our site, I'd like to extend it to accept django template tags in the content as well. I found this snippet but after much larking about I couldn't get it to work. Am I correct in assuming that you would need too "subclass" the django flatpages app to get this to work? Is this best way of doing it? I'm not quite sure how to structure it, as I don't really want to directly modify the django distribution. 回答1: 1. A simple page view wich will render