django-template/README.md

125 lines
1.3 KiB
Markdown
Raw Normal View History

2022-08-09 11:32:42 +02:00
# Requirements
- [Docker](https://www.docker.com/).
- [Docker Compose](https://docs.docker.com/compose/install/).
# Run 🏃
2021-04-01 09:48:35 +02:00
2022-08-09 11:32:42 +02:00
```
docker-compose up
2021-07-01 09:46:33 +02:00
```
2022-08-09 11:32:42 +02:00
Open the browser at `http://ruralmeet.localhost/`.
2021-04-01 09:48:35 +02:00
2022-08-09 11:32:42 +02:00
# Installation
2021-04-01 09:48:35 +02:00
2022-08-09 11:32:42 +02:00
## Development
2021-04-01 09:48:35 +02:00
2022-08-09 11:32:42 +02:00
1. Create .env file.
```bash
2022-08-09 11:33:25 +02:00
cp env.example .env
2021-04-01 09:48:35 +02:00
```
2022-08-09 11:32:42 +02:00
2. Load fake data
2021-04-01 09:48:35 +02:00
2022-08-09 11:32:42 +02:00
``` bash
2022-08-09 11:34:23 +02:00
make run.loaddata.fake
2022-08-09 11:32:42 +02:00
```
### Run Gulp
```
2021-04-01 09:48:35 +02:00
gulp dev
```
2022-08-09 11:32:42 +02:00
### Recreate docker
```
make docker.recreate.django
```
### Load fake data
```
2022-08-09 11:34:23 +02:00
make run.loaddata.fake
2022-08-09 11:32:42 +02:00
```
## Production
1. Create .env file.
```bash
2022-08-09 11:33:25 +02:00
cp env.example .env
2022-08-09 11:32:42 +02:00
```
2. Load minimum data
``` bash
make run.loaddata
```
3. Create superuser
``` bash
docker-compose exec -T django bash -c "python3 manage.py createsuperuser"
```
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://project.localhost`.
- Gulp: `http://project.localhost:3000`.
- Django: `http://project.localhost:8000`.
- Mailhog: `http://project.localhost:8025`.
2021-04-01 09:48:35 +02:00
### Bash Django
``` shell
docker exec -it project-django bash
2021-04-01 09:48:35 +02:00
```