base template extension
This commit is contained in:
parent
522ffac9a0
commit
9ade5edae8
@ -37,6 +37,8 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'products.apps.ProductsConfig',
|
||||||
|
'accounts.apps.AccountsConfig',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
@ -54,7 +56,7 @@ ROOT_URLCONF = 'producthunt.urls'
|
|||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [os.path.join(BASE_DIR, 'templates')]
|
'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'producthunt/templates')]
|
||||||
,
|
,
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
|
11
producthunt/templates/base.html
Normal file
11
producthunt/templates/base.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
This is the Top
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
This is the Bottom
|
@ -17,7 +17,9 @@ from django.contrib import admin
|
|||||||
from django.urls import include, path
|
from django.urls import include, path
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
|
from products import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
|
path('', views.home, name='home'),
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
4
products/templates/products/home.html
Normal file
4
products/templates/products/home.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block content %}
|
||||||
|
HI
|
||||||
|
{% endblock %}
|
@ -1,3 +1,5 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
|
||||||
# Create your views here.
|
|
||||||
|
def home(request):
|
||||||
|
return render(request, 'products/home.html')
|
||||||
|
Loading…
Reference in New Issue
Block a user