How to link pages in admin to urls

I am a complete beginner so please bear with me.

I am building an online store and I have done most of the work of setting Django up and I have created an app called pages so that I can edit pages in the admin section of Django and then display the pages on the front end. I can create the pages in admin but how do I link a page to a url like /about for example? So that when I go to localhost:8000/about I see the page I created in the admin section of django.

Help is appreciated

It sounds like you’re implementing something similar to Django’s built-in flatpages app: . You can make your app work in the same way for URL mapping - either with a URLconf entry or a middleware. I’d recommend a URLconf entry as the simplest approach, you woud just need to make it last since you won’t have a prefix.

See the flatpage source for how they do this: (one URLconf entry mapping to one view).

Thank you for the information highly appreciated

Ok so I installed the flatpages app that is part of django but for the life of me I cannot make it work on my local server. I have added the following to

from django.contrib import admin
from django.urls import path
from django.contrib.flatpages import views

urlpatterns = [
    path('about/', views.flatpage, {'url':'/about/'}, name='about'),

and this to


I created a page with url /about/ but when I click on view on site it goes to and displays and if I try localhost:8000 or I get server not found. So how do I create a simple site with dynamic pages?

I think you’re being directed to ‘’ because you’ve copied code using that demo url from the docs:

The server is accessible on the localhost url’s if you’re using the default runserver, I guess you are already accessing it for the admin?