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 INSTALLED_APPS setting like this:
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
def __unicode__(self):
return self.__str__()
- 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:
{% xprez_front_media %}
{% 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'
Development
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 to pip
requirements
python -m pip install --user --upgrade setuptools wheel twine
cleanup old builds (if exists)
rm -rf ./dist ./build
create dist package
python setup.py sdist bdist_wheel
to check package add this to requirements.txt
file:/<path_to_package>/dist/django_xprez-<version>.tar.gz
upload to testpypi (username: jakub.dolejsek)
python -m twine upload --repository testpypi dist/*
to check package from testpypi add (temporary) this to top of requirements.txt:
--extra-index-url https://test.pypi.org/simple/
upload to pypi (username: jakub.dolejsek)
python -m twine upload dist/*
TODO
- 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.1.1.tar.gz
(3.3 MB
view hashes)
Built Distribution
Close
Hashes for django_xprez-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb46d3d338b07b6ac2c55a3afc6aa0e2f4e53b8b5c08ca6e430e7c08efc36b65 |
|
MD5 | 1b300070238b26a3234e2ea48cf8075c |
|
BLAKE2b-256 | b0653c0c2c09ba8fec244b3547bf7a0c228a25eecede5201b84671f525c76903 |