Installation

Note

pylabber requires PostgreSQL. Before starting the installation, make sure you have PostgreSQL installed and create a new database.

There are many tutorials online providing detailed instructions on how to do this, some recommended ones can be found in Digital Ocean, DjangoGirls, and Medium.

  1. Clone pylabber to a local directory:

    $ git clone https://github.com/TheLabbingProject/pylabber
    
  2. From within the project’s directory, create a virtual environment using venv:

    $ python3 -m venv venv
    
  3. Activate the virtual environment:

    $ source venv/bin/activate
    
  4. Install the required dependencies:

    $ pip install -r requirements.txt
    

5. Create the appropriate environment variables for the settings.py file. You can find each of those variables wrapped in an env(“VAR_NAME”) call.

An example for an environment variables definition in development could look like:

.env
export SECRET_KEY="s0m3-$\/pER-s3CrE7_kEy!"
export DB_NAME=pylabber
export DB_USER=postgres
export DB_PASSWORD=p$q1@ddmmIN
export MEDIA_ROOT="/where/to/save/files/locally/"
  1. Apply the project’s migrations:

    $ python manage.py migrate
    
  2. Run pylabber locally:

    $ python manage.py runserver
    

    or, open an interactive Django shell using django-extensions:

    $ python manage.py shell_plus