Преглед изворни кода

added templates and basic views for home, contact, about and faq

Apostol Mihai пре 2 година
родитељ
комит
a0156c7d93

+ 2 - 0
NFTmarket/NFTmarket/settings.py

@@ -37,6 +37,8 @@ INSTALLED_APPS = [
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+
+    'info_pages',
 ]
 
 MIDDLEWARE = [

+ 4 - 1
NFTmarket/NFTmarket/urls.py

@@ -14,8 +14,11 @@ 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 include, path
+from info_pages.urls import infopages_urlpatterns
+
 
 urlpatterns = [
     path('admin/', admin.site.urls),
+    path(r'', include(infopages_urlpatterns)),
 ]

+ 0 - 0
NFTmarket/info_pages/__init__.py


+ 3 - 0
NFTmarket/info_pages/admin.py

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

+ 6 - 0
NFTmarket/info_pages/apps.py

@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class InfoPagesConfig(AppConfig):
+    default_auto_field = 'django.db.models.BigAutoField'
+    name = 'info_pages'

+ 0 - 0
NFTmarket/info_pages/migrations/__init__.py


+ 3 - 0
NFTmarket/info_pages/models.py

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

+ 3 - 0
NFTmarket/info_pages/tests.py

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

+ 14 - 0
NFTmarket/info_pages/urls.py

@@ -0,0 +1,14 @@
+from django.urls import path
+from info_pages.views import (
+    home_view, 
+    about_view, 
+    contact_view, 
+    faq_view
+)
+
+infopages_urlpatterns = [
+    path('', home_view, name='homepage'),
+    path('about', about_view, name='aboutpage'),
+    path('contact', contact_view, name='contactpage'),
+    path('faq', faq_view, name='faqpage'),
+]

+ 16 - 0
NFTmarket/info_pages/views.py

@@ -0,0 +1,16 @@
+from django.shortcuts import render
+
+# Create your views here.
+
+
+def home_view(request):
+    return render(request, "dashboard/home.html")
+
+def about_view(request):
+    return render(request, "dashboard/about.html")
+
+def contact_view(request):
+    return render(request, "dashboard/contact.html")
+
+def faq_view(request):
+    return render(request, "dashboard/faq.html")

+ 32 - 0
NFTmarket/templates/base.html

@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+
+<html lang="en">
+
+<head>
+    <title>NFT market</title>
+
+
+    {% load static %}
+    <link rel="shortcut icon" type="image/png" href="{% static 'favicon.ico' %}"/>
+    <script>
+
+
+    </script>
+</head>
+
+
+
+<body>
+  <div id="content">
+      <h1>NFT market</h1>
+
+      <div class="mainblockcontent">
+          {% block content %}
+          {% endblock %}
+      </div>
+  </div>
+  
+</body>
+
+</html>
+

+ 8 - 0
NFTmarket/templates/dashboard/about.html

@@ -0,0 +1,8 @@
+{% extends 'base.html' %}
+{% load static %}
+
+{% block content %}
+
+<h2>About</h2>
+
+{% endblock content %}

+ 8 - 0
NFTmarket/templates/dashboard/contact.html

@@ -0,0 +1,8 @@
+{% extends 'base.html' %}
+{% load static %}
+
+{% block content %}
+
+<h2>Contact</h2>
+
+{% endblock content %}

+ 8 - 0
NFTmarket/templates/dashboard/faq.html

@@ -0,0 +1,8 @@
+{% extends 'base.html' %}
+{% load static %}
+
+{% block content %}
+
+<h2>Frequently asked questions</h2>
+
+{% endblock content %}

+ 8 - 0
NFTmarket/templates/dashboard/home.html

@@ -0,0 +1,8 @@
+{% extends 'base.html' %}
+{% load static %}
+
+{% block content %}
+
+<h2>Home Page, welcome</h2>
+
+{% endblock content %}