Skip to main content

Simple Django CMS

Project description

SimpleCMS

This is the CMS framework used by the web consultancy company Return to the Source, provided here for everyone to use under the AGPL 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 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 type="helloworld">
    <h1>{{ message }}</h1>
    {{ section.content }}
</section>

Everytime 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 javascript 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, default Page and Section models, and all the other boilerplate code needed for new projects.

Feedback and support

We would love to hear from you! Feel free to open an issue or send us an email.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-simplecms-1.1.1.tar.gz (973.7 kB view details)

Uploaded Source

File details

Details for the file django-simplecms-1.1.1.tar.gz.

File metadata

  • Download URL: django-simplecms-1.1.1.tar.gz
  • Upload date:
  • Size: 973.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for django-simplecms-1.1.1.tar.gz
Algorithm Hash digest
SHA256 7b37ae3fda9d89acb30713bca61c47ca551fdc33fc2f487843ef831262dad131
MD5 6ac1b804ca5eb63f27cde8d077c5489c
BLAKE2b-256 80e548db0cf0cb828267885a33c9a07ab4d0d3c261c4d9feb6863b159f2e2261

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page