dashboard/docs/HACKING.md

1.2 KiB

Development Setup

Development Dependencies

  1. Python 3.10.4
  2. Pip
  3. Virtualenv
  4. GNU make
  5. PostgreSQL
  6. (Optionally) Docker: used to spin up PostgreSQL instance

Setup

  1. Clone the project
git clone https://gitea.hostea.org/Hostea/dashboard.git && cd dashboard
  1. Create virtualenv and activate environment
virtualenv venv && source venv/bin/activate
  1. Setup local configuration:

i) Initialize configuration file by copying .env-sample

cp .env-sample .env

ii) Modify the contents of .env:

export DATABSE_URL=postgres://postgres:password@localhost:5432/postgres
export db=hostea-dashboard

iii) Load environment

source .env
  1. Setup PostgreSQL

We are using Docker but you are welcome to bring your own PostgreSQL instance

 docker create --name $db \
	 -e POSTGRES_PASSWORD=password  \
	 -p 5432:5432 \
	 postgres && \
 docker start $db
  1. Install Dependencies
make env
  1. Apply database migrations
make migrate
  1. Create superuesr
python manage.py createsuperuser

And provide information requested

  1. Launch development server
make