From 875c2c63d5c3310192fbcc30d9c661da0f01d817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9DNyymix=E2=80=9D?= Date: Sun, 2 Feb 2025 20:27:04 +0200 Subject: [PATCH] Add contact app --- config/settings.py | 1 + config/urls.py | 1 + contact/__init__.py | 0 contact/admin.py | 3 +++ contact/apps.py | 6 ++++++ contact/migrations/__init__.py | 0 contact/models.py | 3 +++ contact/templates/contact/main.html | 9 +++++++++ contact/tests.py | 3 +++ contact/urls.py | 9 +++++++++ contact/views.py | 6 ++++++ templates/base_dark.html | 4 ++-- 12 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 contact/__init__.py create mode 100644 contact/admin.py create mode 100644 contact/apps.py create mode 100644 contact/migrations/__init__.py create mode 100644 contact/models.py create mode 100644 contact/templates/contact/main.html create mode 100644 contact/tests.py create mode 100644 contact/urls.py create mode 100644 contact/views.py diff --git a/config/settings.py b/config/settings.py index c1634d3..f38b528 100644 --- a/config/settings.py +++ b/config/settings.py @@ -38,6 +38,7 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', 'imagekit', + 'contact', 'gallery' ] diff --git a/config/urls.py b/config/urls.py index daa6e4d..099caeb 100644 --- a/config/urls.py +++ b/config/urls.py @@ -5,6 +5,7 @@ from django.urls import include, path urlpatterns = [ path('admin/', admin.site.urls), + path('contact/', include(('contact.urls', 'contact'), namespace='contact')), path('', include(('gallery.urls', 'gallery'), namespace='gallery')), ] diff --git a/contact/__init__.py b/contact/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/contact/admin.py b/contact/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/contact/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/contact/apps.py b/contact/apps.py new file mode 100644 index 0000000..002d6c2 --- /dev/null +++ b/contact/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ContactConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'contact' diff --git a/contact/migrations/__init__.py b/contact/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/contact/models.py b/contact/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/contact/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/contact/templates/contact/main.html b/contact/templates/contact/main.html new file mode 100644 index 0000000..c8e9603 --- /dev/null +++ b/contact/templates/contact/main.html @@ -0,0 +1,9 @@ +{% extends "base_dark.html" %} + + +{% block title %} Gallery : Contact {% endblock %} + + +{% block content %} + Contact me! +{% endblock %} \ No newline at end of file diff --git a/contact/tests.py b/contact/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/contact/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/contact/urls.py b/contact/urls.py new file mode 100644 index 0000000..cb535ad --- /dev/null +++ b/contact/urls.py @@ -0,0 +1,9 @@ +from django.urls import path + +from . import views + +app_name = 'contact' + +urlpatterns = [ + path('', views.Main.as_view(), name='main_url'), +] diff --git a/contact/views.py b/contact/views.py new file mode 100644 index 0000000..4f0ac6f --- /dev/null +++ b/contact/views.py @@ -0,0 +1,6 @@ +from django.shortcuts import render +from django.views.generic import TemplateView + + +class Main(TemplateView): + template_name = "contact/main.html" diff --git a/templates/base_dark.html b/templates/base_dark.html index 1e72e9c..b9809d2 100644 --- a/templates/base_dark.html +++ b/templates/base_dark.html @@ -37,7 +37,7 @@