a minimal, batteries-included, reusable project skeleton to serve as a starting point for a Wagtail project.
Contents generated with DocToc
- Introduction
- Features β¨
- Getting Started π
- Contributing π€
- Show your support π
- Credits π
- Author π§βπ»
- License π
Embarking on any project "from scratch" is a formidable undertaking, entailing intricate configurations and setup that can quickly become overwhelming. Whether it's the time-consuming task of handling dependencies, structuring the project, or setting up a cohesive development environment β the challenges are universal.
Enter cookiecutter-wagtail-vix
β a template crafted to simplify the kick-off of Wagtail projects. This template is designed to streamline the setup process, sparing you from the headaches that often accompany the early stages of a project. By starting your new Wagtail project using cookiecutter-wagtail-vix
, you leapfrog the tedious setup tasks, allowing you to focus on what truly matters β crafting your project's unique functionality with ease.
Here are some key highlights:
- Tech stack
- A good starting point for any Wagtail project, with essential batteries included and very minimal assumptions on what you are building.
- Production-ready setup, so you don't waste time going from development to production.
- Includes 3 Django apps to start with:
home
: Has aHomePage
model which just extends the WagtailPage
model and does nothing else. This gives you freedom to set it up as you please.core
: has search functionality and wagtail-font-awesome-svg configuration. The idea is to use this app for global functions, utilities, etc. Feel free to rename it toutils
orutilities
if you like!users
: Custom User model as recommended in the Django docs. The model just extendsAbstractUser
and does nothing else, so you can customise it as you please.
- Ready to run background tasks via Django-RQ:
- The
django-rq
package is installed, and all the configuration available, though commented out. Please see note below.
- The
- Custom Bootstrap 5 Compilation using Sass. No other frontend dependencies.
- Configured to work with pytest in conjunction with pytest-django (plus other pytest plugins), factory_boy and wagtail-factories. You have a starting test coverage of 100%! Ain't that great?
- Task execution and automation using
invoke
. - Includes some useful packages to boost your DX and productivity, for instance:
- django-crispy-forms + crispy-bootstrap5
- django-debug-toolbar for use during development
- django-environ β allows you to utilize 12factor inspired environment variables to configure your Django application.
- django-extensions β global custom management extensions for the Django Framework. I especially like
shell_plus
(Django shell with autoloading of the apps database models and subclasses of user-defined classes). - django-widget-tweaks, which allows you to tweak the form field rendering in templates, not in python-level form definitions.
- django-storages β provides a variety of storage backends
- whitenoise β simplified static file serving for Python web apps
- Linting and formatting:
- Detailed documentation via MkDocs
- A minimal, ready to use VSCode configuration, just update the path to your python executable in the generated
.vscode/settings.json
. - Continuous integration (CI) via Github Actions / Gitlab CI/CD.
- Automatic dependency management via Renovate (for Github repos only).
In order to generate a new project from this cookiecutter template:
- ensure that you have cookiecutter installed on your computer
- run
cookiecutter https://github.com/engineervix/cookiecutter-wagtail-vix.git
in your favourite shell. Youβll be prompted for some values, such as project_name, project_slug, email etc. A new wagtail project will be created in a folder named according to the project_slug at your current location. - Thereafter,
cd
into the project folder created above and follow the instructions in your shiny new project's README.
If you would like to run background tasks via django-rq
, you'll need to make the following changes:
-
in
settings/base.py
- uncomment the entry in the
THIRD_PARTY_APPS
list - uncomment
RQ_QUEUES
- uncomment the entry in the
-
in
settings/production.py
- uncomment
RQ_QUEUES
- uncomment the commented out items in the
LOGGING
dict
- uncomment
-
in
Procfile
- uncomment the
worker
entry
- uncomment the
-
in
.env
- uncomment the line
RQ_QUEUE=redis://redis:6379/0
- uncomment the line
-
in
urls.py
- uncomment the line with
path("dj-rq/", include("django_rq.urls")),
- uncomment the line with
-
in
docker-compose.yml
- uncomment the
redis
service entry - uncomment the
worker
service entry
- uncomment the
This project follows the all-contributors specification. Contributions, issues and feature requests are most welcome!
Feel free to check the issues page and take a look at the contributing guide before you get started.
To maintain code quality and formatting consistency, we utilize pre-commit hooks. These hooks automatically check and format your code before each commit. This helps ensure that the codebase remains clean and consistent throughout the development process. Set up the Git pre-commit hooks by running the following
pre-commit install && pre-commit install --hook-type commit-msg
See pre-commit-config.yaml
for more details. In addition, please note the following:
- if you're making code contributions, please try and write some tests to accompany your code, and ensure that the tests pass. Also, were necessary, update the docs so that they reflect your changes.
- your commit messages should follow the conventions described here. Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug".
Once you are done, please create a pull request.
Please give a βοΈ if this project helped you!
.gitignore
generated using https://www.gitignore.io/- favicon created using https://favicon.io/
- Images courtesy of Unsplash and Pixabay
- Placeholder logo courtesy of https://github.com/pigment/fake-logos
- https://loremipsum.io/ for placeholder text
π€ Victor Miti
- Blog: https://blog.victor.co.zm
- Github: @engineervix
Copyright Β© 2020 - 2024 Victor Miti.
This project is licensed under the terms of the MIT license.