Skip to content

alpashko/education-backend

 
 

Repository files navigation

CI Maintainability Test Coverage

Django-based production project, integrated with Tinkoff, zoom.us, Dashamail, Postmark, S3 and telegram. Frontend is built on vue.js in the separate repo.

Configuration

Configuration is stored in src/app/.env, for examples see src/app/.env.ci

Installing on a local machine

This project requires python3.9, running postgres and redis.

Install requirements:

pip install --upgrade pip pip-tools
pip-sync dev-requirements.txt requirements.txt
cd src
cp app/.env.ci app/.env  # default environment variables
./manage.py migrate
./manage.py createsuperuser

Testing:

# run unit tests
$ pytest

Development servers:

# run django dev server
$ ./manage.py runserver

Backend Code requirements

Style

  • Obey django's style guide.
  • Configure your IDE to use flake8 for checking your python code. For running flake8 manualy, do cd src && flake8
  • Prefer English over your native language in comments and commit messages.
  • Commit messages should contain the unique id of issue they are linked to (refs #100500)
  • Every model and a model method should have a docstring.

Code organisation

  • KISS and DRY.
  • Obey django best practices
  • If you want to implement some business logic — make a service for that. Service examples: UserCreator, OrderCreator
  • No logic is allowed within the views or templates. Only services and models.
  • Use PEP-484 type hints when possible.
  • Prefer Manager methods over static methods.
  • Do not use signals for business logic. Signals are good only for notification purposes.
  • No l10n is allowed in python code, use django translation.

About

Django-based backend for our learning management system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.2%
  • Other 0.8%