jhancock532 / wagtail-torchbox

Wagtail build of Torchbox.com

Home Page:https://torchbox.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Torchbox.com on Wagtail

Build Status

This is the main Torchbox.com website.

Setting up a local build

This repository includes docker-compose configuration for running the project in local Docker containers, and a fabfile for provisioning and managing this.

Dependencies

The following are required to run the local environment. The minimum versions specified are confirmed to be working: if you have older versions already installed they may work, but are not guaranteed to do so.

Note that on Mac OS, if you have an older version of fabric installed, you may need to uninstall the old one and then install the new version with pip3:

pip uninstall fabric
pip3 install fabric

You can manage different python versions by setting up pyenv: https://realpython.com/intro-to-pyenv/

Running the local build for the first time

If you are using Docker Desktop, ensure the Resources:File Sharing settings allow the cloned directory to be mounted in the web container (avoiding mounting OCI runtime failures at the end of the build step).

Starting a local build can be done by running:

git clone [URL TO GIT REMOTE]
cd tbx
fab build
fab start
fab sh

Then within the SSH session:

./manage.py migrate
./manage.py createcachetable
./manage.py createsuperuser
./manage.py runserver 0:8000

The site should be available on the host machine at: http://127.0.0.1:8000/

Frontend tooling

There are 2 ways to run the frontend tooling:

With the frontend docker container (default)

After starting the containers as above and running ./manage.py runserver 0:8000, in a new terminal session run fab npm start. This will start the frontend container and the site will be available on port :3000 using browsersync. E.G localhost:3000.

Locally

To run the FE tooling locally. Create a .env file in the project root (see .env.example) and add FRONTEND=local. Running fab start will now run the frontend container and you can start npm locally instead

There are a number of other commands to help with development using the fabric script. To see them all, run:

fab -l

Front-end assets

Frontend npm packages can be installed locally with npm, then added to the frontend container with fabric like so:

npm install promise
fab npm install

Installing python packages

Python packages can be installed using poetry in the web container:

fab sh-root
poetry install wagtail-guide

Deployments

Merges to master and staging will automatically trigger a deployment to the production and staging sites, respectively.

About

Wagtail build of Torchbox.com

https://torchbox.com

License:MIT License


Languages

Language:Python 75.1%Language:HTML 13.1%Language:SCSS 9.5%Language:JavaScript 1.9%Language:Dockerfile 0.3%Language:Shell 0.1%