-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update environment configuration, enhance README, and modify admin fu…
…nctionalities - Changed SQL_PASSWORD and DEBUG settings in .env file for local development. - Expanded README.MD to provide detailed project information, installation steps, and functionalities. - Updated requirements.txt to include new dependencies and remove unused ones. - Enhanced admin interface with custom user forms and added a dashboard view for better management. - Implemented new metrics and configuration models to track business performance. - Improved error handling in WhatsApp message sending functionality. - Adjusted serializers and views to incorporate new business logic and validation rules.
- Loading branch information
1 parent
569d12c
commit 98928b9
Showing
75 changed files
with
1,968 additions
and
1,094 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
SECRET_KEY=dfe3ffewfwefwe12312&^$%@(&$^()*FDVWje2 | ||
SQL_DATABASE=kiki | ||
SQL_USER=postgres | ||
SQL_PASSWORD=9wa8rfj298f98%&jsdf23hf | ||
SQL_PASSWORD=1234 | ||
SQL_HOST=localhost | ||
SQL_PORT=5432 | ||
SQL_ENGINE=django.db.backends.postgresql | ||
DEBUG=0 | ||
DEBUG=1 | ||
EMAIL_HOST_USER=uncubanodev@gmail.com | ||
EMAIL_HOST_PASSWORD=ypqszngcbnvyupsv | ||
DJANGO_ALLOWED_HOSTS=* | ||
DJANGO_ALLOWED_HOSTS=["uncubano.dev", "www.uncubano.dev", "localhost", "127.0.0.1"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Desarrollo | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout del repositorio | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configurar Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Instalar dependencias | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
- name: Configurar variables de entorno | ||
run: | | ||
echo "SECRET_KEY=tu_secreto" >> $GITHUB_ENV | ||
echo "DEBUG=1" >> $GITHUB_ENV | ||
echo "SQL_DATABASE=kiki_dev" >> $GITHUB_ENV | ||
echo "SQL_USER=postgres" >> $GITHUB_ENV | ||
echo "SQL_PASSWORD=postgres" >> $GITHUB_ENV | ||
echo "SQL_HOST=localhost" >> $GITHUB_ENV | ||
echo "SQL_PORT=5432" >> $GITHUB_ENV | ||
- name: Ejecutar migraciones | ||
run: | | ||
source venv/bin/activate | ||
python manage.py migrate | ||
- name: Ejecutar servidor de desarrollo | ||
run: | | ||
source venv/bin/activate | ||
python manage.py runserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Producción | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout del repositorio | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configurar Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Instalar dependencias | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
- name: Configurar variables de entorno | ||
run: | | ||
echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> $GITHUB_ENV | ||
echo "DEBUG=0" >> $GITHUB_ENV | ||
echo "SQL_DATABASE=${{ secrets.SQL_DATABASE }}" >> $GITHUB_ENV | ||
echo "SQL_USER=${{ secrets.SQL_USER }}" >> $GITHUB_ENV | ||
echo "SQL_PASSWORD=${{ secrets.SQL_PASSWORD }}" >> $GITHUB_ENV | ||
echo "SQL_HOST=${{ secrets.SQL_HOST }}" >> $GITHUB_ENV | ||
echo "SQL_PORT=${{ secrets.SQL_PORT }}" >> $GITHUB_ENV | ||
- name: Ejecutar migraciones | ||
run: | | ||
source venv/bin/activate | ||
python manage.py migrate | ||
- name: Ejecutar servidor de producción | ||
run: | | ||
source venv/bin/activate | ||
gunicorn src.wsgi:application --bind 0.0.0.0:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,102 @@ | ||
# Kiki Backend | ||
# Proyecto Kiki | ||
|
||
Este proyecto es una aplicación web desarrollada con Django y Django REST Framework, diseñada para gestionar usuarios, direcciones, pedidos y más. Incluye funcionalidades como autenticación, gestión de contraseñas, y un panel de administración personalizado. | ||
|
||
## Requisitos | ||
|
||
- Python 3.8+ | ||
- Django 4.1.1 | ||
- PostgreSQL | ||
- Redis (para Channels) | ||
- Node.js (para el servicio de WhatsApp) | ||
|
||
## Instalación | ||
|
||
1. **Clonar el repositorio:** | ||
|
||
```bash | ||
git clone https://github.com/tu_usuario/kiki.git | ||
cd kiki | ||
``` | ||
|
||
2. **Crear y activar un entorno virtual:** | ||
|
||
```bash | ||
python -m venv venv | ||
source venv/bin/activate # En Windows usa `venv\Scripts\activate` | ||
``` | ||
|
||
3. **Instalar las dependencias:** | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
4. **Configurar las variables de entorno:** | ||
|
||
Crea un archivo `.env` en la raíz del proyecto y define las siguientes variables: | ||
|
||
``` | ||
SECRET_KEY=tu_secreto | ||
DEBUG=1 | ||
SQL_DATABASE=kiki | ||
SQL_USER=postgres | ||
SQL_PASSWORD=postgres | ||
SQL_HOST=localhost | ||
SQL_PORT=5432 | ||
``` | ||
|
||
5. **Realizar las migraciones de la base de datos:** | ||
|
||
```bash | ||
python manage.py migrate | ||
``` | ||
|
||
6. **Cargar datos de prueba (opcional):** | ||
|
||
```bash | ||
python populate_db.py | ||
``` | ||
|
||
7. **Ejecutar el servidor de desarrollo:** | ||
|
||
```bash | ||
python manage.py runserver | ||
``` | ||
|
||
## Funcionalidades | ||
|
||
- **Autenticación de Usuarios:** | ||
|
||
- Registro, inicio de sesión y recuperación de contraseñas. | ||
- Activación de cuenta vía enlace de activación. | ||
|
||
- **Gestión de Pedidos:** | ||
|
||
- Creación y seguimiento de pedidos. | ||
- Notificaciones de estado de pedidos vía WhatsApp. | ||
|
||
- **Panel de Administración:** | ||
|
||
- Personalizado con Jazzmin. | ||
- Dashboard con estadísticas de ventas y pedidos. | ||
|
||
- **Internacionalización:** | ||
- Soporte para inglés y español. | ||
|
||
## Estructura del Proyecto | ||
|
||
- `src/`: Contiene la configuración principal de Django. | ||
- `directorio/`: Aplicación para la gestión de usuarios y direcciones. | ||
- `api/`: Aplicación para la gestión de pedidos, productos y configuraciones. | ||
- `templates/`: Plantillas HTML para el frontend. | ||
- `locale/`: Archivos de traducción para internacionalización. | ||
|
||
|
||
## Despliegue | ||
|
||
Este proyecto está configurado para ser desplegado en un VPS usando Docker y GitHub Actions. Asegúrate de configurar correctamente los secretos en GitHub para el despliegue automático. | ||
|
||
## Contribuciones | ||
|
||
Las contribuciones son bienvenidas. Por favor, sigue el flujo de trabajo de GitHub para enviar tus pull requests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.