Skip to main content

texsite delivers great and ready-to-use page templates for Wagtail CMS

Project description

texsite

Pipeline Coverage PyPI License

texsite delivers great and ready-to-use page templates for the modern, flexible and user-focused web content management system Wagtail CMS backed by the popular Django web framework, both written in Python.

Based on the amazing StreamField introduced with Wagtail release 1.0, which texsite uses extensively, it has never been easier for editors to author awesome pages. Read more on how this concept works in the great blog article Rich text fields and faster horses written by Matt Westcott, lead technical developer of Wagtail.

Features

  • Clean Blog Pages - based on the Clean Blog theme by Start Bootstrap
  • Business Casual Pages - based on the Business Casual theme by Start Bootstrap
  • Outstanding test coverage
  • Continuously integrated codebase

Technical requirements

New feature releases frequently add support for newer versions of underlying technologies and drop support for older ones. The compatible versions of Wagtail, Django and Python for each texsite release are:

Release Wagtail Django Python
4.0+ 4.1 LTS 3.2 LTS 3.8, 3.9, 3.10, 3.11
3.0 2.11 LTS 3.1 3.8
2.0 2.7 LTS 2.2 LTS 3.6, 3.7, 3.8
1.0 2.3 LTS 1.11 LTS 3.4. 3.5, 3.6

Code and contribution

The code is open source and released under the ISC License (ISCL). It is available on Gitlab and follows the guidelines about Semantic Versioning for transparency within the release cycle and backward compatibility whenever possible.

All contributions are welcome, whether bug reports, code contributions and reviews, documentation or feature requests.

If you're a developer, fork the repo and prepare a merge request:

# Prepare your environment the first time
python3.8 venv ~/virtualenvs/texsite-py38
pip install -e .[development]

# Running the tests while development
python -m django test --settings=tests.settings

# Individual supported versions tests and code quality checks
tox -e py38-dj22-wt27
tox -e isort
tox -e brunette
tox -e flake8

# Ensure code quality running the entire test suite,
# this requires all supported Python releases to be installed
tox

# On created, changed or deleted translations...
# ...update the message files within the respective apps directory
python -m django makemessages --all

# ...edit and translate the message files manually
# ...compile the message files
python -m django compilemessages

Installation

Install texsite directly from PyPI using pip:

pip install texsite

Configuration

Environment

The tool only requires one environment variable to work properly:

  • TEXSITE_DATA_ROOT

This path is used to store:

  • Uploaded user content such as images and documents
  • Collected static files for the web application frontend
  • Environment specific application configuration

For example set this environment variable in a bash to a valid directory path:

export TEXSITE_DATA_ROOT="$HOME/data/texsite"

Django settings

On startup the application loads a module localsettings where you may provide environment specific Django settings, e.g. a database service.

It searches with the sys.path and first adds the path configured in the environment variable TEXSITE_DATA_ROOT.

Docker

We provide production-ready Docker images for our entrypoints.

Tags

The images are built using our GitLab pipelines and hosted within a public GitLab container registry. Our established pipeline recipe (borrowed from callr) ensures

  • the latest tag is up-to-date with the master branch and
  • every Git tag (e.g. v4.1.0) has also a corresponding Docker image tag.

Images

The following images are available:

  • texsite/cli: use the Django and Wagtail management commands (django-admin)
  • texsite/web: serve the Django WSGI application (without serving static and media files)

Usage

For the command line interface simply prepend the docker run command and its options before regular django-admin commands:

# Prepend `docker run` and its options
docker run \
  --name texsite-cli \
  --rm \
  --interactive \
  --tty \
  --env DJANGO_SETTINGS_MODULE=texsite.settings.[dev | production] \
  --env TEXSITE_DATA_ROOT=/texsite-data-root \
  --volume ~/data/texsite:/texsite-data-root \
  texsite/cli \
  # Use regular Django management commands
  [collectstatic | createsuperuser | migrate | ...]
  --settings=texsite.settings.[dev | production]

The web application image runs the Django WSGI application using gunicorn as application server. It can be launched as follows:

docker run \
  --name texsite-web \
  --rm \
  --detach \
  --env DJANGO_SETTINGS_MODULE=texsite.settings.[dev | production] \
  --env TEXSITE_DATA_ROOT=/texsite-data-root \
  --volume ~/data/texsite:/texsite-data-root \
  --publish 5000:5000 \
  texsite/web

Compose

For local testing and development purposes a predefined Docker compose file is available.

After code changes the images have to be rebuilt with docker compose build.

To start all services execute docker compose up --detach --remove-orphans after adapting the compose volumes to your local environment. This runs the following containers:

  • our texsite WSGI application
  • a nginx webserver serving static files and acting as reverse proxy for the application

In addition you can easily use the texsite-cli container executing Django and Wagtail management commands:

docker compose run --rm --publish 8000:8000 texsite-cli runserver 0.0.0.0:8000
docker compose run --rm texsite-cli migrate
docker compose run --rm texsite-cli createsuperuser
docker compose run --rm texsite-cli collectstatic

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

texsite-4.4.0-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file texsite-4.4.0-py3-none-any.whl.

File metadata

  • Download URL: texsite-4.4.0-py3-none-any.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for texsite-4.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44d3782f2f3cf501aa7e0c147ab74efd5347d48fdca75ab9ca2cc02cab2c6f9f
MD5 62bab162bf2270d7a731fef40418a5b8
BLAKE2b-256 4325e64362a74512d6f8913fbfda1a29f28fe814c57b09bb89bb801b9f5b67f9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page