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.16

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.16
File Size Uploaded Provenance
django_xprez-0.3.16.tar.gz 2.4 MB Without provenance Details

Built distribution (wheel)

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

Total release size: 5.0 MB

Release files / django_xprez-0.3.16.tar.gz

Download URL django_xprez-0.3.16.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
8392d54db2966f95b3188ac9e0cd423391455ffb0253fd62c45eb7839d4553b5
BLAKE2b-256 checksum
How to use checksums
4a656dae7dde6d90003aa924de488eae5af1efca40afde1010c9b0c5851bd265
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

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

Download URL django_xprez-0.3.16-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b8e4531a8f4c7c9a25b9566820f9ce375042b4f05bd2365a6d5c562e2534d4eb
BLAKE2b-256 checksum
How to use checksums
89af840df9fab33bb7b7c5f609150c14c1a7788e899b233ca559ab50be8a5a63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for django-xprez 0.3.16

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.16 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