Setup and Usage Instructions

Setup Instructions


If you want to use Docker then user the Docker Instructions or if you want to use Vagrant then use the Vagrant Instructions. Otherwise, continue with these instructions.

Before you begin make sure you’ve setup and installed Pipenv and Virtualenvwrapper. You can use the Django base site without Virtualenvwrapper however you won’t be able to use the workon command.

Change the directory to where you want keep your django projects.

$ cd ~/Sites

In the same directory run the following commands to download the template.

$ export PROJECT_NAME=example
$ curl -LOk && unzip master
$ mv django-base-site-master $PROJECT_NAME

Setup your virtualenv with pipenv and install the project requirements.

$ pipenv install --dev --python $(which python3)
$ export SECRET_KEY=$(python -c "import random; print(''.join(random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789%^&*(-_=+)') for i in range(50)))")
$ cat > .env <<EOF
DEFAULT_FROM_EMAIL="President Skroob <>"
$ pipenv shell

Remove all unnecessary example configs and template files.

$ make clean

Setup your database:

$ chmod +x
$ ./ migrate

At this point your base site should be setup and you can now run your dev server.

$ ./ runserver


Running the development server

After following the Setup Instructions you can work on your project again by doing the following.

$ workon example
$ ./ runserver

How to edit and build the SCSS and Javascript source files:

First from the root of the project install gulp and the node requirements. This requires that your first install node.

$ npm install -g gulp
$ npm install

Then you can run gulp which will watch for changes to your SCSS and Javascript files changes in the ./src directory.

$ gulp