This is the source code to Wagtail's website
- Docker or Vagrant (see below)
- Fabric, AWS CLI and Heroku CLI (only for downloading production / staging data)
You first need to install Docker and Docker Compose. Once they are installed, run the following commands to get up and running:
git clone https://github.com/wagtail/wagtail.org.git
cd wagtail.org
make setup
This will create a set of Docker containers on your local machine and also create a blank database.
Run the following command to start the Docker containers:
make start
Then, to start the development server, open a new terminal window and run:
make runserver
This will launch django-admin runserver
in the web container, which serves the site on http://localhost:8000/, with the admin at http://localhost:8000/admin/.
To run migrations within Docker you'll need to run:
make migrate
To create a new superuser locally, run:
make superuser
This should only need to be done the first time you set up a new database:
make sh
python manage.py createcachetable
If you'd like to work with production data and have access, run the following commands:
fab pull-production-data
fab pull-production-media
Access will only be given when absolutely necessary.
You first need to install Vagrant and Virtualbox. Once they are installed, run the following commands to get up and running:
git clone https://github.com/wagtail/wagtail.org.git
cd wagtail.org
vagrant up
This will download the base image and provision a local VM that will run the site locally.
You will need to apply migrations, create a super user, and create a cache table once the vagrant environment is setup.
vagrant ssh
./manage.py migrate
./manage.py createsuperuser
./manage.py createcachetable
Common Vagrant commands:
vagrant up
starts the VMvagrant halt
stops the VMvagrant ssh
opens a shell in the VMvagrant destroy
deletes the VM
Shortcut commands:
Within the VM shell, you can run ./manage.py
to run any Django management command. But we have added a couple of shortcuts to save on typing:
dj <command> [args]
- Runs a management command (eg,dj shell
)djrun
- Starts the webserver on port 8000
During the initial setup, you will need to build the frontend assets:
nvm use
to use the suggested node version (requires nvm, fnm or similar. You'll also need to runnvm install
to install and activate the version of node required for the project)npm i
to install dependenciesnpm run build
to compile CSS & JS
If you are editing frontend assets, you will also need to rebuild assets while you edit:
npm run start
start the Webpack build in watch mode, without live-reloadnpm run start:reload
start the Webpack server build on port 3000 with live-reload
Other common commands:
npm run lint
lint JS & CSS filesnpm run format
format files
For more info see Frontend general info
The site is hosted on Heroku, and is deployed automatically. main
deploys to production, and staging
deploys to staging.
Wagtail documentation is hosted at readthedocs. A Cloudflare worker is in place to rewrite canonical URLs on old versions of the documentation - see conf/wagtaildocs-cloudflare-worker.js
.