Skip to main content

SimpleCMS

This is the simple, Django-based CMS used by Return to the Source, provided here for everyone to use under the GPLv3 license as part of our free and open source philosophy. Also check out our other projects!

Getting started

SimpleCMS provides everything to create websites that can be edited by end users. Here's how to start a new project:

$ pip install django-simplecms
$ simplecms my_awesome_website

This will create a new directory containing a fully configured Django project with models, views and templates. It is a renamed copy of the included example project.

Architecture

SimpleCMS has a rather unique take on Django's MVT architecture. Contrary to regular Django websites, it allows you to write a Django view for each section, rather than for each page on your website. On which pages these sections appear, and in which order, is left to the content editors rather than the programmer. The included edit interface lets them assign sections to pages and fill sections with content.

Here's an example views.py of an app using SimpleCMS:

from cms.views import SectionView
from cms.decorators import section_view

@section_view
class HelloWorld(SectionView):
    verbose_name = 'Hello world section'
    fields = ['content']
    template_name = 'hello.html'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context['message'] = 'Hello World!'
        return context

And here is the contents of hello.html:

<section>
    <h1>{{ message }}</h1>
    {{ section.content }}
</section>

This means that end users can supply the content for each section, and programmers can optionally supply additional logic for each section. Every time a section needs to be rendered, SimpleCMS will call the appropriate section view and insert the rendered result into the final rendered page.

The edit interface

Somewhat like the Django Admin site, SimpleCMS comes with its own editing environment, albeit much simpler and only suitable for editing pages and sections. After authenticating, you can click the "edit" button on any page of the website to alter, add or rearrange sections.

For each section, the section type can be selected from a dropdown menu. As you can see in views.py above, each section type comes with its own list of editable fields. Client-side JS will hide/show the relevant fields based on the selected section type. All sections are stored in the same database table.

Batteries included!

SimpleCMS includes a variety of useful template tags, middlewares, reusable views and models, and all the other boilerplate code needed for new projects.

Feedback

We love to hear from you! Feel free to open an issue or fill out the contact form on our website (which is of course built with SimpleCMS!)

Release files for django-simplecms 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-simplecms 1.1.3
File Size Uploaded
django_simplecms-1.1.3.tar.gz 952.6 kB Details

Release files / django_simplecms-1.1.3.tar.gz

Download URL django_simplecms-1.1.3.tar.gz
Size 952.6 kB
Tags Source
SHA-256 checksum
How to use checksums
37bea8262e15c2beb8be0470e91c9c4cd77709340a917d374339ee3623dc94a5
BLAKE2b-256 checksum
How to use checksums
135912cfce6ca90b8ebc42a79b066cd3a0da1e643586aa8505ed4bb021ae7f34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.1.3 This release

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page