base templated imported and extended

This commit is contained in:
Yogesh Ojha
2020-05-04 19:24:33 +05:30
parent aaf9c24b50
commit 3ff87d34dc
13 changed files with 32 additions and 17 deletions
View File
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+5
View File
@@ -0,0 +1,5 @@
from django.apps import AppConfig
class DashboardConfig(AppConfig):
name = 'dashboard'
View File
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+1
View File
@@ -0,0 +1 @@
{% extends "base/base.html" %}
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+8
View File
@@ -0,0 +1,8 @@
from django.contrib import admin
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index, name='index')
]
+5
View File
@@ -0,0 +1,5 @@
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return render(request, 'dashboard/index.html')
+2 -1
View File
@@ -25,6 +25,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'dashboard.apps.DashboardConfig'
]
MIDDLEWARE = [
@@ -42,7 +43,7 @@ ROOT_URLCONF = 'reNgine.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [(os.path.join(BASE_DIR, 'templates'))],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
+2 -16
View File
@@ -1,21 +1,7 @@
"""reNgine URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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.contrib import admin
from django.urls import path
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('dashboard.urls'))
]
BIN
View File
Binary file not shown.