forked from Hostea/dashboard
1.6 KiB
1.6 KiB
Development Setup
Development Dependencies
- Python
3.10.4
- Pip
- Virtualenv
- GNU make
- PostgreSQL
- SMTP server(instructions available for Docker setup)
- (Optionally) Docker: used to spin up PostgreSQL instance
Setup
- Clone the project
git clone https://gitea.gna.org/Hostea/dashboard.git && cd dashboard
- Create
virtualenv
and activate environment
virtualenv venv && source venv/bin/activate
- 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
- 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
- Setup SMTP server
We are using the excellent development SMTP server maildev.
docker create --name hostea-smtp \
-p 1080:1080 \
-p 10025:1025 \
maildev/maildev \
--incoming-user \
admin \
--incoming-pass password && \
docker start hostea-smtp
SMTP is available at port 10025 and the email web interface at port 1080
- Install Dependencies
make env
- Apply database migrations
make migrate
- Create superuesr
python manage.py createsuperuser
And provide information requested
- Launch development server
make