Installation¶
Note
The tutorial uses the pro template. We recommend all serious websites start with the pro template for best flexibility: Professional Installation
Basic Installation¶
Make a directory (folder) for your project.
Create a virtual environment.
Windows (PowerShell):
PS> python -m venv .\venv\ PS> .\venv\Scripts\Activate.ps1
macOS, Linux:
$ python -m venv ./venv/ $ source ./venv/bin/activate
You can name your virtual environment anything you like. It is just for your use on your computer.
Learn more about virtual environments by visiting the Python documentation on virtual environments here.
In your virtual environment, install CRX:
$ pip install coderedcms
Create a new project:
$ coderedcms start mysite --sitename "My Company Inc." --domain "www.example.com"
``–sitename`` and ``–domain`` are optional to pre-populate settings of your website.
Next, enter the new project folder and set up Django.
$ python manage.py migrate $ python manage.py createsuperuser
Now, you can run a local development server:
$ python manage.py runserver
Go to http://localhost:8000 in your browser, or http://localhost:8000/admin/ to log in with your admin account.
✨🎉 You now have Wagtail CRX up and running! 🎉✨
Professional Installation¶
The professional boilerplate includes additional features pre-configured, such as:
Custom Image and Document models.
Custom User model (using email address as username).
Custom Navbar and Footer.
SCSS compilation (using Python, not Node.js).
Ruff, MyPy, Pytest tooling pre-configured.
To use the professional boilerplate, add --template pro
to the start command:
In your virtual environment, install CRX:
$ pip install coderedcms
Create a new project:
$ coderedcms start mysite --template pro --sitename "My Company Inc." --domain "www.example.com"
``–sitename`` and ``–domain`` are optional to pre-populate settings of your website.
Next, enter the new project folder:
$ cd mysite/
Install the development tooling with:
$ pip install -r requirements-dev.txt
Next, set up Django.
$ python manage.py migrate $ python manage.py createsuperuser
Compile the scss code into CSS:
$ python manage.py sass website/static/website/src/custom.scss website/static/website/css/custom.css
Note
To build the Sass automatically whenever you change a file, add the
--watch
option and run it in a separate terminal. For more options, see django-sass.Now, you can run a local development server:
$ python manage.py runserver
Go to http://localhost:8000 in your browser, or http://localhost:8000/admin/ to log in with your admin account.
When working with Sass, you will want to look at the base.html file provided at:
mysite/website/templates/coderedcms/pages/base.html
to load in any custom
CSS or JavaScript as needed.
Follow the tutorial to build a website with us: Tutorial Part 1: Site Name, Logo, and Global Colors.
Starter Templates¶
You can start a new Wagtail CRX project with a custom template directory available on
or at a URL using the --template
option. Additionally, we provide some built-in templates:
Template |
Description |
---|---|
|
The default starter project. The simplest option, good for most sites. |
|
Custom Image, Document, User models. Extra tooling to support SCSS to CSS compilation. Custom Navbar and Footer. Developer tooling such as ruff, mypy, and pytest. |
Changed in version 3.0: The “pro” template was added in version 3.0. Previously it was named “sass” and had fewer features.