fix variables
fix variables
This commit is contained in:
parent
128271411d
commit
86ee2172d3
18
Caddyfile.dev
Normal file
18
Caddyfile.dev
Normal file
@ -0,0 +1,18 @@
|
||||
http://here.project.localhost {
|
||||
|
||||
root * /usr/src/app/
|
||||
encode gzip zstd
|
||||
|
||||
@notStatic {
|
||||
not path /static/* /media/*
|
||||
}
|
||||
|
||||
reverse_proxy @notStatic django:8000
|
||||
|
||||
file_server /static/*
|
||||
file_server /media/*
|
||||
}
|
||||
|
||||
http://webmail.localhost {
|
||||
reverse_proxy mailhog:8025
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
{$DOMAIN_URL}
|
||||
https://here.project
|
||||
|
||||
root * /usr/src/app/
|
||||
|
8
Makefile
8
Makefile
@ -2,11 +2,11 @@
|
||||
help:
|
||||
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
lint: ## Check style with black
|
||||
black --check --exclude="/(postgres|venv|migrations|\.git)/" .
|
||||
|
||||
format: ## Format style with black
|
||||
black --exclude="/(postgres|venv|migrations|\.git)/" .
|
||||
black --exclude="/(postgres_data|venv|migrations|\.git)/" core/ apps/ scripts/ tests/
|
||||
|
||||
test: ## Tests
|
||||
docker-compose -f docker-compose.dev.yaml exec -T django bash -c "pytest"
|
||||
|
||||
docker.recreate.django: ## Recreate Django image
|
||||
docker-compose -f docker-compose.dev.yaml build --no-cache --force-rm django
|
||||
|
24
README.md
24
README.md
@ -8,7 +8,7 @@ make run.server
|
||||
|
||||
Now open:
|
||||
|
||||
`http://template.localhost`
|
||||
`http://here.project.localhost`
|
||||
|
||||
## Gulp
|
||||
|
||||
@ -68,15 +68,15 @@ make run.loaddata.test
|
||||
|
||||
## Other domains
|
||||
|
||||
- Caddy: `http://template.localhost`.
|
||||
- Gulp: `http://template.localhost:3000`.
|
||||
- Django: `http://template.localhost:8000`.
|
||||
- Mailhog: `http://template.localhost:8025`.
|
||||
- Caddy: `http://here.project.localhost`.
|
||||
- Gulp: `http://here.project.localhost:3000`.
|
||||
- Django: `http://here.project.localhost:8000`.
|
||||
- Mailhog: `http://here.project.localhost:8025`.
|
||||
|
||||
### Bash Django
|
||||
|
||||
``` shell
|
||||
docker exec -it template-django bash
|
||||
docker exec -it here.project-django bash
|
||||
```
|
||||
|
||||
# Run production
|
||||
@ -89,14 +89,14 @@ Open `https://template.io`.
|
||||
|
||||
# Enviroment (.env)
|
||||
```text
|
||||
PROJECT_NAME=template
|
||||
PROJECT_NAME=here.project
|
||||
|
||||
# Domain
|
||||
DOMAIN=template.localhost
|
||||
DOMAIN_URL=http://template.localhost
|
||||
DOMAIN=here.project.localhost
|
||||
DOMAIN_URL=http://here.project.localhost
|
||||
|
||||
# Database
|
||||
DB_NAME=template_db
|
||||
DB_NAME=project_db
|
||||
DB_USER=postgres
|
||||
DB_PASSWORD=postgres
|
||||
DB_HOST=postgresql
|
||||
@ -114,8 +114,8 @@ CADDY_PORT_ONE=80
|
||||
CADDY_PORT_TWO=443
|
||||
|
||||
# Email
|
||||
DEFAULT_FROM_EMAIL=no-reply@template.localhost
|
||||
EMAIL_CONTACT=info@template.localhost
|
||||
DEFAULT_FROM_EMAIL=no-reply@here.project.localhost
|
||||
EMAIL_CONTACT=info@here.project.localhost
|
||||
EMAIL_HOST=mailhog
|
||||
EMAIL_USER=
|
||||
EMAIL_PASSWORD=
|
||||
|
@ -26,7 +26,6 @@ services:
|
||||
DEBUG: "False"
|
||||
ALLOWED_HOSTS: ${DOMAIN}
|
||||
SECRET_KEY: ${DJANGO_SECRET_KEY}
|
||||
DB_ENGINE: django.db.backends.postgresql
|
||||
DB_NAME: ${DB_NAME}
|
||||
DB_USER: ${DB_USER}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
@ -60,7 +59,7 @@ services:
|
||||
- ${CADDY_PORT_ONE}:80
|
||||
- ${CADDY_PORT_TWO}:443
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
||||
- ./Caddyfile.dev:/etc/caddy/Caddyfile
|
||||
- ./caddy_data:/data
|
||||
- .:/usr/src/app/
|
||||
depends_on:
|
||||
|
@ -26,7 +26,6 @@ services:
|
||||
DEBUG: "False"
|
||||
ALLOWED_HOSTS: ${DOMAIN}
|
||||
SECRET_KEY: ${DJANGO_SECRET_KEY}
|
||||
DB_ENGINE: django.db.backends.postgresql
|
||||
DB_NAME: ${DB_NAME}
|
||||
DB_USER: ${DB_USER}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
@ -60,7 +59,7 @@ services:
|
||||
- ${CADDY_PORT_ONE}:80
|
||||
- ${CADDY_PORT_TWO}:443
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
||||
- ./Caddyfile.pro:/etc/caddy/Caddyfile
|
||||
- ./caddy_data:/data
|
||||
- .:/usr/src/app/
|
||||
depends_on:
|
||||
|
0
scripts/__ini__.py
Normal file
0
scripts/__ini__.py
Normal file
0
test/__ini__.py
Normal file
0
test/__ini__.py
Normal file
4
test/test_start.py
Normal file
4
test/test_start.py
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
def test_hello_world():
|
||||
assert "hello_world" == "hello_world"
|
||||
assert "foo" != "bar"
|
Loading…
Reference in New Issue
Block a user