Moved base templates to /templates and index.html to /front/templates

This commit is contained in:
HugoNeveux 2020-04-21 12:18:56 +02:00
parent fb0a217ef4
commit 0cca1ed501
8 changed files with 28 additions and 5 deletions

View File

@ -38,6 +38,8 @@ INSTALLED_APPS = [
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'store', 'store',
'doc',
'front',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -55,7 +57,9 @@ ROOT_URLCONF = 'PDMI.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [], 'DIRS': [
os.path.join(BASE_DIR, 'templates')
],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [

View File

@ -15,9 +15,10 @@ Including another URLconf
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path, include from django.urls import path, include
import store import store, front
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('', include('front.urls')),
path('store/', include('store.urls')) path('store/', include('store.urls'))
] ]

21
PDMI/front/urls.py Normal file
View File

@ -0,0 +1,21 @@
"""PDMI URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
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.urls import path, include
from django.views.generic import TemplateView
urlpatterns = [
path('', TemplateView.as_view(template_name="index.html"), name='index')
]

View File

@ -18,5 +18,4 @@ import store.views
import store import store
urlpatterns = [ urlpatterns = [
path('index/', store.views.index),
] ]

View File

@ -1,5 +1,3 @@
from django.shortcuts import render from django.shortcuts import render
# Create your views here. # Create your views here.
def index(request):
return render(request, 'index.html')