This is a starter kit for a Wagtail project. It includes a Docker setup for local development, a basic project structure, and some useful tools and libraries.
- Docker Development Environment
- Postgresql, Mysql or Sqlite3 Database
- Frontend Node SASS and Javascript compilation
- Pico CSS for almost classless styling
- esbuild javascript bundler
- Wagtail CMS v6.3
Required:
- Python >= 3.10
- Docker
- Docker Compose
- Node.js (for frontend build tools)
Optional:
- Git (optional, for version control)
- Make (optional, for running commands)
- NVM (optional, for managing Node versions)
- pre-commit (optional, for running code checks)
- poetry (optional, for managing Python dependencies)
- Clone this repository https://github.com/wagtail-examples/wagtail-starter-kit.git to a location on your computer
- Change into the project directory
- Run
make build
to build the Docker containers - Run
make up
to start the Docker containers - Run
make migrate
to apply database migrations - Run
make createsuperuser
to create a superuser - Run
make run
to start the Django development server
There is a make command to run most of the steps above in one go:
make quickstart
You'll need to run make superuser
separately.
The site will be available at http://localhost:8000.
The Wagtail admin interface will be available at http://localhost:8000/admin.
By default, the project uses PostgreSQL. If you'd like to use MySQL or Sqlite3 instead uncomment the required DC
variable in the Makefile and comment out the others.
The project uses Pico CSS for styling. It's a minmal setup that you can build on.
When you first run the project you will probably notice that no styling is applied. This is because the first time you run the project with make up
the compiled frontend files won't be available. Just run the frontend build scripts below and refresh the page.
The project make no assumption about JavaScript libraries. You can add your own as needed.
The project uses SASS for CSS compilation and esbuild for JavaScript bundling. You can run the build tools with the following commands:
nvm use
npm install
npm start
npm start
will also run BrowserSync to reload the browser when changes are made, it makes your site available at http://localhost:3000
You will need to make sure the Django server is running at the same time.
The project includes a styleguide page at http://localhost:8000/styleguide/ which demonstrates the Pico CSS classless styling and includes some common HTML elements.
The styleguide is available only in debug mode. If required you can remove the style guide from the project by removing the styleguide
app from the INSTALLED_APPS
in base.py
.
Currenyly there is no deployment setup included in this project. You could try this Wagtail deployment guide for some ideas.
There's also a tutorial here on how to deploy a Wagtail site to PythonAnywhere
If you have any suggestions or improvements, please open an issue or a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Sepecific suggestions for development are Comming soon... but for the moment I'd suggest you take a look at the Wagtail documentation