Skip to content

Commit 4f09eab

Browse files
committed
add home page view
1 parent 61d4ad3 commit 4f09eab

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

config/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
TEMPLATES = [
5757
{
5858
'BACKEND': 'django.template.backends.django.DjangoTemplates',
59-
'DIRS': [BASE_DIR / 'templates']
59+
'DIRS': []
6060
,
6161
'APP_DIRS': True,
6262
'OPTIONS': {

config/config/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1616
"""
1717
from django.contrib import admin
18-
from django.urls import path
18+
from django.urls import path, include
1919

2020
urlpatterns = [
2121
path('admin/', admin.site.urls),
22+
path('', include('core.urls')),
2223
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>shahriaarrr blog</title>
6+
</head>
7+
<body>
8+
{% block content %}
9+
{% endblock %}
10+
</body>
11+
</html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% extends 'core/base.html' %}
2+
3+
{% block content %}
4+
<h1>Welcome to home page</h1>
5+
{% endblock %}

config/core/urls.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.urls import path
2+
from .views import *
3+
4+
urlpatterns = [
5+
path('', corepage, name="corepage"),
6+
]

config/core/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
from django.shortcuts import render
22

33
# Create your views here.
4+
5+
def corepage(request):
6+
return render(request, 'core/home.html')

0 commit comments

Comments
 (0)