base template extension
This commit is contained in:
parent
522ffac9a0
commit
9ade5edae8
@ -37,6 +37,8 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'products.apps.ProductsConfig',
|
||||
'accounts.apps.AccountsConfig',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@ -54,7 +56,7 @@ ROOT_URLCONF = 'producthunt.urls'
|
||||
TEMPLATES = [
|
||||
{
|
||||
'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,
|
||||
'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.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from products import views
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('', views.home, name='home'),
|
||||
] + 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
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def home(request):
|
||||
return render(request, 'products/home.html')
|
||||
|
Loading…
Reference in New Issue
Block a user