django-template/README.md

89 lines
910 B
Markdown
Raw Normal View History

2021-04-01 09:48:35 +02:00
# Install
2021-07-01 09:46:33 +02:00
``` sh
make docker.recreate.django
make run.loaddata
make run.server
```
Now open:
2021-04-01 09:48:35 +02:00
2021-07-01 09:46:33 +02:00
`http://api.localhost`
2021-04-01 09:48:35 +02:00
## Gulp
```shell
npm i
```
Run.
```shell
gulp dev
```
2021-07-01 09:46:33 +02:00
## Tools
Lint
```shell
make lint
2021-04-01 09:48:35 +02:00
```
2021-07-01 09:46:33 +02:00
Formatear
2021-04-01 09:48:35 +02:00
2021-07-01 09:46:33 +02:00
```shell
make format
2021-04-01 09:48:35 +02:00
```
2021-07-01 09:46:33 +02:00
Recrear imagen de Django
2021-04-01 09:48:35 +02:00
2021-07-01 09:46:33 +02:00
```shell
make docker.recreate.django
2021-04-01 09:48:35 +02:00
```
2021-07-01 09:46:33 +02:00
Hacer una nueva migración después de cambiar un model.
2021-04-01 09:48:35 +02:00
2021-07-01 09:46:33 +02:00
```shell
make makemigrations
```
Migrar
```shell
make run.migrate
```
Cargar data mínima.
```shell
make run.loaddata
```
Generar data de desarrollo.
```shell
make run.loaddata.test
```
2021-04-01 09:48:35 +02:00
2021-07-01 09:46:33 +02:00
## Other domains
2021-04-01 09:48:35 +02:00
- Caddy: `http://api.localhost`.
2021-07-01 09:46:33 +02:00
- Gulp: `http://api.localhost:3000`.
- Django: `http://api.localhost:8000`.
- Mailhog: `http://api.localhost:8025`.
2021-04-01 09:48:35 +02:00
### Bash Django
``` shell
docker exec -it api_django_1 bash
```
# Run production
``` sh
2021-04-01 09:58:13 +02:00
docker-compose -f docker-compose.pro.yaml up
2021-04-01 09:48:35 +02:00
```
Open `https://domain.com`.