Compare commits

..

2 Commits

Author SHA1 Message Date
WGAVermeer
26c6f46531 added poll app for testing purposes. Will be removed later.
Some checks failed
Gitea build & Test. / tests (push) Failing after 3s
2026-03-11 08:13:35 +01:00
WGAVermeer
13a317d3df Make Dev enters into the webserver shell.
Fixed database env variables to properly connect.
2026-03-11 08:12:07 +01:00
13 changed files with 45 additions and 6 deletions

4
.gitignore vendored
View File

@@ -175,3 +175,7 @@ cython_debug/
# PyPI configuration file
.pypirc
# gunicon webserver
gunicorn.ctl

View File

@@ -4,7 +4,8 @@ prod:
dev:
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:
docker compose --env-file .env.template -f ./compose.yaml -f ./compose.test.yaml up --build --abort-on-container-exit --exit-code-from web

View File

@@ -10,16 +10,18 @@ services:
PYTHONDONTWRITEBYTECODE: 1
PYTHONUNBUFFERED: 1
DJANGO_SETTINGS_MODULE: ${DJANGO_SETTINGS_MODULE}
env_file: ".env"
restart: unless-stopped
db:
image: postgres:18
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_DB: ${POSTGRES_DBNAME}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql
env_file: ".env"
restart: unless-stopped
adminer:

0
src/polls/__init__.py Normal file
View File

3
src/polls/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
src/polls/apps.py Normal file
View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class PollsConfig(AppConfig):
name = 'polls'

View File

3
src/polls/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
src/polls/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

7
src/polls/urls.py Normal file
View File

@@ -0,0 +1,7 @@
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
]

9
src/polls/views.py Normal file
View File

@@ -0,0 +1,9 @@
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
# Create your views here.

View File

@@ -77,7 +77,7 @@ WSGI_APPLICATION = "website.wsgi.application"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"DBNAME": os.getenv("POSTGRES_DBNAME"),
"NAME": os.getenv("POSTGRES_DBNAME"),
"USER": os.getenv("POSTGRES_USER"),
"PASSWORD": os.getenv("POSTGRES_PASSWORD"),
"HOST": os.getenv("POSTGRES_HOST"),
@@ -110,7 +110,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = "en-us"
TIME_ZONE = "UTC"
TIME_ZONE = "Europe/Amsterdam"
USE_I18N = True

View File

@@ -14,9 +14,11 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path("polls/", include("polls.urls")),
path("admin/", admin.site.urls),
]