f07b4d01b9
update template to add test and other functions See merge request ccsolutions.io/open-source/templates/django!1 |
||
---|---|---|
apps/website | ||
core | ||
Dockerfiles | ||
scripts | ||
tests | ||
.gitignore | ||
asgi.py | ||
Caddyfile.dev | ||
Caddyfile.pro | ||
django-launcher.sh | ||
docker-compose.dev.yaml | ||
docker-compose.pro.yaml | ||
gulpfile.js | ||
make-a-backup.sh | ||
Makefile | ||
manage.py | ||
package.json | ||
pytest.ini | ||
README.md | ||
requirements.txt |
Install
make docker.recreate.django
make run.loaddata
make run.server
Now open:
http://project.localhost
Gulp
npm i
Run.
gulp dev
Tools
Lint
make lint
Formatear
make format
Recrear imagen de Django
make docker.recreate.django
Hacer una nueva migración después de cambiar un model.
make makemigrations
Migrar
make run.migrate
Cargar data mínima.
make run.loaddata
Generar data de desarrollo.
make run.loaddata.test
Other domains
- Caddy:
http://project.localhost
. - Gulp:
http://project.localhost:3000
. - Django:
http://project.localhost:8000
. - Mailhog:
http://project.localhost:8025
.
Bash Django
docker exec -it project-django bash
Run production
docker-compose -f docker-compose.pro.yaml up
Open https://proyect.com
.
Enviroment (.env)
PROJECT_NAME=project
# Domain
DOMAIN=project.localhost
DOMAIN_URL=http://project.localhost
# Database
DB_NAME=project_db
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=postgresql
DB_PORT=5432
# Django options
DJANGO_SECRET_KEY=mysecret
# Redis
REDIS_HOST=redis
REDIS_PORT=6379
# Caddy
CADDY_PORT_ONE=80
CADDY_PORT_TWO=443
# Email
DEFAULT_FROM_EMAIL=no-reply@project.localhost
EMAIL_CONTACT=info@project.localhost
EMAIL_HOST=mailhog
EMAIL_USER=
EMAIL_PASSWORD=
EMAIL_PORT=1025
EMAIL_USE_TLS=False
EMAIL_USE_SSL=False