diff --git a/.DS_Store b/.DS_Store index 76cec49f019600be6e3acde70d2b0c3b400d1f61..d5ff4347031636a08a5ed987e6f02852fcb7c427 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/django_project/.DS_Store b/django_project/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8f75b30d49248a3fc05311d6242860ea788fb458 Binary files /dev/null and b/django_project/.DS_Store differ diff --git a/django_project/django_project/settings.py b/django_project/django_project/settings.py index 879902b0396a17d6b6ab1606e132d28163b4d187..a189ffa6f201b4d076bfadf80817b19c329ad1c6 100644 --- a/django_project/django_project/settings.py +++ b/django_project/django_project/settings.py @@ -15,6 +15,8 @@ import os # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +DATABASE_URL = os.environ.get('DATABASE_URL', 'postgres://postgres:postgres@localhost:5432/postgres') + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ @@ -37,6 +39,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'myapp', ] MIDDLEWARE = [ @@ -54,7 +57,7 @@ ROOT_URLCONF = 'django_project.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [BASE_DIR / "templates"], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/django_project/django_project/urls.py b/django_project/django_project/urls.py index d5a8a81fe3fb8cfdbc604aced474d8152b0cd790..55db62141d94114859a66bccdf1978cfc847cd63 100644 --- a/django_project/django_project/urls.py +++ b/django_project/django_project/urls.py @@ -15,8 +15,14 @@ Including another URLconf 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 +from myapp import views urlpatterns = [ path('admin/', admin.site.urls), + path('register/', views.register_view, name='register'), + path('login/', views.login_view, name='login'), + path('account/', views.account_view, name='account'), + path('delete/', views.delete_account_view, name='delete_account'), + path('logout/', views.logout_view, name='logout'), ] diff --git a/django_project/myapp/.DS_Store b/django_project/myapp/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..98099036d71ed48c5219617645a892d80e5a4bae Binary files /dev/null and b/django_project/myapp/.DS_Store differ diff --git a/django_project/myapp/templates/.DS_Store b/django_project/myapp/templates/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7317f6a08bd202ee3b06dc56e0f1e8ceabe053da Binary files /dev/null and b/django_project/myapp/templates/.DS_Store differ diff --git a/django_project/myapp/account.html b/django_project/myapp/templates/myapp/account.html similarity index 100% rename from django_project/myapp/account.html rename to django_project/myapp/templates/myapp/account.html diff --git a/django_project/myapp/delete_account.html b/django_project/myapp/templates/myapp/delete_account.html similarity index 100% rename from django_project/myapp/delete_account.html rename to django_project/myapp/templates/myapp/delete_account.html diff --git a/django_project/myapp/login.html b/django_project/myapp/templates/myapp/login.html similarity index 100% rename from django_project/myapp/login.html rename to django_project/myapp/templates/myapp/login.html diff --git a/django_project/myapp/logout.html b/django_project/myapp/templates/myapp/logout.html similarity index 100% rename from django_project/myapp/logout.html rename to django_project/myapp/templates/myapp/logout.html diff --git a/django_project/myapp/register.html b/django_project/myapp/templates/myapp/register.html similarity index 100% rename from django_project/myapp/register.html rename to django_project/myapp/templates/myapp/register.html diff --git a/django_project/myapp/views.py b/django_project/myapp/views.py index 9981e44c79e401f98dcbfac99b3f548b2ffd37b6..a29ed483cbf6e86f6e5fa8af5bd3cc1706c107f5 100644 --- a/django_project/myapp/views.py +++ b/django_project/myapp/views.py @@ -4,6 +4,8 @@ from django.conf import settings import os import rust_crud_api # This is the module we built +db_url = settings.DATABASE_URL + def init_db_view(request): db_url = os.environ.get("DATABASE_URL") try: