Backend for evis.market
Frontend is built on Vue.js in the separate repo.
- Linux
- Python 3.8+ installed
- make and dev tools (optional)
If you have make
installed - run
make help
./install.sh
Create virtual environment:
python3 -m venv .venv
Activate virtual environment:
source .venv/bin/activate
Upgrade pip:
pip3 install --upgrade pip
Install dependencies:
pip3 install -r requirements.dev.txt
Create database and load initial data:
cd src
./manage.py migrate
./manage.py createsuperuser
./manage.py loaddata initial.json
Run tests:
$ pytest .
Run development server:
$ cd src
$ ./manage.py runserver
Server will be accessible by http://localhost:8000/
- English only everywhere: docs, comments, commit messages...
- Every class, class method, class propery, model, model field should have a docstring.
- Use django's style guide.
- Configure your IDE to use flake8 for checking your python code. For running flake8 manualy, do
cd src && flake8
- Commit messages should contain the unique id of issue they are linked to (refs #12345)
- Prefer simple code (KISS)
- Prefer few small classes over one big.
- No logic allowed in views or templates. Only services (separate class) and models.
- Do not use signals.
- Read django best practices
- Use PEP-484 type hints when possible.
- Prefer Manager methods over static methods.
- No l10n is allowed in python code, use django translation.