This is an opinionated Django boilerplate to start Rest API projects
- Django as main web Framework
- Django Rest Framework as API development tooling
- Postgres for SQL Database
- Django Q for scheduled and async tasks.
- Docker/docke-compose for development and standalone deployments.
- Registration
- Autthentication (JWT Token, OTP)
- Accounts (Users/Devices)
- Social Networks Support (Facebook/Google).
- API Documentation
- Deployment Tools
You need to have installed git
, docker
, ssh
and a decent terminal
.
make build
build the images for development.make fixtures
load initial data (optional).make up
start development server.
Probably you need to user the following command for another situations.
make django
to enabledebug
mode during development.make migrations
run django makemigrations commandmake migrate
run django migrate commandmake superuser
make a superuserfor develoment
make test
run pytest over all test files in the projectmake test ARG=path_to_file
run pytest of a single test file.
Firstly we need to configure pre-commit hooks, we need to do this just one time.
brew install pre-commit
installs pre-commitpre-commit install
install hooks in the current repo.pre-commit autoupdate
enables the pre-commit autoupdate.
Recurring commands:
make coverage
run pytest and generate the coverage report.make lint
run flake8 and generate linting report.make report_coverage
serves the coverage report as html atlocalhost:3000
make report_lint
serves the lint report as html atlocalhost:3001
make isort
Fix posible import issuesmake lint
Check code quality based on PEP-8 styleguideesmake test
Run the tests with pytest
This project has a transactional minimum frontend views, it is to process flows like:
- Confirm Email
- Reset password
The usage of these views are completely optional. If you want to testi it
by yourself you need to have nodejs
installed, after that run the
following commands:
npm install --global gulp-cli
Install gulp globallynpm install
Install nodejs dependenciesgulp
generatecss
,js
frontend assets.