Django CMS for presentation websites
Project description
Django Xprez
Xprez is CMS For Django
Quick start
- Install django-xprez:
pip install django-xprez
- Add following apps to your settings.INSTALLED_APPS:
INSTALLED_APPS = [
...
'django.contrib.humanize',
'sorl.thumbnail',
'xprez',
'xprez.ck_editor',
...
]
-
Run
python manage.py migrateto create xprez models. -
Make sure request context processor is enabled in settings:
TEMPLATES = [
...
'OPTIONS': {
'context_processors': [
...
'django.template.context_processors.request',
...
]
},
...
]
- Include the xprez admin URLconf in your project urls.py like this:
path('xprez/', include('xprez.urls')),
- Create models:
from xprez.models import ContentsContainer
class Page(ContentsContainer):
title = models.CharField(max_length=255)
slug = models.SlugField(max_length=255, unique=True)
def __str__(self):
return self.title
- 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
- Render page in template:
{% load xprez %}
{% xprez_front_media %}
{% include 'xprez/includes/photoswipe.html' %}
{% include 'xprez/container.html' with contents=page.contents.all %}
- (optional) Change sorl thumbnail backend in settings - for seo-friendly thumbnail filenames:
THUMBNAIL_BACKEND = 'xprez.contrib.sorl_thumbnail.thumbnail_backend.NamingThumbnailBackend'
- (optional) Look at example_app for more comprehensive example.
Development
To setup automated black formatting connected to git commits:
- install pre-commit
- run
pre-commit install
To rebuild ckeditor:
cd xprez/ck_editor/assets/ckeditor5
npm install
npm run build
To rebuild css styles
cd xprez/static/xprez
npm install
npm run build (or `watch` for developing)
Deploying new version
https://github.com/s-cape/django_xprez/actions/workflows/release.yml
TODO
- add custom module tutorial to Readme
- fix template content to save only relative path to database
- check template content raising UnicodeDecodeError
- create manual for various situations (ck_editor branch)
- using custom config and implement style sources into own building system (using get_module_path.py)
- how to implement
xprezanchorfunctionality
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_xprez-0.2.36.tar.gz.
File metadata
- Download URL: django_xprez-0.2.36.tar.gz
- Upload date:
- Size: 3.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03f211b07509d8cc0d4ae3e1e7f080266c1f476b325ae309662e85d58f140e3b
|
|
| MD5 |
866c141d29de1967489488942308a4c7
|
|
| BLAKE2b-256 |
f3f011c1ce7c28d7f327aef8941ba727129dcc8dd3fc3dd4c4ea830dfbcc6770
|
File details
Details for the file django_xprez-0.2.36-py3-none-any.whl.
File metadata
- Download URL: django_xprez-0.2.36-py3-none-any.whl
- Upload date:
- Size: 3.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d2769f3598ec94f64fd79be2bcb9da18b69a3ad3d6c2485cea31ed2922b6160
|
|
| MD5 |
58502a7380cbb27bfee4ade8360c4bf4
|
|
| BLAKE2b-256 |
38863337af07bd7709c827a3170a179255cbb178add1d433b4952d938eb5fe8a
|