Compare commits
2 commits
8193e79c19
...
63807567d6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63807567d6 | ||
|
|
98c92835ef |
5 changed files with 77 additions and 2 deletions
11
.env.example
Normal file
11
.env.example
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
DJANGO_SECRET_KEY="django-secret-key"
|
||||||
|
DEBUG=True
|
||||||
|
PUBLIC_PORT=8000
|
||||||
|
DJANGO_LOGLEVEL=info
|
||||||
|
DJANGO_ALLOWED_HOSTS=localhost
|
||||||
|
DATABASE_ENGINE=postgresql_psycopg2
|
||||||
|
DATABASE_NAME=dockerdjango
|
||||||
|
DATABASE_USERNAME=dbuser
|
||||||
|
DATABASE_PASSWORD=dbpassword
|
||||||
|
DATABASE_HOST=db
|
||||||
|
DATABASE_PORT=5432
|
||||||
66
README.md
66
README.md
|
|
@ -1,2 +1,66 @@
|
||||||
# canasta-back
|
# Canasta Backend
|
||||||
|
|
||||||
|
Backend de servidor de manejo de productos para grupos de compra
|
||||||
|
|
||||||
|
# Instalación
|
||||||
|
|
||||||
|
Requiere tener [Docker](https://docs.docker.com/engine/install) instalado en el sistema
|
||||||
|
|
||||||
|
## 1. Clonar repositorio
|
||||||
|
```console
|
||||||
|
git clone https://git.mps.org.uy/mps-informatica/canasta-back.git
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Crear entorno virtual python
|
||||||
|
|
||||||
|
## 2.1. Opción 1: Pycharm
|
||||||
|
|
||||||
|
[Pycharm](https://www.jetbrains.com/pycharm/) ofrece una manera fácil de trabajar en un projecto python
|
||||||
|
|
||||||
|
**2.1.1** Abrir el proyecto en pycharm
|
||||||
|
|
||||||
|
**2.1.2** En `Settings/Python/Interpreter` > `Add Interpreter/Add Local Interpreter...`
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**2.1.3** Los valores por defecto están bien
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Pycharm include una terminal que ya hace los llamados desde el entorno virtual, para los comandos relacionados a python se debe usar esta terminal
|
||||||
|
|
||||||
|
## 2.2. Opción 2: Venv
|
||||||
|
|
||||||
|
_Próximamente_
|
||||||
|
|
||||||
|
## 3. Instalar librerías
|
||||||
|
|
||||||
|
Este comando instala las librerías de python necesarias
|
||||||
|
|
||||||
|
```console
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. Generar una clave
|
||||||
|
Este comando de python genera una clave para usar en esta aplicación, copiar el resultado
|
||||||
|
```console
|
||||||
|
python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5. Variables de entorno
|
||||||
|
|
||||||
|
Duplicar archivo `.env.example` y renombrar a `.env`
|
||||||
|
|
||||||
|
Pegar la clave generada en el campo `DJANGO_SECRET_KEY`
|
||||||
|
|
||||||
|
## 6. Build
|
||||||
|
|
||||||
|
|
||||||
|
```console
|
||||||
|
docker compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
|
## 7. Listo!
|
||||||
|
|
||||||
|
Abrir en el navegador en [localhost:8000](http://localhost:8000)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ services:
|
||||||
build: .
|
build: .
|
||||||
container_name: django-docker
|
container_name: django-docker
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "${PUBLIC_PORT}:8000"
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
environment:
|
environment:
|
||||||
|
|
|
||||||
BIN
resources/pycharm-add-local-interpreter-2.png
Normal file
BIN
resources/pycharm-add-local-interpreter-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
resources/pycharm-add-local-interpreter.png
Normal file
BIN
resources/pycharm-add-local-interpreter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
Loading…
Add table
Reference in a new issue