add stub dashboard page
This commit is contained in:
0
dashboard/__init__.py
Normal file
0
dashboard/__init__.py
Normal file
20
dashboard/urls.py
Normal file
20
dashboard/urls.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
"""dashboard URL Configuration
|
||||||
|
|
||||||
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
|
https://docs.djangoproject.com/en/2.1/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
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('', views.index, name='dashboard'),
|
||||||
|
]
|
||||||
51
dashboard/views.py
Normal file
51
dashboard/views.py
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# from datetime import datetime
|
||||||
|
# from dateutil import tz
|
||||||
|
# from dateutil.parser import parse
|
||||||
|
# import feedparser
|
||||||
|
# import json
|
||||||
|
# import grequests
|
||||||
|
# import time
|
||||||
|
|
||||||
|
# from django.conf import settings
|
||||||
|
# from django.core.urlresolvers import reverse
|
||||||
|
# from django.http import HttpResponse, JsonResponse, Http404
|
||||||
|
# from django.shortcuts import render
|
||||||
|
# from django.views.generic import View, TemplateView
|
||||||
|
# from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||||
|
# from django.utils.html import strip_tags
|
||||||
|
|
||||||
|
# from meta.views import Meta
|
||||||
|
|
||||||
|
from django.shortcuts import render, get_object_or_404
|
||||||
|
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse
|
||||||
|
from django.urls import reverse
|
||||||
|
#from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||||
|
#from django.core.mail import EmailMultiAlternatives
|
||||||
|
#from django.template.loader import get_template
|
||||||
|
#from django.utils import timezone
|
||||||
|
#from datetime import date
|
||||||
|
#import datetime as DT
|
||||||
|
#from django.db.models import Q
|
||||||
|
|
||||||
|
#from .forms import SourceForm, DestinationForm, PostForm, MoverForm, ClaimForm, SourceLoginForm, MoverLoginForm, CustomFormDestination
|
||||||
|
#from .models import Source, Destination, Post, Mover, Claim
|
||||||
|
|
||||||
|
def dashboard(request):
|
||||||
|
return render(request, 'dashboard/index.html', {})
|
||||||
|
|
||||||
|
def unused(request):
|
||||||
|
return HttpResponse("Hello, world.")
|
||||||
|
|
||||||
|
# def sources(request):
|
||||||
|
# sources = Source.objects.all()
|
||||||
|
# paginator = Paginator(sources, 10)
|
||||||
|
# page = request.GET.get('page')
|
||||||
|
|
||||||
|
# try:
|
||||||
|
# source_list = paginator.page(page)
|
||||||
|
# except PageNotAnInteger:
|
||||||
|
# source_list = paginator.page(1)
|
||||||
|
# except EmptyPage:
|
||||||
|
# source_list = paginator.page(paginator.num_pages)
|
||||||
|
|
||||||
|
# return render(request, 'source/index.html', {'sources': source_list,})
|
||||||
@ -35,6 +35,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'dashboard',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
@ -52,8 +53,9 @@ ROOT_URLCONF = 'procat2.urls'
|
|||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [],
|
'DIRS': ['templates'],
|
||||||
'APP_DIRS': True,
|
#'APP_DIRS': True,
|
||||||
|
#'DIRS': [os.path.join(BASE_DIR, 'templates')],
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
'context_processors': [
|
'context_processors': [
|
||||||
'django.template.context_processors.debug',
|
'django.template.context_processors.debug',
|
||||||
|
|||||||
@ -16,7 +16,11 @@ Including another URLconf
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import include, path
|
from django.urls import include, path
|
||||||
|
|
||||||
|
from dashboard.views import dashboard
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path('', dashboard, name='root'),
|
||||||
|
path('dashboard', dashboard, name='dashboard'),
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('accounts/', include('django.contrib.auth.urls')),
|
path('accounts/', include('django.contrib.auth.urls')),
|
||||||
]
|
]
|
||||||
|
|||||||
7
templates/dashboard/index.html
Normal file
7
templates/dashboard/index.html
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Dashboard{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h2>Dashboard</h2>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user