- Requirements
- Installation
- Where to go from here?
- Versioning
- Style Guide
- Debugging
- Deployment
- Merge conflicts
- Git hooks
- FAQ
- Contributing
- License
- Python 3.8+
- Pip
- Virtualenv (or the package manage of your choice)
- Node 16
- Docker (Install instructions)
- mkcert
-
Setup container .env files
cp docker/config/python.example.env docker/config/python.env
-
Include this ip on your hosts-file
127.0.0.1 SimpleBlog.com.test
On windows you can run this command to append it:
echo 127.0.0.1 SimpleBlog.com.test >> c:\windows\System32\drivers\etc\hosts
-
Add root cert:
mkcert -install
(if not already available) -
Generate ssl certs for local development
mkcert --cert-file docker/files/certs/cert.pem --key-file docker/files/certs/cert-key.pem SimpleBlog.com.test
-
Enable SSL in Nginx
sed -i.bak 's/\#mkcert\ //g' docker/files/config/nginx.conf.template rm -f docker/files/config/nginx.conf.template.bak
-
Start project
docker-compose up
-
Install and start frontend
cd frontend nvm use npm i npm run dev
-
Visit your site on: https://SimpleBlog.com.test:8081
- ...or login to https://SimpleBlog.com.test:8081/wt/cms (Username:
admin
and password:admin
)
- ...or login to https://SimpleBlog.com.test:8081/wt/cms (Username:
We recommend you to check out our Getting Started Guide. Otherwise, you can read up any of the following topics:
- Frontend Developer Guide
- Backend Developer Guide
- Provision and configure a webserver for hosting
- Setting up deployment on CircleCI
- Adding Slack notifications to CircleCI
- Sync data between environments
- Running python locally
- Using static site generation
- Working with Wagtail's routable pages
- Serving custom content type data through Next.js
- Adding multi language support
- Adding wagtail-2fa support
- Adding Sentry
- Handling CSRF Tokens
- Scaffolding
This project follows semantic versioning.
Bump version in:
- src/pipit/settings/base.py
(APP_VERSION=)
- frontend/package.json
- src/Dockerfile
...or just use the bump-version git hook
We follow the django coding style, which is based on PEP8.
This project is configured for remote debugging using VS Code with the official Python extension. Set VS_CODE_REMOTE_DEBUG=True
in docker/config/python.env
and restart your container to enable it.
You should now be able to attach to the running Django server instance.
PTVSD (Python Tools for Visual Studio debug server) is configured to listen for connections on port 5678.
To use pdb you need to start the container with service-ports exposed instead of docker-compose up. This will create a container called <project_prefix>_python_run_1
docker-compose run --rm --service-ports python
We use git-hooks to streamline and automate certain functions, such as version bumping and pre hooks for code validation and tests. If you want to bypass any of them append the --no-verify
flag (example: git push --no-verify
)
These hooks will automatically bump the application version when using git flow release ...
chmod +x $PWD/.githooks/bump-version.sh
ln -nfs $PWD/.githooks/bump-version.sh .git/hooks/post-flow-release-start
ln -nfs $PWD/.githooks/bump-version.sh .git/hooks/post-flow-hotfix-start
On windows
ln -nfs %cd%/.githooks/bump-version.sh .git/hooks/post-flow-release-start
ln -nfs %cd%/.githooks/bump-version.sh .git/hooks/post-flow-hotfix-start
This hook will run the test suite before every push.
chmod +x $PWD/.githooks/pre-push.sh
ln -nfs $PWD/.githooks/pre-push.sh .git/hooks/pre-push
chmod +x $PWD/.githooks/pre-commit.sh
ln -nfs $PWD/.githooks/pre-commit.sh .git/hooks/pre-commit
You can rebuild your application with the latest data dump by running the following
./scripts/stage_to_local.sh
Note: This requires that you have ssh-key based access to the server.
Read the instructions for Mac OS or Windows on docker.com.
docker-compose run --rm python test
To run manage.py commands in docker is pretty straightforward, instead of targetting you local machine you just target your python
container.
- Example: Create migrations
docker-compose exec python ./manage.py makemigrations
- Example: Run migrations
docker-compose exec python ./manage.py migrate
We also have a manage.sh script to make running management commands easier.
./scripts/manage.sh makemigrations
First update your requirements/base.txt, then rebuild your container:
docker-compose stop
docker-compose up --build
This project includes a provision script that sets up anything necessary to run the application (install db, add nginx/uwsgi conf).
ansible-playbook provision.yml -i stages/<stage>.yml
Want to contribute? Awesome. Just send a pull request.
SimpleBlog is proprietary software. All rights reserved.