Skip to content

This is a example Django project with voltgrid.py deployment sematics

Notifications You must be signed in to change notification settings

voltgrid/voltgrid-django-example

Repository files navigation

Example Django Project

This is a example Django project that utilises Bureaucrat for initialisation.

It is also ready to deploy in the Python-Bureaucrat Docker container.

Docker

docker build -t example .
docker run -t -i -e SECRET_KEY=foo -e WORKERS=4 -e LOGFILE=/srv/log/foo.log -e PORT=8000 example

Local Install

Step 1: Create a virtual environment

Create a virtual environment. Python Bootstrap is a handy tool for this.

Step 2: Clone this repo

Clone this repo to the base of your newly created virtual environment.

Step 3: Initialise the app

After entering the virtual environment. Run the following:

pip install bureaucrat
cp .env.example .env  # edit as required
bureaucrat init

Running bureaucrat init will run the deployment steps, and start the app.

Optionally: Add the following to bin/activate:

OLDIFS=$IFS; IFS=$'\n'; for l in $(cat $VIRTUAL_ENV/.env); do eval export echo $l; done; IFS=$OLDIFS

This will automatically load the .env settings when entering the virtual environment. Which makes it easier to manually run ./manage.py.

About

This is a example Django project with voltgrid.py deployment sematics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published