Skip to content

Installing and Running Bootcamp

Sebastian Reyes Espinosa edited this page Nov 22, 2018 · 25 revisions

1 Install Python >3.5 and Django Framework > 1.11

Python version 3.5.x or up

Django version 1.11.x or up.

2 Clone the repository

via HTTPS

git clone https://github.com/vitorfs/bootcamp.git

or via SSH

git clone git@github.com:vitorfs/bootcamp.git

3 Install dependencies

At the project root there is a requirements folder which contains three .txt files.

For development, install the file named local.txt:

pip install -U -r requirements/local.txt

For deployment, install the file named production.txt:

pip install -U -r requirements/production.txt

Note: If you are having problems with Pillow installation please take a look at the detailed installation guide in the documentation

4 Python environment variables and database setup

The project has been conceived to work with PostgreSQL, which you can obtain from their home page.

As the project uses django-environ you will need to create a file named .env at the root of the project with at least the three following values:

DEBUG=True
SECRET_KEY=mys3cr3tk3y
DATABASE_URL=postgres://u_bootcamp:p4ssw0rd@localhost:5432/bootcamp

Note: You can use Django methods to create a new SECRET_KEY

Note 2: To use sqlite on a development environment, you can change the DATABASE_URL to something like

sqlite:////path/to/root/folder/random_name.sqlite3

Note 3: For additional help, we added to the repository the file .env.example which contains a list of variable values to be elevated to environmental values, and then, you can use it as a template to create the .env file required by the project.

5 Running Redis

Bootcamp implements the package django-channels, which requires a proper backend as a channel layer, you can download the version of your choice (v3.x minimum) at their home page; once deployed, remember to configure properly the variable REDIS_URL to your .env file, as provided in the env.example file.

6 Database migrations

After connecting the database, remember to apply the project migrations.

python manage.py migrate

7 Run

python manage.py runserver

8 Deployment considerations

To deploy Bootcamp in production, you need to keep in mind your desired setup for django projects; the only special requirement this platform has is the Redis backend and the recommendation to run on PostgreSQL, beside that, you can use your own ASGI compliant server to allow the django-channels websockets connections to work as intended, also the proxy server you want to use.

9 Develop environments