Skip to main content

PyPI version Code style: black

Django Xprez

A flexible Django CMS with built-in modules and easy custom modules.

The backend works well with Django admin but can also be used standalone.

Features

  • Structure
    • Containers — apply or extend in your own models (e.g. Page, Article).
    • Sections — rows with max-width, background (part of the structure).
    • Modules (content blocks)
      • Built-in: text, quote, gallery, files, video, numbers, code input, code template, anchor.
      • Custom: simply subclass Module in your app; they auto-register and appear in the same admin UI and frontend.
  • Responsive
    • Layout (visibility, columns, padding, margin, colspan) per breakpoint.
    • Responsive images (srcset, breakpoint-aware sizes).
  • Styles
    • Ready-made frontend CSS included.
    • Or import xprez SCSS into your build.
  • Clipboard and symlinks — Copy modules or sections; paste into another page or paste as symlink to reuse the same content.

Quick start

  1. Install django-xprez:
pip install django-xprez
  1. Add following apps to your settings.INSTALLED_APPS:
INSTALLED_APPS = [
        ...
        'sorl.thumbnail',
        'xprez',
        ...
    ]
  1. Run python manage.py migrate to create xprez models.

  2. Make sure request context processor is enabled in settings:

TEMPLATES = [
        ...
        'OPTIONS': {
            'context_processors': [
                ...
                'django.template.context_processors.request',
                ...
            ]
        },
        ...
    ]
  1. Include the xprez urls in your project urls.py like this:
path('xprez/', include('xprez.urls')),
  1. Create models:
from xprez.models import Container

class Page(Container):
    title = models.CharField(max_length=255)
    slug = models.SlugField(max_length=255, unique=True)

    def __str__(self):
        return self.title
  1. Register models in admin:
from django.contrib import admin
from xprez.admin import XprezAdmin
from .models import Page

@admin.register(Page)
class PageAdmin(XprezAdmin):
    pass
  1. Render page in template:
{% load xprez %}
<link rel="stylesheet" href="{% url 'xprez:css_variables_global' %}">
{% xprez_front_media page %}
{% include 'xprez/container.html' with container=page %}
  1. (optional) Add a custom module:
from xprez.models import Module

class MyModule(Module):
    title = models.CharField(max_length=200)
    count = models.PositiveIntegerField(default=0)
    is_featured = models.BooleanField(default=False)

    front_template_name = "myapp/modules/my.html"

    class Meta:
        verbose_name = "My module"

See the built-in modules source for more examples.

  1. (optional) Change sorl thumbnail backend in settings — for SEO-friendly thumbnail filenames and deferred generation:
THUMBNAIL_BACKEND = "xprez.contrib.sorl_thumbnail.LazyNamingThumbnailBackend"

For user documentation, see docs/user/README.md.

For an example, see the example_app in this repository.

For development and contributing, see docs/development.md.

Metadata

Release files for django-xprez 0.3.17

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-xprez 0.3.17
File Size Uploaded Provenance Actions
django_xprez-0.3.17.tar.gz 2.4 MB Without provenance Details for django_xprez-0.3.17.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-xprez 0.3.17
File Interpreter ABI Platform Actions
django_xprez-0.3.17-py3-none-any.whl Python 3 none any Details for django_xprez-0.3.17-py3-none-any.whl

Total release size: 5.0 MB

Release files / django_xprez-0.3.17.tar.gz

Download URL django_xprez-0.3.17.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
046313fad0171a17ac3c2a7703c9a39debd86ca528037b7d0be9a1917f7f802a
BLAKE2b-256 checksum
How to use checksums
f9b10d6bba11c2c285810a7fa97106a503b0b1e28b4fb131b489e2285b8817a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / django_xprez-0.3.17-py3-none-any.whl

Download URL django_xprez-0.3.17-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3d947d3902f39341aa37915f3e9665f72dfd3e3934dabd13f58bdc1fd5d590ff
BLAKE2b-256 checksum
How to use checksums
640e1939d5ccb5d44103d71f2f78f8c94709f3b16450c10227d551d513ad519f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for django-xprez 0.3.17

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.17 This release

2 release files No provenance

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