template-backend/README.md

47 lines
934 B
Markdown
Raw Permalink Normal View History

2025-02-11 17:43:52 +00:00
# simplest Django and django-rq
2024-08-13 09:45:55 +00:00
## How to use
2025-02-11 17:43:52 +00:00
2024-08-12 19:22:51 +00:00
To run:
`docker-compose up -d`
Site available on 8000 port.
You can make any changes in code, they will appear automatically. If you want to execute something with manage.py use:
2025-02-11 17:43:52 +00:00
2024-08-13 09:45:55 +00:00
```sh
2024-08-12 19:22:51 +00:00
docker-compose exec app python3 manage.py migrate
docker-compose exec app python3 manage.py makemigrations
docker-compose exec app python3 manage.py update_admin admin adminpass # create superuser
```
2025-02-11 17:43:52 +00:00
2024-08-12 19:22:51 +00:00
and so on.
2024-08-13 09:45:55 +00:00
## Install formatting
2025-02-11 17:43:52 +00:00
2024-08-13 09:45:55 +00:00
**Features**
2025-02-11 17:43:52 +00:00
2024-08-13 09:45:55 +00:00
- check for unsolved merge conflicts
- black formatting
- sort imports
- remove unused variables, imports, duplicates
- flake8 verification
It executes on **every** commit
2025-02-11 17:43:52 +00:00
2024-08-13 09:45:55 +00:00
```sh
pip install pre-commit flake8 black
pre-commit install
```
2025-02-11 17:43:52 +00:00
2024-08-13 09:45:55 +00:00
Apply for all files in current directory:
2025-02-11 17:43:52 +00:00
2024-08-13 09:45:55 +00:00
```sh
pre-commit run --all-files
```
2025-02-11 17:43:52 +00:00
2024-08-13 09:45:55 +00:00
If there is PEP8 errors, commit will be forbidden. To force commit use flag --no-verify:
2025-02-11 17:43:52 +00:00
2024-08-13 09:45:55 +00:00
```sh
git commit --no-verify ...
```