Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5988975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:02:05+00:00 2026-05-22T23:02:05+00:00

The app I am creating has many static pages, just like the pages of

  • 0

The app I am creating has many static pages, just like the pages of a website which do not change for some time. Im my model I will have a title field and a text field. I am looking go a way to avoid multiple views and multiple urls for each page. I tried using flatpages, but I was not able to get to work the context processors. For example, if a certain page has many grids. So how to write a single view and a url which will deliver all the pages, along with the context processors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:02:06+00:00Added an answer on May 22, 2026 at 11:02 pm

    If you are having problems with flatpages, it’s not hard to write your own version!

    models.py

    from markdown import markdown
    
    class CustomFlatPage(models.Model):
        title = models.CharField(max_length=100)
        body = models.TextField()
        slug = models.SlugField(unique=True)
    

    urls.py

    url(r'^(?P<slug>[-\w]+)/$','myapp.views.customflatpage', name='customflatpage'),
    

    views.py

    from django.views.generic.simple import direct_to_template
    def customflatpage(request,slug):
    page = get_object_or_404(CustomFlatPage, slug=slug)
        return direct_to_template('path/flatpage_template.html',
            extra_context={
                "page":page,
            })
    

    template (has access to request context etc.)

    {{ page.title}}
    {{ load markup }}
    {{ page.body|markdown }}
    

    Use TinyMCE on the body field in django-admin (if you are using it) or your own form if you want rich text.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an app which has around 15 different animations. Some animations are
I'm creating a MonoTouch app that has some declarative business logic that the client
I need some references for creating a Rails app where each client/company has his
I am creating an app that has three tabs on the main screen. Each
I am creating an app that alerts user if he has been stationary for
I am creating a custom membership provider for a web app that already has
In my app am creating some files and storing them in cache dir .
I have a JavaScript widget which communicates with my Rails app by creating tags
Ok, so I am having a lot of trouble creating an app which works
I'm writing to many files in a threaded app and I'm creating one handler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.