Make Dev enters into the webserver shell.
Fixed database env variables to properly connect.
This commit is contained in:
3
Makefile
3
Makefile
@@ -4,7 +4,8 @@ prod:
|
|||||||
|
|
||||||
dev:
|
dev:
|
||||||
docker compose down
|
docker compose down
|
||||||
docker compose -f ./compose.yaml -f ./compose.dev.yaml up --build
|
docker compose -f ./compose.yaml -f ./compose.dev.yaml up --build -d
|
||||||
|
docker exec -it quatsh-website-web-1 sh
|
||||||
|
|
||||||
test:
|
test:
|
||||||
docker compose --env-file .env.template -f ./compose.yaml -f ./compose.test.yaml up --build --abort-on-container-exit --exit-code-from web
|
docker compose --env-file .env.template -f ./compose.yaml -f ./compose.test.yaml up --build --abort-on-container-exit --exit-code-from web
|
||||||
|
|||||||
@@ -10,16 +10,18 @@ services:
|
|||||||
PYTHONDONTWRITEBYTECODE: 1
|
PYTHONDONTWRITEBYTECODE: 1
|
||||||
PYTHONUNBUFFERED: 1
|
PYTHONUNBUFFERED: 1
|
||||||
DJANGO_SETTINGS_MODULE: ${DJANGO_SETTINGS_MODULE}
|
DJANGO_SETTINGS_MODULE: ${DJANGO_SETTINGS_MODULE}
|
||||||
|
env_file: ".env"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:18
|
image: postgres:18
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: ${POSTGRES_DB}
|
POSTGRES_DB: ${POSTGRES_DBNAME}
|
||||||
POSTGRES_USER: ${POSTGRES_USER}
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql
|
- postgres_data:/var/lib/postgresql
|
||||||
|
env_file: ".env"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
adminer:
|
adminer:
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ WSGI_APPLICATION = "website.wsgi.application"
|
|||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
"ENGINE": "django.db.backends.postgresql",
|
"ENGINE": "django.db.backends.postgresql",
|
||||||
"DBNAME": os.getenv("POSTGRES_DBNAME"),
|
"NAME": os.getenv("POSTGRES_DBNAME"),
|
||||||
"USER": os.getenv("POSTGRES_USER"),
|
"USER": os.getenv("POSTGRES_USER"),
|
||||||
"PASSWORD": os.getenv("POSTGRES_PASSWORD"),
|
"PASSWORD": os.getenv("POSTGRES_PASSWORD"),
|
||||||
"HOST": os.getenv("POSTGRES_HOST"),
|
"HOST": os.getenv("POSTGRES_HOST"),
|
||||||
@@ -110,7 +110,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
LANGUAGE_CODE = "en-us"
|
LANGUAGE_CODE = "en-us"
|
||||||
|
|
||||||
TIME_ZONE = "UTC"
|
TIME_ZONE = "Europe/Amsterdam"
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,11 @@ Including another URLconf
|
|||||||
1. Import the include() function: from django.urls import include, path
|
1. Import the include() function: from django.urls import include, path
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path
|
from django.urls import path, include
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path("polls/", include("polls.urls")),
|
||||||
|
path("admin/", admin.site.urls),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user