Add contact app
This commit is contained in:
parent
467f2396ca
commit
875c2c63d5
12 changed files with 43 additions and 2 deletions
|
@ -38,6 +38,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'imagekit',
|
||||
'contact',
|
||||
'gallery'
|
||||
]
|
||||
|
||||
|
|
|
@ -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')),
|
||||
]
|
||||
|
||||
|
|
0
contact/__init__.py
Normal file
0
contact/__init__.py
Normal file
3
contact/admin.py
Normal file
3
contact/admin.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
6
contact/apps.py
Normal file
6
contact/apps.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ContactConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'contact'
|
0
contact/migrations/__init__.py
Normal file
0
contact/migrations/__init__.py
Normal file
3
contact/models.py
Normal file
3
contact/models.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
9
contact/templates/contact/main.html
Normal file
9
contact/templates/contact/main.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% extends "base_dark.html" %}
|
||||
|
||||
<!-- Title -->
|
||||
{% block title %} Gallery : Contact {% endblock %}
|
||||
|
||||
<!-- Content -->
|
||||
{% block content %}
|
||||
Contact me!
|
||||
{% endblock %}
|
3
contact/tests.py
Normal file
3
contact/tests.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
9
contact/urls.py
Normal file
9
contact/urls.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = 'contact'
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.Main.as_view(), name='main_url'),
|
||||
]
|
6
contact/views.py
Normal file
6
contact/views.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django.shortcuts import render
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
|
||||
class Main(TemplateView):
|
||||
template_name = "contact/main.html"
|
|
@ -37,7 +37,7 @@
|
|||
</div>
|
||||
<div class="uk-navbar-right uk-margin-right">
|
||||
<ul class="uk-navbar-nav">
|
||||
<li class="uk-visible@m"><a href="#">Contact</a></li>
|
||||
<li class="uk-visible@m"><a href="{% url 'contact:main_url' %}">Contact</a></li>
|
||||
{% if user.is_authenticated %}
|
||||
<li class="uk-visible@m"><a href="{% url 'admin:index' %}">Admin</a></li>
|
||||
{% endif %}
|
||||
|
@ -55,7 +55,7 @@
|
|||
<li><a href="{% url 'gallery:main_url' %}">Home</a></li>
|
||||
<li><a href="{% url 'gallery:albums_url' %}">Albums</a></li>
|
||||
<li><a href="{% url 'gallery:photos_url' %}">Photostream</a></li>
|
||||
<li><a href="#">Contact</a></li>
|
||||
<li><a href="{% url 'contact:main_url' %}">Contact</a></li>
|
||||
{% if user.is_authenticated %}
|
||||
<li><a href="{% url 'admin:index' %}">Admin</a></li>
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Reference in a new issue