-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject-init-notes
More file actions
30 lines (23 loc) · 1.09 KB
/
project-init-notes
File metadata and controls
30 lines (23 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# crea tu virtualenv fuera del projecto en una carpeta externa
python3 -m project-venv ../venvs/[project]-venv (Comando no testeado)
source ../venvs/[project]-venv/bin/activate
# CREA LAS VARIABLES DE ENTORNO NECESARIAS en el viertualenv/bin/activate
# Compose file evita tener que pasar parámetro de file a docker-compose
# Django settings evita tener que pasar --config a python manage.py
Al final del archivo
export COMPOSE_FILE="local.yml"
export DJANGO_SETTINGS_MODULE="config.settings.local"
Al final de la función deactivate()
unset COMPOSE_FILE
unset DJANGO_SETTINGS_MODULE
#Para postgres se necesita instalar dependencias previas o cambiar por el paquete binario
python -m pip install --upgrade pip
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
python manage.py startapp polls
# Exportar datos a fixture e importar
https://www.coderedcorp.com/blog/how-to-dump-your-django-database-and-load-it-into-/
python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 2 > dump.json
# migrate
loaddata fixtures/dump.json