Moved base templates to /templates and index.html to /front/templates
This commit is contained in:
parent
fb0a217ef4
commit
0cca1ed501
@ -38,6 +38,8 @@ INSTALLED_APPS = [
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'store',
|
||||
'doc',
|
||||
'front',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@ -55,7 +57,9 @@ ROOT_URLCONF = 'PDMI.urls'
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'DIRS': [
|
||||
os.path.join(BASE_DIR, 'templates')
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
|
@ -15,9 +15,10 @@ Including another URLconf
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
import store
|
||||
import store, front
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('', include('front.urls')),
|
||||
path('store/', include('store.urls'))
|
||||
]
|
||||
|
21
PDMI/front/urls.py
Normal file
21
PDMI/front/urls.py
Normal 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')
|
||||
]
|
@ -18,5 +18,4 @@ import store.views
|
||||
import store
|
||||
|
||||
urlpatterns = [
|
||||
path('index/', store.views.index),
|
||||
]
|
||||
|
@ -1,5 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
def index(request):
|
||||
return render(request, 'index.html')
|
||||
|
Loading…
Reference in New Issue
Block a user