django-template/README.md

135 lines
1.5 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
```
npm i
gulp
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
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
make run.loaddata.test
```
### 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
```
make run.loaddata.test
```
## Production
1. Create .env file.
```bash
cp .env.example .env
```
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
```
# 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://proyect.com`.