Skip to content

Local Dev setup

You can either folllow the setup with Docker or without Docker, the instructions are listed below.

With Docker

To run locally Docker these are the steps.

Requirements

Have these installed first before continuing further.

  • Docker
  • Docker compose
  • GNU Make
  • GitHub CLI (optional, but recommended) https://cli.github.com/

Starting the local env

  1. Fork the repo. See the GitHub docs for instructions on how to Fork a repo.

  2. Clone your fork:

gh repo clone <personal-account>/pyladiescon-portal
git clone <personal-account>/pyladiescon-portal.git
  1. Start the local environment:
make serve
  1. Open the browser and go to http://localhost:8000/ to see the app running.

  2. Run the tests:

make test

Without Docker

To run locally without Docker these are the steps.

Requirements

Have these installed first before continuing further.

Starting the local env

  1. Fork the repo. See the GitHub docs for instructions on how to Fork a repo.

  2. Clone your fork:

gh repo clone <personal-account>/pyladiescon-portal
git clone <personal-account>/pyladiescon-portal.git

Install dependencies

Create a python environment and activate it:

python3 -m venv .env
source .env/bin/activate
python3 -m venv .env
.env\Scripts\activate

Install dependencies for development:

pip install -r requirements-dev.txt

If you want to run the docs you'll also need some docs dependencies:

pip install -r requirements-docs.txt

Postgres Setup

To run the application you'll need to have PostgreSQL running on your machine. Follow one of the guides below to install it:

Installation in MacOS 1. Install PostgreSQL
brew install postgresql
2. Run PostgreSQL
brew services start postgresql
Installation in Windows Download the installer from here and follow the screen prompts

Now export the environment variable below:

export SQL_USER=<your-user>
set SQL_USER=<your-user>

For example, Jess' username is "jesstemporal", so her command looks like this:

export SQL_USER=jesstemporal
set SQL_USER=jesstemporal

Applying Migrations

Now is time to create the database to store all the information:

python manage.py migrate

Run the server

Add the other enviroment variables:

export SECRET_KEY=deadbeefcafe
export DJANGO_ALLOWED_HOSTS="localhost,127.0.0.1"
set SECRET_KEY=deadbeefcafe
set DJANGO_ALLOWED_HOSTS="localhost,127.0.0.1"

Then run the server:

python manage.py runserver

Documentation Setup

The documentation is built using MKDocs and markdown.

Local docs setup

  1. Create and activate a virtual environment:
python3 -m venv venv
source .env/bin/activate
python3 -m venv venv
.env\Scripts\activate
  1. Install docs requirements:
pip install -r requirements-docs.txt
  1. Run the docs server:
mkdocs serve -a localhost:8888
  1. Open the browser and go to http://localhost:8888/ to see the docs running.

Docs Troubleshooting

Cairo library was not found

If you see the error Cairo library was not found, try the following instructions:

  1. MKDocs material image processing Docs.

  2. Check if the Cairo libraries are listed in /opt/homebrew/lib folder. If not, follow the instructions on this page.