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 migrate
to 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
xprezanchor
functionality
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
django_xprez-0.2.31.tar.gz
(3.3 MB
view details)
Built Distribution
File details
Details for the file django_xprez-0.2.31.tar.gz
.
File metadata
- Download URL: django_xprez-0.2.31.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6c46214e486eb40c118662a73e6520e24710e2f557d21203a5057b9085d4c74 |
|
MD5 | 24680b5412f6912c72ace66395e0577e |
|
BLAKE2b-256 | 68b524c189766b6b4d9df29b78bb610b9f74c4f66885ee0e1963886243888d41 |
File details
Details for the file django_xprez-0.2.31-py3-none-any.whl
.
File metadata
- Download URL: django_xprez-0.2.31-py3-none-any.whl
- Upload date:
- Size: 3.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 201f2c52ebb4be43931d93a6e6c90f2c48d2b649ae5ec97e40fe73558e6edf91 |
|
MD5 | a79065882568fbcfa9318277936e77c1 |
|
BLAKE2b-256 | 41f91f249f68b86eaf48333f31fa8c956a8e6e23a486ee9317f8ffcb4cfa30d3 |