feat: lots of stuff
This commit is contained in:
@@ -1,11 +1,69 @@
|
||||
# Django Template
|
||||
# Shop
|
||||
|
||||
## How to use the template?
|
||||
## Desarrollo
|
||||
|
||||
Just run this, changing the project name:
|
||||
### Establecer variables de entorno
|
||||
|
||||
A partir del archivo `.env.example`, creamos un archivo `.env` en el que podemos establecer las
|
||||
[variables de entorno](#variables-de-entorno).
|
||||
|
||||
### Instalar dependencias
|
||||
|
||||
```bash
|
||||
django-admin startproject --template=https://github.com/pablo-moreno/django-template/archive/refs/heads/main.zip <project name>
|
||||
pip install -r requirements.test.txt
|
||||
```
|
||||
|
||||
- Django's extensions already installed (such as the beautiful shell plus)
|
||||
### Lanzar migraciones
|
||||
|
||||
```bash
|
||||
python manage.py migrate
|
||||
```
|
||||
|
||||
### Arrancar servidor
|
||||
|
||||
```bash
|
||||
python manage.py runserver
|
||||
```
|
||||
|
||||
### Tareas de Celery
|
||||
|
||||
```bash
|
||||
celery -A config worker -B -l debug
|
||||
```
|
||||
|
||||
### Pruebas con pytest
|
||||
|
||||
```bash
|
||||
pytest --cov
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Variables de entorno
|
||||
|
||||
Puedes crear un archivo `.env` con las siguientes variables de entorno.
|
||||
|
||||
| Variable | Default value | Comments |
|
||||
|-------------------------|----------------------------------|--------------------------------------------|
|
||||
| SECRET_KEY | secret key | Clave de encriptación |
|
||||
| DEBUG | TRUE | Modo de desarrollo activo |
|
||||
| DATABASE_URL | sqlite:///db.sqlite3 | URL de conexión a base de datos |
|
||||
| STATIC_ROOT | static | Carpeta de estáticos |
|
||||
| MEDIA_ROOT | media | Carpeta de archivos media |
|
||||
| REDIS_HOST | redis | Dirección de servidor Redis |
|
||||
| REDIS_PORT | 6379 | Puerto de Redis |
|
||||
| PAGE_SIZE | 20 | Tamaño de paginación |
|
||||
| ALLOWED_HOSTS | * | Hosts permitidos (CORS) |
|
||||
| CELERY_BROKER_URL | redis://172.17.0.1:6379/0 | Url de conexión para celery |
|
||||
| S3_ENABLED | FALSE | Activado protocolo S3 |
|
||||
| S3_HOST | | URL de servidor S3 |
|
||||
| AWS_ACCESS_KEY_ID | | Clave de acceso de S3 |
|
||||
| AWS_SECRET_ACCESS_KEY | | Clave secreta de S3 |
|
||||
| AWS_STORAGE_BUCKET_NAME | | Nombre del bucket de S3 |
|
||||
| AWS_S3_ENDPOINT_URL | | Endpoint de S3 |
|
||||
| REDSYS_SHARED_SECRET | sq7HjrUOBfKmC576ILgskD5srU870gJ7 | Clave privada de Redsys |
|
||||
| REDSYS_MERCHANT_CODE | 999008881 | Código de negocio de Redsys |
|
||||
| REDSYS_TERMINAL | 001 | Terminal de Redsys |
|
||||
| REDSYS_CURRENCY_CODE | 978 | Código de moneda de Redsys |
|
||||
| REDSYS_TPV_DOMAIN | | Dominio del TPV para redirección de Redsys |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user