# CSS files, Javascripts files
82 | | |
83 | | |-- templates/ # Templates used to render pages
84 | | |
85 | | |-- includes/ # HTML chunks and components
86 | | | |-- navigation.html # Top menu component
87 | | | |-- sidebar.html # Sidebar component
88 | | | |-- footer.html # App Footer
89 | | | |-- scripts.html # Scripts common to all pages
90 | | |
91 | | |-- layouts/ # Master pages
92 | | | |-- base-fullscreen.html # Used by Authentication pages
93 | | | |-- base.html # Used by common pages
94 | | |
95 | | |-- accounts/ # Authentication pages
96 | | | |-- login.html # Login page
97 | | | |-- register.html # Register page
98 | | |
99 | | index.html # The default page
100 | | page-404.html # Error 404 page
101 | | page-500.html # Error 404 page
102 | | *.html # All other HTML pages
103 | |
104 | |-- authentication/ # Handles auth routes (login and register)
105 | | |
106 | | |-- urls.py # Define authentication routes
107 | | |-- views.py # Handles login and registration
108 | | |-- forms.py # Define auth forms
109 | |
110 | |-- app/ # A simple app that serve HTML files
111 | | |
112 | | |-- views.py # Serve HTML pages for authenticated users
113 | | |-- urls.py # Define some super simple routes
114 | |
115 | |-- requirements.txt # Development modules - SQLite storage
116 | |
117 | |-- .env # Inject Configuration via Environment
118 | |-- manage.py # Start the app - Django default start script
119 | |
120 | |-- ************************************************************************
121 | ```
122 |
123 |
124 |
125 | ## Deployment
126 |
127 | The app is provided with a basic configuration to be executed in [Docker](https://www.docker.com/), [Gunicorn](https://gunicorn.org/), and [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/).
128 |
129 | ### [Docker](https://www.docker.com/) execution
130 | ---
131 |
132 | The application can be easily executed in a docker container. The steps:
133 |
134 | > Get the code
135 |
136 | ```bash
137 | $ git clone https://github.com/app-generator/django-simple-charts.git
138 | $ cd django-simple-charts
139 | ```
140 |
141 | > Start the app in Docker
142 |
143 | ```bash
144 | $ sudo docker-compose pull && sudo docker-compose build && sudo docker-compose up -d
145 | ```
146 |
147 | Visit `http://localhost:5005` in your browser. The app should be up & running.
148 |
149 |
150 |
151 | ### [Gunicorn](https://gunicorn.org/)
152 | ---
153 |
154 | Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX.
155 |
156 | > Install using pip
157 |
158 | ```bash
159 | $ pip install gunicorn
160 | ```
161 | > Start the app using gunicorn binary
162 |
163 | ```bash
164 | $ gunicorn --bind=0.0.0.0:8001 core.wsgi:application
165 | Serving on http://localhost:8001
166 | ```
167 |
168 | Visit `http://localhost:8001` in your browser. The app should be up & running.
169 |
170 |
171 |
172 | ## Credits & Links
173 |
174 | - [Django](https://www.djangoproject.com/) - The official website
175 | - [Boilerplate Code](https://appseed.us/boilerplate-code) - Index provided by **AppSeed**
176 | - [Boilerplate Code](https://github.com/app-generator/boilerplate-code) - Index published on Github
177 |
178 |
179 |
180 | ---
181 | [Django Simple Charts](https://django-simple-charts.appseed.us/) - Provided by **AppSeed** [Web App Generator](https://appseed.us/app-generator).
182 |
--------------------------------------------------------------------------------
/app/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
--------------------------------------------------------------------------------
/app/admin.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.contrib import admin
7 | from import_export import resources
8 | from import_export.admin import ImportMixin
9 |
10 | from app.models import Sale
11 | from app.models import Stats
12 |
13 | class SaleResource(resources.ModelResource):
14 | class Meta:
15 | model = Sale
16 | fields = ['id', 'amount', 'product_name', 'created_time']
17 |
18 |
19 | @admin.register(Sale)
20 | class SaleAdmin(ImportMixin, admin.ModelAdmin):
21 | list_display = ['product_name', 'amount', 'created_time']
22 | search_fields = ['product_name']
23 | resource_class = SaleResource
24 |
25 | class StatsResource(resources.ModelResource):
26 | class Meta:
27 | model = Stats
28 | fields = ['year', 'prod1_sales', 'prod2_sales', 'prod3_sales']
29 |
30 | @admin.register(Stats)
31 | class StatsAdmin(ImportMixin, admin.ModelAdmin):
32 | list_display = ['year', 'prod1_sales', 'prod2_sales', 'prod3_sales']
33 | search_fields = ['year']
34 | resource_class = StatsResource
35 |
--------------------------------------------------------------------------------
/app/config.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.apps import AppConfig
7 |
8 | class MyConfig(AppConfig):
9 | name = 'cfg'
10 |
--------------------------------------------------------------------------------
/app/migrations/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
--------------------------------------------------------------------------------
/app/models.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.contrib.auth.models import User
7 | from django.db import models
8 | from django.db.models import Sum
9 | from django.utils.translation import gettext as _
10 | from django.db.models.functions import TruncYear
11 |
12 |
13 | class Sale(models.Model):
14 | amount = models.FloatField(_('amount'), db_index=True)
15 | product_name = models.CharField(_('product name'), max_length=40, db_index=True)
16 | created_time = models.DateTimeField(verbose_name=_('creation On'), db_index=True)
17 | updated_time = models.DateTimeField(verbose_name=_('modified On'), auto_now=True)
18 |
19 | class Meta:
20 | verbose_name = _('sale')
21 | verbose_name_plural = _('sales')
22 |
23 | @classmethod
24 | def get_sales_report(cls):
25 | annotates = {'total_amount': Sum('amount')}
26 |
27 | sales = cls.objects.annotate(
28 | year=TruncYear('created_time')
29 | ).values('product_name', 'year').order_by().annotate(**annotates)
30 |
31 | data = {}
32 | for sale in sales:
33 |
34 | if sale['year'].year not in data:
35 | data[sale['year'].year] = {}
36 |
37 | data[sale['year'].year][sale['product_name']] = sale['total_amount']
38 |
39 | labels = list(sales.values_list('product_name', flat=True).distinct())
40 | return data, labels
41 |
42 | class Stats(models.Model):
43 |
44 | year = models.IntegerField(_('year') , db_index=True)
45 | prod1_sales = models.IntegerField(_('product 1 sales'), db_index=True)
46 | prod2_sales = models.IntegerField(_('product 2 sales'), db_index=True)
47 | prod3_sales = models.IntegerField(_('product 3 sales'), db_index=True)
48 |
49 | class Meta:
50 | verbose_name = _('statistic')
51 | verbose_name_plural = _('stats')
52 |
53 | @classmethod
54 | def get_report(cls):
55 |
56 | data = {}
57 | labels = ['prod1_sales', 'prod2_sales', 'prod3_sales']
58 |
59 | stats = Stats.objects.order_by('year').values()
60 |
61 | for line in stats:
62 |
63 | if line['year'] not in data:
64 | data[line['year']] = {}
65 |
66 | data[ line['year'] ]['prod1_sales'] = line['prod1_sales']
67 | data[ line['year'] ]['prod2_sales'] = line['prod2_sales']
68 | data[ line['year'] ]['prod3_sales'] = line['prod3_sales']
69 |
70 | return data, labels
71 |
--------------------------------------------------------------------------------
/app/static/app_assets/js/scripts.js:
--------------------------------------------------------------------------------
1 | function SetChartBar(chart_data) {
2 | // todo: this can be modify and make it more flexible
3 | Morris.Bar(chart_data);
4 | }
--------------------------------------------------------------------------------
/app/tests.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.test import TestCase
7 |
8 | # Create your tests here.
9 |
--------------------------------------------------------------------------------
/app/urls.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.urls import path, re_path
7 | from app import views
8 |
9 | urlpatterns = [
10 |
11 | # Charts Views Routing
12 |
13 | # Charts from file
14 | path('charts-file' , views.charts_file , name='charts-file' ),
15 | path('charts-input' , views.charts_input, name='charts-input' ),
16 | path('charts-load' , views.charts_load, name='charts-load' ),
17 |
18 | # The home page
19 | path('', views.index, name='home'),
20 |
21 | # Matches any html file
22 | re_path(r'^.*\.*', views.pages, name='pages'),
23 |
24 | ]
25 |
--------------------------------------------------------------------------------
/app/views.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 | import json
6 |
7 | from django import template
8 | from django.contrib.auth.decorators import login_required
9 | from django.http import HttpResponse
10 | from django.template import loader
11 |
12 | from app.models import Sale, Stats
13 |
14 | def index(request):
15 | context = {'segment': 'index'}
16 | html_template = loader.get_template('index.html')
17 |
18 | # -----------------------------------------------
19 | # Extract data from Sale tables
20 | # -----------------------------------------------
21 |
22 | # sales, labels = Sale.get_sales_report()
23 | # data = [
24 | # {
25 | # 'y': year,
26 | # 'a': '{:.2f}'.format(sales[year].get('A')),
27 | # 'b': '{:.2f}'.format(sales[year].get('B')),
28 | # 'c': '{:.2f}'.format(sales[year].get('C'))
29 | # } for year in sales
30 | # ]
31 |
32 | # -----------------------------------------------
33 | # Use data from stats
34 | # -----------------------------------------------
35 |
36 | # stats, labels = Stats.get_report()
37 | # data = [
38 | # {
39 | # 'y': year,
40 | # 'a': '{:.2f}'.format( stats[year].get('prod1_sales') ), # 'a': '{:.2f}'.format( 30 ),
41 | # 'b': '{:.2f}'.format( stats[year].get('prod2_sales') ), # 'b': '{:.2f}'.format( 180 ),
42 | # 'c': '{:.2f}'.format( stats[year].get('prod3_sales') ) # 'c': '{:.2f}'.format( 80 )
43 | # } for year in stats
44 | # ]
45 |
46 | # context['chart_data'] = json.dumps({
47 | # 'element': 'morris-bar-chart',
48 | # 'data': data,
49 | # 'xkey': 'y',
50 | # 'barSizeRatio': 0.70,
51 | # 'barGap': 3,
52 | # 'resize': True,
53 | # 'responsive': True,
54 | # 'ykeys': ['a', 'b', 'c'], # it can be custom
55 | # 'labels': labels,
56 | # 'barColors': ['0-#1de9b6-#1dc4e9', '0-#899FD4-#A389D4', '#04a9f5'] # it can be custom
57 | # })
58 |
59 | # ------------------------------------------------
60 | # Load from File -> +sample_data/chart_morris.json
61 | # ------------------------------------------------
62 |
63 | with open('sample_data/chart_morris.json', 'r') as f:
64 | context['chart_data'] = json.dumps(json.load(f))
65 |
66 | return HttpResponse(html_template.render(context, request))
67 |
68 | def charts_file(request):
69 | context = {'segment': 'charts_from_file'}
70 | html_template = loader.get_template('charts-from-file.html')
71 |
72 | with open('sample_data/chart_morris.json', 'r') as f:
73 | context['chart_data'] = json.dumps(json.load(f))
74 |
75 | return HttpResponse(html_template.render(context, request))
76 |
77 | def charts_input(request):
78 | context = {'segment': 'charts_from_input'}
79 | html_template = loader.get_template('charts-from-input.html')
80 |
81 | # -----------------------------------------------
82 | # Use data from STATS Table
83 | # -----------------------------------------------
84 |
85 | stats, labels = Stats.get_report()
86 | data = [
87 | {
88 | 'y': year,
89 | 'a': '{:.2f}'.format( stats[year].get('prod1_sales') ),
90 | 'b': '{:.2f}'.format( stats[year].get('prod2_sales') ),
91 | 'c': '{:.2f}'.format( stats[year].get('prod3_sales') )
92 | } for year in stats
93 | ]
94 |
95 | context['chart_data'] = json.dumps({
96 | 'element': 'morris-bar-chart',
97 | 'data': data,
98 | 'xkey': 'y',
99 | 'barSizeRatio': 0.70,
100 | 'barGap': 3,
101 | 'resize': True,
102 | 'responsive': True,
103 | 'ykeys': ['a', 'b', 'c'], # it can be custom
104 | 'labels': labels,
105 | 'barColors': ['0-#1de9b6-#1dc4e9', '0-#899FD4-#A389D4', '#04a9f5'] # it can be custom
106 | })
107 |
108 | return HttpResponse(html_template.render(context, request))
109 |
110 | def charts_load(request):
111 | context = {'segment': 'charts_from_load'}
112 | html_template = loader.get_template('charts-from-load.html')
113 |
114 | # -----------------------------------------------
115 | # Extract data from Sale table
116 | # -----------------------------------------------
117 |
118 | sales, labels = Sale.get_sales_report()
119 | data = [
120 | {
121 | 'y': year,
122 | 'a': '{:.2f}'.format(sales[year].get('A')),
123 | 'b': '{:.2f}'.format(sales[year].get('B')),
124 | 'c': '{:.2f}'.format(sales[year].get('C'))
125 | } for year in sales
126 | ]
127 |
128 | context['chart_data'] = json.dumps({
129 | 'element': 'morris-bar-chart',
130 | 'data': data,
131 | 'xkey': 'y',
132 | 'barSizeRatio': 0.70,
133 | 'barGap': 3,
134 | 'resize': True,
135 | 'responsive': True,
136 | 'ykeys': ['a', 'b', 'c'], # it can be custom
137 | 'labels': labels,
138 | 'barColors': ['0-#1de9b6-#1dc4e9', '0-#899FD4-#A389D4', '#04a9f5'] # it can be custom
139 | })
140 |
141 | return HttpResponse(html_template.render(context, request))
142 |
143 | def pages(request):
144 | context = {}
145 | # All resource paths end in .html.
146 | # Pick out the html file name from the url. And load that template.
147 | try:
148 |
149 | load_template = request.path.split('/')[-1]
150 | context['segment'] = load_template
151 |
152 | html_template = loader.get_template(load_template)
153 | return HttpResponse(html_template.render(context, request))
154 |
155 | except template.TemplateDoesNotExist:
156 |
157 | html_template = loader.get_template('page-404.html')
158 | return HttpResponse(html_template.render(context, request))
159 |
160 | except:
161 |
162 | html_template = loader.get_template('page-500.html')
163 | return HttpResponse(html_template.render(context, request))
164 |
--------------------------------------------------------------------------------
/authentication/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
--------------------------------------------------------------------------------
/authentication/admin.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.contrib import admin
7 |
8 | # Register your models here.
9 |
--------------------------------------------------------------------------------
/authentication/config.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.apps import AppConfig
7 |
8 | class AuthConfig(AppConfig):
9 | name = 'authcfg'
10 |
--------------------------------------------------------------------------------
/authentication/forms.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django import forms
7 | from django.contrib.auth.forms import UserCreationForm
8 | from django.contrib.auth.models import User
9 |
10 | class LoginForm(forms.Form):
11 | username = forms.CharField(
12 | widget=forms.TextInput(
13 | attrs={
14 | "placeholder" : "Username",
15 | "class": "form-control"
16 | }
17 | ))
18 | password = forms.CharField(
19 | widget=forms.PasswordInput(
20 | attrs={
21 | "placeholder" : "Password",
22 | "class": "form-control"
23 | }
24 | ))
25 |
26 | class SignUpForm(UserCreationForm):
27 | username = forms.CharField(
28 | widget=forms.TextInput(
29 | attrs={
30 | "placeholder" : "Username",
31 | "class": "form-control"
32 | }
33 | ))
34 | email = forms.EmailField(
35 | widget=forms.EmailInput(
36 | attrs={
37 | "placeholder" : "Email",
38 | "class": "form-control"
39 | }
40 | ))
41 | password1 = forms.CharField(
42 | widget=forms.PasswordInput(
43 | attrs={
44 | "placeholder" : "Password",
45 | "class": "form-control"
46 | }
47 | ))
48 | password2 = forms.CharField(
49 | widget=forms.PasswordInput(
50 | attrs={
51 | "placeholder" : "Password check",
52 | "class": "form-control"
53 | }
54 | ))
55 |
56 | class Meta:
57 | model = User
58 | fields = ('username', 'email', 'password1', 'password2')
59 |
--------------------------------------------------------------------------------
/authentication/migrations/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
--------------------------------------------------------------------------------
/authentication/models.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.db import models
7 |
8 | # Create your models here.
9 |
--------------------------------------------------------------------------------
/authentication/tests.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.test import TestCase
7 |
8 | # Create your tests here.
9 |
--------------------------------------------------------------------------------
/authentication/urls.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.urls import path
7 | from .views import login_view, register_user
8 | from django.contrib.auth.views import LogoutView
9 |
10 | urlpatterns = [
11 | path('login/', login_view, name="login"),
12 | path('register/', register_user, name="register"),
13 | path("logout/", LogoutView.as_view(), name="logout")
14 | ]
15 |
--------------------------------------------------------------------------------
/authentication/views.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.shortcuts import render
7 |
8 | # Create your views here.
9 | from django.shortcuts import render, redirect
10 | from django.contrib.auth import authenticate, login
11 | from django.contrib.auth.models import User
12 | from django.forms.utils import ErrorList
13 | from django.http import HttpResponse
14 | from .forms import LoginForm, SignUpForm
15 |
16 | def login_view(request):
17 | form = LoginForm(request.POST or None)
18 |
19 | msg = None
20 |
21 | if request.method == "POST":
22 |
23 | if form.is_valid():
24 | username = form.cleaned_data.get("username")
25 | password = form.cleaned_data.get("password")
26 | user = authenticate(username=username, password=password)
27 | if user is not None:
28 | login(request, user)
29 | return redirect("/")
30 | else:
31 | msg = 'Invalid credentials'
32 | else:
33 | msg = 'Error validating the form'
34 |
35 | return render(request, "accounts/login.html", {"form": form, "msg" : msg})
36 |
37 | def register_user(request):
38 |
39 | msg = None
40 | success = False
41 |
42 | if request.method == "POST":
43 | form = SignUpForm(request.POST)
44 | if form.is_valid():
45 | form.save()
46 | username = form.cleaned_data.get("username")
47 | raw_password = form.cleaned_data.get("password1")
48 | user = authenticate(username=username, password=raw_password)
49 |
50 | msg = 'User created - please login .'
51 | success = True
52 |
53 | #return redirect("/login/")
54 |
55 | else:
56 | msg = 'Form is not valid'
57 | else:
58 | form = SignUpForm()
59 |
60 | return render(request, "accounts/register.html", {"form": form, "msg" : msg, "success" : success })
61 |
--------------------------------------------------------------------------------
/core/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
--------------------------------------------------------------------------------
/core/asgi.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | import os
7 |
8 | from django.core.asgi import get_asgi_application
9 |
10 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
11 |
12 | application = get_asgi_application()
13 |
--------------------------------------------------------------------------------
/core/settings.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | import os
7 |
8 | import dj_database_url
9 | from decouple import config
10 | from unipath import Path
11 |
12 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
13 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
14 | PROJECT_DIR = Path(__file__).parent
15 |
16 | # SECURITY WARNING: keep the secret key used in production secret!
17 | SECRET_KEY = config('SECRET_KEY', default='S#perS3crEt_1122')
18 |
19 | # SECURITY WARNING: don't run with debug turned on in production!
20 | DEBUG = config('DEBUG', default=False)
21 |
22 | # load production server from .env
23 | ALLOWED_HOSTS = ['localhost', '127.0.0.1', config('SERVER', default='127.0.0.1')]
24 |
25 | # Application definition
26 |
27 | INSTALLED_APPS = [
28 | 'app', # Enable the inner app
29 | 'import_export',
30 |
31 | 'django.contrib.admin',
32 | 'django.contrib.auth',
33 | 'django.contrib.contenttypes',
34 | 'django.contrib.sessions',
35 | 'django.contrib.messages',
36 | 'django.contrib.staticfiles',
37 | ]
38 |
39 | MIDDLEWARE = [
40 | 'django.middleware.security.SecurityMiddleware',
41 | 'whitenoise.middleware.WhiteNoiseMiddleware',
42 | 'django.contrib.sessions.middleware.SessionMiddleware',
43 | 'django.middleware.common.CommonMiddleware',
44 | 'django.middleware.csrf.CsrfViewMiddleware',
45 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
46 | 'django.contrib.messages.middleware.MessageMiddleware',
47 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
48 | ]
49 |
50 | ROOT_URLCONF = 'core.urls'
51 | LOGIN_REDIRECT_URL = "home" # Route defined in app/urls.py
52 | LOGOUT_REDIRECT_URL = "home" # Route defined in app/urls.py
53 | TEMPLATE_DIR = os.path.join(BASE_DIR, "core/templates") # ROOT dir for templates
54 |
55 | TEMPLATES = [
56 | {
57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
58 | 'DIRS': [TEMPLATE_DIR],
59 | 'APP_DIRS': True,
60 | 'OPTIONS': {
61 | 'context_processors': [
62 | 'django.template.context_processors.debug',
63 | 'django.template.context_processors.request',
64 | 'django.contrib.auth.context_processors.auth',
65 | 'django.contrib.messages.context_processors.messages',
66 | ],
67 | },
68 | },
69 | ]
70 |
71 | WSGI_APPLICATION = 'core.wsgi.application'
72 |
73 | # Database
74 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
75 |
76 | DATABASES = {
77 | 'default': {
78 | 'ENGINE': 'django.db.backends.sqlite3',
79 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
80 | }
81 | }
82 |
83 | # Password validation
84 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
85 |
86 | AUTH_PASSWORD_VALIDATORS = [
87 | {
88 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
89 | },
90 | {
91 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
92 | },
93 | {
94 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
95 | },
96 | {
97 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
98 | },
99 | ]
100 |
101 | # Internationalization
102 | # https://docs.djangoproject.com/en/3.0/topics/i18n/
103 |
104 | LANGUAGE_CODE = 'en-us'
105 |
106 | TIME_ZONE = 'UTC'
107 |
108 | USE_I18N = True
109 |
110 | USE_L10N = True
111 |
112 | USE_TZ = True
113 |
114 | #############################################################
115 | # SRC: https://devcenter.heroku.com/articles/django-assets
116 |
117 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
118 |
119 | # Static files (CSS, JavaScript, Images)
120 | # https://docs.djangoproject.com/en/1.9/howto/static-files/
121 | STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
122 | STATIC_URL = '/static/'
123 |
124 | # Extra places for collectstatic to find static files.
125 | STATICFILES_DIRS = (
126 | os.path.join(BASE_DIR, 'core/static'),
127 | )
128 | #############################################################
129 | #############################################################
130 |
--------------------------------------------------------------------------------
/core/static/assets/fonts/datta/datta-icon.css:
--------------------------------------------------------------------------------
1 | @charset "UTF-8";
2 |
3 | @font-face {
4 | font-family: "pct";
5 | src:url("fonts/pct.eot");
6 | src:url("fonts/pct.eot?#iefix") format("embedded-opentype"),
7 | url("fonts/pct.woff") format("woff"),
8 | url("fonts/pct.ttf") format("truetype"),
9 | url("fonts/pct.svg#pct") format("svg");
10 | font-weight: normal;
11 | font-style: normal;
12 |
13 | }
14 |
15 | [data-icon]:before {
16 | font-family: "pct" !important;
17 | content: attr(data-icon);
18 | font-style: normal !important;
19 | font-weight: normal !important;
20 | font-variant: normal !important;
21 | text-transform: none !important;
22 | speak: none;
23 | line-height: 1;
24 | -webkit-font-smoothing: antialiased;
25 | -moz-osx-font-smoothing: grayscale;
26 | }
27 |
28 | [class^="pct-"]:before,
29 | [class*=" pct-"]:before {
30 | font-family: "pct" !important;
31 | font-style: normal !important;
32 | font-weight: normal !important;
33 | font-variant: normal !important;
34 | text-transform: none !important;
35 | speak: none;
36 | line-height: 1;
37 | -webkit-font-smoothing: antialiased;
38 | -moz-osx-font-smoothing: grayscale;
39 | }
40 |
41 | .pct-arrow1:before {
42 | content: "\61";
43 | }
44 | .pct-arrow2:before {
45 | content: "\62";
46 | }
47 | .pct-arrow3:before {
48 | content: "\63";
49 | }
50 | .pct-arrow4:before {
51 | content: "\64";
52 | }
53 | .pct-chat1:before {
54 | content: "\65";
55 | }
56 | .pct-chat2:before {
57 | content: "\66";
58 | }
59 | .pct-chat3:before {
60 | content: "\67";
61 | }
62 | .pct-chat4:before {
63 | content: "\68";
64 | }
65 | .pct-loader1:before {
66 | content: "\69";
67 | }
68 | .pct-arrow-sharp1:before {
69 | content: "\6a";
70 | }
71 | .pct-arrow-sharp2:before {
72 | content: "\6b";
73 | }
74 | .pct-arrow-sharp3:before {
75 | content: "\6c";
76 | }
77 | .pct-arrow-sharp4:before {
78 | content: "\6d";
79 | }
80 |
--------------------------------------------------------------------------------
/core/static/assets/fonts/datta/fonts/pct.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/datta/fonts/pct.eot
--------------------------------------------------------------------------------
/core/static/assets/fonts/datta/fonts/pct.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Generated by Fontastic.me
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/core/static/assets/fonts/datta/fonts/pct.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/datta/fonts/pct.ttf
--------------------------------------------------------------------------------
/core/static/assets/fonts/datta/fonts/pct.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/datta/fonts/pct.woff
--------------------------------------------------------------------------------
/core/static/assets/fonts/feather/fonts/feather.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/feather/fonts/feather.eot
--------------------------------------------------------------------------------
/core/static/assets/fonts/feather/fonts/feather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/feather/fonts/feather.ttf
--------------------------------------------------------------------------------
/core/static/assets/fonts/feather/fonts/feather.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/feather/fonts/feather.woff
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-brands-400.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-brands-400.eot
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-brands-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-brands-400.ttf
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-brands-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-brands-400.woff
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-brands-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-brands-400.woff2
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-regular-400.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-regular-400.eot
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-regular-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-regular-400.ttf
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-regular-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-regular-400.woff
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-regular-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-regular-400.woff2
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-solid-900.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-solid-900.eot
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-solid-900.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-solid-900.ttf
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-solid-900.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-solid-900.woff
--------------------------------------------------------------------------------
/core/static/assets/fonts/fontawesome/webfonts/fa-solid-900.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/fonts/fontawesome/webfonts/fa-solid-900.woff2
--------------------------------------------------------------------------------
/core/static/assets/images/browser/chrome.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/browser/chrome.png
--------------------------------------------------------------------------------
/core/static/assets/images/browser/firefox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/browser/firefox.png
--------------------------------------------------------------------------------
/core/static/assets/images/browser/ie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/browser/ie.png
--------------------------------------------------------------------------------
/core/static/assets/images/browser/opera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/browser/opera.png
--------------------------------------------------------------------------------
/core/static/assets/images/browser/safari.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/browser/safari.png
--------------------------------------------------------------------------------
/core/static/assets/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/favicon.ico
--------------------------------------------------------------------------------
/core/static/assets/images/logo-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/logo-dark.png
--------------------------------------------------------------------------------
/core/static/assets/images/logo-thumb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/logo-thumb.png
--------------------------------------------------------------------------------
/core/static/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/logo.png
--------------------------------------------------------------------------------
/core/static/assets/images/slider/img-slide-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/slider/img-slide-1.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/slider/img-slide-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/slider/img-slide-2.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/slider/img-slide-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/slider/img-slide-3.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/slider/img-slide-4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/slider/img-slide-4.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/slider/img-slide-5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/slider/img-slide-5.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/slider/img1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/slider/img1.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/slider/img2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/slider/img2.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/slider/img3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/slider/img3.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/user/avatar-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/user/avatar-1.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/user/avatar-2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/user/avatar-2.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/user/avatar-3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/user/avatar-3.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/user/avatar-4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/user/avatar-4.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/user/avatar-5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/user/avatar-5.jpg
--------------------------------------------------------------------------------
/core/static/assets/images/user/user-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/user/user-1.png
--------------------------------------------------------------------------------
/core/static/assets/images/user/user-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/user/user-2.png
--------------------------------------------------------------------------------
/core/static/assets/images/widget/dashborad-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/widget/dashborad-1.png
--------------------------------------------------------------------------------
/core/static/assets/images/widget/dashborad-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/widget/dashborad-2.png
--------------------------------------------------------------------------------
/core/static/assets/images/widget/dashborad-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/widget/dashborad-3.png
--------------------------------------------------------------------------------
/core/static/assets/images/widget/dashborad-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/widget/dashborad-4.png
--------------------------------------------------------------------------------
/core/static/assets/images/widget/dashborad-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/widget/dashborad-5.png
--------------------------------------------------------------------------------
/core/static/assets/images/widget/dashborad-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/widget/dashborad-6.png
--------------------------------------------------------------------------------
/core/static/assets/images/widget/emoticon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/assets/images/widget/emoticon.png
--------------------------------------------------------------------------------
/core/static/assets/js/pages/chart-morris-custom.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | $(document).ready(function() {
3 | setTimeout(function() {
4 | // [ bar-simple ] chart start
5 | Morris.Bar({
6 | element: 'morris-bar-chart',
7 | data: [{
8 | y: '2008',
9 | a: 50,
10 | b: 40,
11 | c: 35,
12 | },
13 | {
14 | y: '2009',
15 | a: 75,
16 | b: 65,
17 | c: 60,
18 | },
19 | {
20 | y: '2010',
21 | a: 50,
22 | b: 40,
23 | c: 55,
24 | },
25 | {
26 | y: '2011',
27 | a: 75,
28 | b: 65,
29 | c: 85,
30 | },
31 | {
32 | y: '2012',
33 | a: 100,
34 | b: 90,
35 | c: 40,
36 | }
37 | ],
38 | xkey: 'y',
39 | barSizeRatio: 0.70,
40 | barGap: 3,
41 | resize: true,
42 | responsive:true,
43 | ykeys: ['a', 'b', 'c'],
44 | labels: ['Bar 1', 'Bar 2', 'Bar 3'],
45 | barColors: ["0-#1de9b6-#1dc4e9", "0-#899FD4-#A389D4", "#04a9f5"]
46 | });
47 | // [ bar-simple ] chart end
48 |
49 | // [ bar-stacked ] chart start
50 | Morris.Bar({
51 | element: 'morris-bar-stacked-chart',
52 | data: [{
53 | y: '2008',
54 | a: 50,
55 | b: 40,
56 | c: 35,
57 | },
58 | {
59 | y: '2009',
60 | a: 75,
61 | b: 65,
62 | c: 60,
63 | },
64 | {
65 | y: '2010',
66 | a: 50,
67 | b: 40,
68 | c: 55,
69 | },
70 | {
71 | y: '2011',
72 | a: 75,
73 | b: 65,
74 | c: 85,
75 | },
76 | {
77 | y: '2012',
78 | a: 100,
79 | b: 90,
80 | c: 40,
81 | }
82 | ],
83 | xkey: 'y',
84 | stacked: true,
85 | barSizeRatio: 0.50,
86 | barGap: 3,
87 | resize: true,
88 | responsive:true,
89 | ykeys: ['a', 'b', 'c'],
90 | labels: ['Bar 1', 'Bar 2', 'Bar 3'],
91 | barColors: ["0-#1de9b6-#1dc4e9", "0-#899FD4-#A389D4", "#04a9f5"]
92 | });
93 | // [ bar-stacked ] chart end
94 |
95 | // [ area-angle-chart ] start
96 | Morris.Area({
97 | element: 'morris-area-chart',
98 | data: [{
99 | y: '2006',
100 | a: 0,
101 | b: 0
102 | },
103 | {
104 | y: '2007',
105 | a: 130,
106 | b: 100
107 | },
108 | {
109 | y: '2008',
110 | a: 80,
111 | b: 60
112 | },
113 | {
114 | y: '2009',
115 | a: 70,
116 | b: 200
117 | },
118 | {
119 | y: '2010',
120 | a: 220,
121 | b: 150
122 | },
123 | {
124 | y: '2011',
125 | a: 105,
126 | b: 90
127 | },
128 | {
129 | y: '2012',
130 | a: 250,
131 | b: 150
132 | }
133 | ],
134 | xkey: 'y',
135 | ykeys: ['a', 'b'],
136 | labels: ['Series A', 'Series B'],
137 | pointSize: 0,
138 | fillOpacity: 0.8,
139 | pointStrokeColors: ['#b4becb', '#A389D4'],
140 | behaveLikeLine: true,
141 | gridLineColor: '#e0e0e0',
142 | lineWidth: 0,
143 | smooth: false,
144 | hideHover: 'auto',
145 | responsive:true,
146 | lineColors: ['#b4becb', '#A389D4'],
147 | resize: true
148 | });
149 | // [ area-angle-chart ] end
150 |
151 | // [ area-smooth-chart ] start
152 | Morris.Area({
153 | element: 'morris-area-curved-chart',
154 | data: [{
155 | period: '2010',
156 | iphone: 0,
157 | ipad: 0,
158 | itouch: 0
159 | }, {
160 | period: '2011',
161 | iphone: 50,
162 | ipad: 15,
163 | itouch: 5
164 | }, {
165 | period: '2012',
166 | iphone: 20,
167 | ipad: 50,
168 | itouch: 65
169 | }, {
170 | period: '2013',
171 | iphone: 60,
172 | ipad: 12,
173 | itouch: 7
174 | }, {
175 | period: '2014',
176 | iphone: 30,
177 | ipad: 20,
178 | itouch: 120
179 | }, {
180 | period: '2015',
181 | iphone: 25,
182 | ipad: 80,
183 | itouch: 40
184 | }, {
185 | period: '2016',
186 | iphone: 10,
187 | ipad: 10,
188 | itouch: 10
189 | }],
190 | lineColors: ['#A389D4', '#1de9b6', '#04a9f5'],
191 | xkey: 'period',
192 | ykeys: ['iphone', 'ipad', 'itouch'],
193 | labels: ['Site A', 'Site B', 'Site C'],
194 | pointSize: 0,
195 | lineWidth: 0,
196 | resize: true,
197 | fillOpacity: 0.9,
198 | responsive:true,
199 | behaveLikeLine: true,
200 | gridLineColor: '#d2d2d2',
201 | hideHover: 'auto'
202 | });
203 | // [ area-smooth-chart ] end
204 |
205 | // [ line-angle-chart ] Start
206 | Morris.Line({
207 | element: 'morris-line-chart',
208 | data: [{
209 | y: '2006',
210 | a: 20,
211 | b: 10
212 | },
213 | {
214 | y: '2007',
215 | a: 55,
216 | b: 45
217 | },
218 | {
219 | y: '2008',
220 | a: 45,
221 | b: 35
222 | },
223 | {
224 | y: '2009',
225 | a: 75,
226 | b: 65
227 | },
228 | {
229 | y: '2010',
230 | a: 50,
231 | b: 40
232 | },
233 | {
234 | y: '2011',
235 | a: 75,
236 | b: 65
237 | },
238 | {
239 | y: '2012',
240 | a: 100,
241 | b: 90
242 | }
243 | ],
244 | xkey: 'y',
245 | redraw: true,
246 | resize: true,
247 | smooth: false,
248 | ykeys: ['a', 'b'],
249 | hideHover: 'auto',
250 | responsive:true,
251 | labels: ['Series A', 'Series B'],
252 | lineColors: ['#1de9b6', '#04a9f5']
253 | });
254 | // [ line-angle-chart ] end
255 | // [ line-smooth-chart ] start
256 | Morris.Line({
257 | element: 'morris-line-smooth-chart',
258 | data: [{
259 | y: '2006',
260 | a: 100,
261 | b: 90
262 | },
263 | {
264 | y: '2007',
265 | a: 75,
266 | b: 65
267 | },
268 | {
269 | y: '2008',
270 | a: 50,
271 | b: 40
272 | },
273 | {
274 | y: '2009',
275 | a: 75,
276 | b: 65
277 | },
278 | {
279 | y: '2010',
280 | a: 50,
281 | b: 40
282 | },
283 | {
284 | y: '2011',
285 | a: 75,
286 | b: 65
287 | },
288 | {
289 | y: '2012',
290 | a: 100,
291 | b: 90
292 | }
293 | ],
294 | xkey: 'y',
295 | redraw: true,
296 | resize: true,
297 | ykeys: ['a', 'b'],
298 | hideHover: 'auto',
299 | responsive:true,
300 | labels: ['Series A', 'Series B'],
301 | lineColors: ['#1de9b6', '#A389D4']
302 | });
303 | // [ line-smooth-chart ] end
304 |
305 | // [ Donut-chart ] Start
306 | var graph = Morris.Donut({
307 | element: 'morris-donut-chart',
308 | data: [{
309 | value: 60,
310 | label: 'Data 1'
311 | },
312 | {
313 | value: 20,
314 | label: 'Data 1'
315 | },
316 | {
317 | value: 10,
318 | label: 'Data 1'
319 | },
320 | {
321 | value: 5,
322 | label: 'Data 1'
323 | }
324 | ],
325 | colors: [
326 | '#1de9b6',
327 | '#A389D4',
328 | '#04a9f5',
329 | '#1dc4e9',
330 | ],
331 | resize: true,
332 | formatter: function(x) {
333 | return "val : " + x
334 | }
335 | });
336 | // [ Donut-chart ] end
337 | }, 700);
338 | });
339 |
--------------------------------------------------------------------------------
/core/static/assets/js/pages/google-maps.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | $(document).ready(function() {
3 | var basic;
4 | basic = new GMaps({
5 | el: '#basic-map',
6 | lat: 21.217319,
7 | lng: 72.866472,
8 | scrollwheel: false
9 | });
10 | var map;
11 | map = new GMaps({
12 | el: '#markers-map',
13 | lat: 21.2334329,
14 | lng: 72.866472,
15 | scrollwheel: false
16 | });
17 | map.addMarker({
18 | lat: 21.2334329,
19 | lng: 72.866472,
20 | title: 'Marker with InfoWindow',
21 | infoWindow: {
22 | content: ' Buy Now at Themeforest
'
23 | }
24 | });
25 | var mapOverlay;
26 | mapOverlay = new GMaps({
27 | el: '#mapOverlay',
28 | lat: 21.2334329,
29 | lng: 72.866472,
30 | scrollwheel: false
31 | });
32 | mapOverlay.drawOverlay({
33 | lat: 21.2334329,
34 | lng: 72.866472,
35 | content: 'Address
'
36 | });
37 | var mapGeo = new GMaps({
38 | div: '#mapGeo',
39 | lat: 21.2334329,
40 | lng: 72.866472
41 | });
42 | $('#geocoding_form').submit(function(e) {
43 | e.preventDefault();
44 | GMaps.geocode({
45 | address: $('#address').val().trim(),
46 | callback: function(results, status) {
47 | if (status == 'OK') {
48 | var latlng = results[0].geometry.location;
49 | mapGeo.setCenter(latlng.lat(), latlng.lng());
50 | mapGeo.addMarker({
51 | lat: latlng.lat(),
52 | lng: latlng.lng()
53 | });
54 | }
55 | }
56 | });
57 | });
58 | var panorama;
59 | panorama = GMaps.createPanorama({
60 | el: '#mapStreet',
61 | lat: 42.3455,
62 | lng: -71.0983
63 | });
64 | var mapT;
65 | mapT = new GMaps({
66 | div: '#mapTypes',
67 | lat: 21.2334329,
68 | lng: 72.866472,
69 | mapTypeControlOptions: {
70 | mapTypeIds: ["hybrid", "roadmap", "satellite", "terrain", "osm"]
71 | }
72 | });
73 | mapT.addMapType("osm", {
74 | getTileUrl: function(coord, zoom) {
75 | return "https://a.tile.openstreetmap.org/" + zoom + "/" + coord.x + "/" + coord.y + ".png";
76 | },
77 | tileSize: new google.maps.Size(256, 256),
78 | name: "OpenStreetMap",
79 | maxZoom: 18
80 | });
81 | mapT.setMapTypeId("osm");
82 | var georssmap = new google.maps.Map(document.getElementById('georssmap'), {
83 | zoom: 4,
84 | center: {
85 | lat: 21.2334329,
86 | lng: 72.866472
87 | }
88 | });
89 | var georssLayer = new google.maps.KmlLayer({
90 | url: 'http://api.flickr.com/services/feeds/geo/?g=322338@N20&lang=en-us&format=feed-georss'
91 | });
92 | georssLayer.setMap(georssmap);
93 | var map = new google.maps.Map(document.getElementById('map'), {
94 | zoom: 6,
95 | center: {
96 | lat: 21.2334329,
97 | lng: 72.866472
98 | }
99 | });
100 | var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
101 | var markers = locations.map(function(location, i) {
102 | return new google.maps.Marker({
103 | position: location,
104 | label: labels[i % labels.length]
105 | });
106 | });
107 | var markerCluster = new MarkerClusterer(map, markers, {
108 | imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'
109 | });
110 | });
111 | var locations = [{
112 | lat: 21.1702401,
113 | lng: 72.8310607
114 | }, {
115 | lat: 21.128143,
116 | lng: 79.125618
117 | }, {
118 | lat: 22.451530,
119 | lng: 88.399818
120 | }, {
121 | lat: 20.264774,
122 | lng: 73.508148
123 | }, {
124 | lat: 23.080135,
125 | lng: 72.572174
126 | }, {
127 | lat: 22.835373,
128 | lng: 88.360992
129 | }, {
130 | lat: 29.280394,
131 | lng: 78.831718
132 | }, {
133 | lat: 9.907271,
134 | lng: 78.094429
135 | }, {
136 | lat: 26.903660,
137 | lng: 78.514259
138 | }, {
139 | lat: 19.062054,
140 | lng: 72.883438
141 | }, {
142 | lat: 11.235264,
143 | lng: 78.858414
144 | }, {
145 | lat: 23.302189,
146 | lng: 81.356804
147 | }, {
148 | lat: 12.695032,
149 | lng: 78.621887
150 | }, {
151 | lat: 22.511976,
152 | lng: 88.250992
153 | }, {
154 | lat: 23.125587,
155 | lng: 88.546867
156 | }, {
157 | lat: 21.164993,
158 | lng: 81.775307
159 | }, {
160 | lat: 21.779188,
161 | lng: 87.744629
162 | }, {
163 | lat: 25.416676,
164 | lng: 86.129379
165 | }, {
166 | lat: 15.478569,
167 | lng: 78.483093
168 | }, {
169 | lat: 13.340881,
170 | lng: 74.742142
171 | }, {
172 | lat: 17.143908,
173 | lng: 79.623924
174 | }]
175 |
--------------------------------------------------------------------------------
/core/static/assets/plugins/amchart/js/gauge.js:
--------------------------------------------------------------------------------
1 | (function(){var d=window.AmCharts;d.GaugeAxis=d.Class({construct:function(a){this.cname="GaugeAxis";this.radius="95%";this.createEvents("rollOverBand","rollOutBand","clickBand");this.labelsEnabled=!0;this.startAngle=-120;this.endAngle=120;this.startValue=0;this.endValue=200;this.gridCount=5;this.tickLength=10;this.minorTickLength=5;this.tickColor="#555555";this.labelFrequency=this.tickThickness=this.tickAlpha=1;this.inside=!0;this.labelOffset=10;this.showLastLabel=this.showFirstLabel=!0;this.axisThickness=1;this.axisColor="#000000";this.axisAlpha=1;this.gridInside=!0;this.topTextYOffset=0;this.topTextBold=!0;this.bottomTextYOffset=0;this.bottomTextBold=!0;this.centerY=this.centerX="0%";this.bandOutlineAlpha=this.bandOutlineThickness=0;this.bandOutlineColor="#000000";this.bandAlpha=1;this.bcn="gauge-axis";d.applyTheme(this,a,"GaugeAxis")},value2angle:function(a){return(a-this.startValue)/(this.endValue-this.startValue)*(this.endAngle-this.startAngle)+this.startAngle},setTopText:function(a){if(void 0!==
2 | a){this.topText=a;var b=this.chart;if(this.axisCreated){this.topTF&&this.topTF.remove();var c=this.topTextFontSize;c||(c=b.fontSize);var e=this.topTextColor;e||(e=b.color);a=d.text(b.container,a,e,b.fontFamily,c,void 0,this.topTextBold);d.setCN(b,a,"axis-top-label");a.translate(this.centerXReal,this.centerYReal-this.radiusReal/2+this.topTextYOffset);this.set.push(a);this.topTF=a}}},setBottomText:function(a){if(void 0!==a){this.bottomText=a;var b=this.chart;if(this.axisCreated){this.bottomTF&&this.bottomTF.remove();var c=this.bottomTextFontSize;c||(c=b.fontSize);var e=this.bottomTextColor;e||(e=b.color);a=d.text(b.container,a,e,b.fontFamily,c,void 0,this.bottomTextBold);d.setCN(b,a,"axis-bottom-label");a.translate(this.centerXReal,this.centerYReal+this.radiusReal/2+this.bottomTextYOffset);this.bottomTF=a;this.set.push(a)}}},draw:function(){var a=this.chart,b=a.container.set();this.set=b;d.setCN(a,b,this.bcn);d.setCN(a,b,this.bcn+"-"+this.id);a.graphsSet.push(b);this.bandSet=a.container.set();this.set.push(this.bandSet);var c=this.startValue,e=this.endValue,g=this.valueInterval;isNaN(g)&&(g=(e-c)/this.gridCount);var l=this.minorTickInterval;isNaN(l)&&(l=g/5);var n=this.startAngle,h=this.endAngle,k=this.tickLength,p=(e-c)/g+1,f=(h-n)/(p-1);this.singleValueAngle=f/g;var m=a.container,w=this.tickColor,z=this.tickAlpha,J=this.tickThickness,l=g/l,K=f/l,H=this.minorTickLength,I=this.labelFrequency,v=this.radiusReal;this.inside||(v-=15);this.radiusRealReal=v;var A=a.centerX+d.toCoordinate(this.centerX,a.realWidth),B=a.centerY+
3 | d.toCoordinate(this.centerY,a.realHeight);this.centerXReal=A;this.centerYReal=B;var t={fill:this.axisColor,"fill-opacity":this.axisAlpha,"stroke-width":0,"stroke-opacity":0},r,C;this.gridInside?C=r=v:(r=v-k,C=r+H);this.minorTickRadius=C;this.drawBands();var q=this.axisThickness/2,h=d.wedge(m,A,B,n,h-n,r+q,r+q,r-q,0,t);d.setCN(a,h.wedge,"axis-line");b.push(h);h=d.doNothing;d.isModern||(h=Math.round);t=d.getDecimals(c);r=d.getDecimals(e);e=d.getDecimals(g);e=Math.max(e,t,r);g=d.roundTo(g,e+1);for(t=0;t=b.totalFrames)b=this.endValue,a=this.startValue;else{this.frame++;var c=d.getEffect(b.startEffect),a=d[c](0,this.frame,this.previousStartValue,this.startValue-this.previousStartValue,b.totalFrames),b=d[c](0,this.frame,this.previousEndValue,this.endValue-this.previousEndValue,b.totalFrames);isNaN(a)&&(a=this.startValue);isNaN(b)&&(b=this.endValue)}a==this.currentStartValue&&b==this.currentEndValue||this.draw(a,b)}},setStartValue:function(a){this.previousStartValue=this.startValue;this.startValue=a;this.frame=0},setEndValue:function(a){this.previousEndValue=this.endValue;this.endValue=a;this.frame=0}})})();(function(){var d=window.AmCharts;d.AmAngularGauge=d.Class({inherits:d.AmChart,construct:function(a){this.cname="AmAngularGauge";d.AmAngularGauge.base.construct.call(this,a);this.theme=a;this.type="gauge";this.minRadius=this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=10;this.faceColor="#FAFAFA";this.faceAlpha=0;this.faceBorderWidth=1;this.faceBorderColor="#555555";this.faceBorderAlpha=0;this.arrows=[];this.axes=[];this.startDuration=1;this.startEffect="easeOutSine";this.adjustSize=!0;this.extraHeight=this.extraWidth=0;d.applyTheme(this,a,this.cname)},addAxis:function(a){a.chart=this;this.axes.push(a)},formatString:function(a,b){return a=d.formatValue(a,b,["value"],this.nf,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers)},initChart:function(){d.AmAngularGauge.base.initChart.call(this);var a;0===this.axes.length&&(a=new d.GaugeAxis(this.theme),this.addAxis(a));var b;for(b=0;ba&&(a=c.width*l),c.height*l>k&&(k=c.height*l);(b=this.legend)&&b.invalidateSize();if(this.adjustSize&&!this.sizeAdjusted){f&&(f=f.getBBox(),f.width>a&&(a=f.width),f.height>k&&(k=f.height));f=0;if(p>k||e>a)f=Math.min(p-k,e-a);5=this.totalFrames?c=b.value:(b.frame++,b.clockWiseOnly&&b.value
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/core/static/assets/plugins/amchart/js/images/lens.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/core/static/assets/plugins/amchart/js/light.js:
--------------------------------------------------------------------------------
1 | AmCharts.themes.light={themeName:"light",AmChart:{color:"#000000",backgroundColor:"#FFFFFF"},AmCoordinateChart:{colors:["#67b7dc","#fdd400","#84b761","#cc4748","#cd82ad","#2f4074","#448e4d","#b7b83f","#b9783f","#b93e3d","#913167"]},AmStockChart:{colors:["#67b7dc","#fdd400","#84b761","#cc4748","#cd82ad","#2f4074","#448e4d","#b7b83f","#b9783f","#b93e3d","#913167"]},AmSlicedChart:{colors:["#67b7dc","#fdd400","#84b761","#cc4748","#cd82ad","#2f4074","#448e4d","#b7b83f","#b9783f","#b93e3d","#913167"],outlineAlpha:1,outlineThickness:2,labelTickColor:"#000000",labelTickAlpha:0.3},AmRectangularChart:{zoomOutButtonColor:'#000000',zoomOutButtonRollOverAlpha:0.15,zoomOutButtonImage:"lens"},AxisBase:{axisColor:"#000000",axisAlpha:0.3,gridAlpha:0.1,gridColor:"#000000"},ChartScrollbar:{backgroundColor:"#000000",backgroundAlpha:0.12,graphFillAlpha:0.5,graphLineAlpha:0,selectedBackgroundColor:"#FFFFFF",selectedBackgroundAlpha:0.4,gridAlpha:0.15},ChartCursor:{cursorColor:"#000000",color:"#FFFFFF",cursorAlpha:0.5},AmLegend:{color:"#000000"},AmGraph:{lineAlpha:0.9},GaugeArrow:{color:"#000000",alpha:0.8,nailAlpha:0,innerRadius:"40%",nailRadius:15,startWidth:15,borderAlpha:0.8,nailBorderAlpha:0},GaugeAxis:{tickColor:"#000000",tickAlpha:1,tickLength:15,minorTickLength:8,axisThickness:3,axisColor:'#000000',axisAlpha:1,bandAlpha:0.8},TrendLine:{lineColor:"#c03246",lineAlpha:0.8},AreasSettings:{alpha:0.8,color:"#67b7dc",colorSolid:"#003767",unlistedAreasAlpha:0.4,unlistedAreasColor:"#000000",outlineColor:"#FFFFFF",outlineAlpha:0.5,outlineThickness:0.5,rollOverColor:"#3c5bdc",rollOverOutlineColor:"#FFFFFF",selectedOutlineColor:"#FFFFFF",selectedColor:"#f15135",unlistedAreasOutlineColor:"#FFFFFF",unlistedAreasOutlineAlpha:0.5},LinesSettings:{color:"#000000",alpha:0.8},ImagesSettings:{alpha:0.8,labelColor:"#000000",color:"#000000",labelRollOverColor:"#3c5bdc"},ZoomControl:{buttonFillAlpha:0.7,buttonIconColor:"#a7a7a7"},SmallMap:{mapColor:"#000000",rectangleColor:"#f15135",backgroundColor:"#FFFFFF",backgroundAlpha:0.7,borderThickness:1,borderAlpha:0.8},PeriodSelector:{color:"#000000"},PeriodButton:{color:"#000000",background:"transparent",opacity:0.7,border:"1px solid rgba(0, 0, 0, .3)",MozBorderRadius:"5px",borderRadius:"5px",margin:"1px",outline:"none",boxSizing:"border-box"},PeriodButtonSelected:{color:"#000000",backgroundColor:"#b9cdf5",border:"1px solid rgba(0, 0, 0, .3)",MozBorderRadius:"5px",borderRadius:"5px",margin:"1px",outline:"none",opacity:1,boxSizing:"border-box"},PeriodInputField:{color:"#000000",background:"transparent",border:"1px solid rgba(0, 0, 0, .3)",outline:"none"},DataSetSelector:{color:"#000000",selectedBackgroundColor:"#b9cdf5",rollOverBackgroundColor:"#a8b0e4"},DataSetCompareList:{color:"#000000",lineHeight:"100%",boxSizing:"initial",webkitBoxSizing:"initial",border:"1px solid rgba(0, 0, 0, .3)"},DataSetSelect:{border:"1px solid rgba(0, 0, 0, .3)",outline:"none"}};
2 |
--------------------------------------------------------------------------------
/core/static/assets/plugins/amchart/js/radar.js:
--------------------------------------------------------------------------------
1 | (function(){var d=window.AmCharts;d.AmRadarChart=d.Class({inherits:d.AmCoordinateChart,construct:function(a){this.type="radar";d.AmRadarChart.base.construct.call(this,a);this.cname="AmRadarChart";this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=0;this.radius="35%";d.applyTheme(this,a,this.cname)},initChart:function(){d.AmRadarChart.base.initChart.call(this);if(this.dataChanged)this.parseData();else this.onDataUpdated()},onDataUpdated:function(){this.drawChart()},updateGraphs:function(){var a=this.graphs,b;for(b=0;bg&&(x="end",t-=10);180==g&&(q-=5);0===g&&(q+=5);g=d.text(b.container,p[w].category,k,r,h,x);g.translate(t+5,q);this.set.push(g);d.setCN(b,g,a.bcn+"title")}}}}})})();(function(){var d=window.AmCharts;d.RadItem=d.Class({construct:function(a,b,c,f,m,n,e,r){f=a.chart;void 0===c&&(c="");var h=a.chart.fontFamily,k=a.fontSize;void 0===k&&(k=a.chart.fontSize);var p=a.color;void 0===p&&(p=a.chart.color);var l=a.chart.container;this.set=m=l.set();var w=a.axisColor,z=a.axisAlpha,q=a.tickLength,g=a.gridAlpha,t=a.gridThickness,x=a.gridColor,D=a.dashLength,E=a.fillColor,B=a.fillAlpha,F=a.labelsEnabled;n=a.counter;var G=a.inside,H=a.gridType,u,J=a.labelOffset,A;b-=a.height;var y;e?(F=!0,void 0!==e.id&&(A=f.classNamePrefix+"-guide-"+e.id),isNaN(e.tickLength)||(q=e.tickLength),void 0!=e.lineColor&&(x=e.lineColor),isNaN(e.lineAlpha)||(g=e.lineAlpha),isNaN(e.dashLength)||(D=e.dashLength),isNaN(e.lineThickness)||(t=e.lineThickness),!0===e.inside&&(G=!0),void 0!==e.boldLabel&&(r=e.boldLabel)):c||(g/=3,q/=2);var I="end",C=-1;G&&(I="start",C=1);var v;F&&(v=d.text(l,c,p,h,k,I,r),v.translate((q+3+J)*C,b),m.push(v),d.setCN(f,v,a.bcn+"label"),e&&d.setCN(f,v,"guide"),d.setCN(f,v,A,!0),this.label=v,y=d.line(l,[0,q*C],[b,b],w,z,t),m.push(y),d.setCN(f,y,a.bcn+"tick"),e&&d.setCN(f,y,"guide"),d.setCN(f,y,A,!0));b=Math.abs(b);r=[];h=[];if(0.scroll-content{border:none!important;box-sizing:content-box!important;height:auto;left:0;margin:0;max-height:none;max-width:none!important;overflow:scroll!important;padding:0;position:relative!important;top:0;width:auto!important}.scroll-wrapper>.scroll-content::-webkit-scrollbar{height:0;width:0}.scroll-element{display:none}.scroll-element,.scroll-element div{box-sizing:content-box}.scroll-element.scroll-x.scroll-scrollx_visible,.scroll-element.scroll-y.scroll-scrolly_visible{display:block}.scroll-element .scroll-arrow,.scroll-element .scroll-bar{cursor:default}.scroll-textarea{border:1px solid #ccc;border-top-color:#999}.scroll-textarea>.scroll-content{overflow:hidden!important}.scroll-textarea>.scroll-content>textarea{border:none!important;box-sizing:border-box;height:100%!important;margin:0;max-height:none!important;max-width:none!important;overflow:scroll!important;outline:0;padding:2px;position:relative!important;top:0;width:100%!important}.scroll-textarea>.scroll-content>textarea::-webkit-scrollbar{height:0;width:0}.scroll-div>.scroll-element,.scroll-div>.scroll-element div{background:0 0;border:none;margin:0;padding:0;position:absolute;z-index:1026}.scroll-div>.scroll-element div{display:block;height:100%;left:0;top:0;width:100%}.scroll-div>.scroll-element .scroll-element_track{display:none}.scroll-div>.scroll-element .scroll-bar{background-color:#a7a7a7;display:block;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);opacity:0;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;-ms-transition:opacity .2s linear;transition:opacity .2s linear}.scroll-div:hover>.scroll-element .scroll-bar,.scroll-div>.scroll-element.scroll-draggable .scroll-bar{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";filter:alpha(opacity=70);opacity:.7}.scroll-div>.scroll-element.scroll-x{bottom:0;height:0;left:0;min-width:100%;overflow:visible;width:100%}.scroll-div>.scroll-element.scroll-y{height:100%;min-height:100%;right:0;top:0;width:0}.scroll-div>.scroll-element.scroll-x .scroll-element_outer{left:2px}.scroll-div>.scroll-element.scroll-x .scroll-element_size{left:-4px}.scroll-div>.scroll-element.scroll-y .scroll-element_outer{top:2px}.scroll-div>.scroll-element.scroll-y .scroll-element_size{top:-4px}.scroll-div>.scroll-element.scroll-x.scroll-scrolly_visible .scroll-element_size{left:-11px}.scroll-div>.scroll-element.scroll-y.scroll-scrollx_visible .scroll-element_size{top:-11px}.scroll-div>.scroll-element.scroll-y .scroll-bar{left:-4px;min-height:10px;width:3px}.scroll-div>.scroll-element.scroll-x .scroll-bar{top:-3px;min-width:10px;height:3px}
2 |
--------------------------------------------------------------------------------
/core/static/assets/plugins/jquery-scrollbar/js/jquery.scrollbar.min.js:
--------------------------------------------------------------------------------
1 | !function(l,e){"function"==typeof define&&define.amd?define(["jquery"],e):e(l.jQuery)}(this,function(l){"use strict";var e={data:{index:0,name:"scrollbar"},macosx:/mac/i.test(navigator.platform),mobile:/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent),overlay:null,scroll:null,scrolls:[],webkit:/webkit/i.test(navigator.userAgent)&&!/edge\/\d+/i.test(navigator.userAgent)};e.scrolls.add=function(l){this.remove(l).push(l)},e.scrolls.remove=function(e){for(;l.inArray(e,this)>=0;)this.splice(l.inArray(e,this),1);return this};var o={autoScrollSize:!0,autoUpdate:!0,debug:!1,disableBodyScroll:!1,duration:200,ignoreMobile:!1,ignoreOverlay:!1,scrollStep:30,showArrows:!1,stepScrolling:!0,scrollx:null,scrolly:null,onDestroy:null,onInit:null,onScroll:null,onUpdate:null},s=function(s){var r;e.scroll||(e.overlay=!((r=c(!0)).height||r.width),e.scroll=c(),n(),l(window).resize(function(){var l=!1;if(e.scroll&&(e.scroll.height||e.scroll.width)){var o=c();o.height===e.scroll.height&&o.width===e.scroll.width||(e.scroll=o,l=!0)}n(l)})),this.container=s,this.namespace=".scrollbar_"+e.data.index++,this.options=l.extend({},o,window.jQueryScrollbarOptions||{}),this.scrollTo=null,this.scrollx={},this.scrolly={},s.data(e.data.name,this),e.scrolls.add(this)};s.prototype={destroy:function(){if(this.wrapper){this.container.removeData(e.data.name),e.scrolls.remove(this);var o=this.container.scrollLeft(),s=this.container.scrollTop();this.container.insertBefore(this.wrapper).css({height:"",margin:"","max-height":""}).removeClass("scroll-content scroll-scrollx_visible scroll-scrolly_visible").off(this.namespace).scrollLeft(o).scrollTop(s),this.scrollx.scroll.removeClass("scroll-scrollx_visible").find("div").andSelf().off(this.namespace),this.scrolly.scroll.removeClass("scroll-scrolly_visible").find("div").andSelf().off(this.namespace),this.wrapper.remove(),l(document).add("body").off(this.namespace),l.isFunction(this.options.onDestroy)&&this.options.onDestroy.apply(this,[this.container])}},init:function(o){var s=this,r=this.container,t=this.containerWrapper||r,i=this.namespace,n=l.extend(this.options,o||{}),c={x:this.scrollx,y:this.scrolly},d=this.wrapper,h={scrollLeft:r.scrollLeft(),scrollTop:r.scrollTop()};if(e.mobile&&n.ignoreMobile||e.overlay&&n.ignoreOverlay||e.macosx&&!e.webkit)return!1;if(d)t.css({height:"auto","margin-bottom":-1*e.scroll.height+"px","margin-right":-1*e.scroll.width+"px","max-height":""});else{if(this.wrapper=d=l("").addClass("scroll-wrapper").addClass(r.attr("class")).css("position","absolute"==r.css("position")?"absolute":"relative").insertBefore(r).append(r),r.is("textarea")&&(this.containerWrapper=t=l("
").insertBefore(r).append(r),d.addClass("scroll-textarea")),t.addClass("scroll-content").css({height:"auto","margin-bottom":-1*e.scroll.height+"px","margin-right":-1*e.scroll.width+"px","max-height":""}),r.on("scroll"+i,function(e){l.isFunction(n.onScroll)&&n.onScroll.call(s,{maxScroll:c.y.maxScrollOffset,scroll:r.scrollTop(),size:c.y.size,visible:c.y.visible},{maxScroll:c.x.maxScrollOffset,scroll:r.scrollLeft(),size:c.x.size,visible:c.x.visible}),c.x.isVisible&&c.x.scroll.bar.css("left",r.scrollLeft()*c.x.kx+"px"),c.y.isVisible&&c.y.scroll.bar.css("top",r.scrollTop()*c.y.kx+"px")}),d.on("scroll"+i,function(){d.scrollTop(0).scrollLeft(0)}),n.disableBodyScroll){var p=function(l){a(l)?c.y.isVisible&&c.y.mousewheel(l):c.x.isVisible&&c.x.mousewheel(l)};d.on("MozMousePixelScroll"+i,p),d.on("mousewheel"+i,p),e.mobile&&d.on("touchstart"+i,function(e){var o=e.originalEvent.touches&&e.originalEvent.touches[0]||e,s=o.pageX,t=o.pageY,n=r.scrollLeft(),c=r.scrollTop();l(document).on("touchmove"+i,function(l){var e=l.originalEvent.targetTouches&&l.originalEvent.targetTouches[0]||l;r.scrollLeft(n+s-e.pageX),r.scrollTop(c+t-e.pageY),l.preventDefault()}),l(document).on("touchend"+i,function(){l(document).off(i)})})}l.isFunction(n.onInit)&&n.onInit.apply(this,[r])}l.each(c,function(e,o){var t=null,d=1,h="x"===e?"scrollLeft":"scrollTop",p=n.scrollStep,u=function(){var l=r[h]();r[h](l+p),1==d&&l+p>=f&&(l=r[h]()),-1==d&&l+p<=f&&(l=r[h]()),r[h]()==l&&t&&t()},f=0;o.scroll||(o.scroll=s._getScroll(n["scroll"+e]).addClass("scroll-"+e),n.showArrows&&o.scroll.addClass("scroll-element_arrows_visible"),o.mousewheel=function(l){if(!o.isVisible||"x"===e&&a(l))return!0;if("y"===e&&!a(l))return c.x.mousewheel(l),!0;var t=-1*l.originalEvent.wheelDelta||l.originalEvent.detail,i=o.size-o.visible-o.offset;return(t>0&&f
0)&&((f+=t)<0&&(f=0),f>i&&(f=i),s.scrollTo=s.scrollTo||{},s.scrollTo[h]=f,setTimeout(function(){s.scrollTo&&(r.stop().animate(s.scrollTo,240,"linear",function(){f=r[h]()}),s.scrollTo=null)},1)),l.preventDefault(),!1},o.scroll.on("MozMousePixelScroll"+i,o.mousewheel).on("mousewheel"+i,o.mousewheel).on("mouseenter"+i,function(){f=r[h]()}),o.scroll.find(".scroll-arrow, .scroll-element_track").on("mousedown"+i,function(i){if(1!=i.which)return!0;d=1;var c={eventOffset:i["x"===e?"pageX":"pageY"],maxScrollValue:o.size-o.visible-o.offset,scrollbarOffset:o.scroll.bar.offset()["x"===e?"left":"top"],scrollbarSize:o.scroll.bar["x"===e?"outerWidth":"outerHeight"]()},a=0,v=0;return l(this).hasClass("scroll-arrow")?(d=l(this).hasClass("scroll-arrow_more")?1:-1,p=n.scrollStep*d,f=d>0?c.maxScrollValue:0):(d=c.eventOffset>c.scrollbarOffset+c.scrollbarSize?1:c.eventOffset','
','
','
','"," "].join(""),simple:['
"].join("")};return o[e]&&(e=o[e]),e||(e=o.simple),e="string"==typeof e?l(e).appendTo(this.wrapper):l(e),l.extend(e,{bar:e.find(".scroll-bar"),size:e.find(".scroll-element_size"),track:e.find(".scroll-element_track")}),e},_handleMouseDown:function(e,o){var s=this.namespace;return l(document).on("blur"+s,function(){l(document).add("body").off(s),e&&e()}),l(document).on("dragstart"+s,function(l){return l.preventDefault(),!1}),l(document).on("mouseup"+s,function(){l(document).add("body").off(s),e&&e()}),l("body").on("selectstart"+s,function(l){return l.preventDefault(),!1}),o&&o.preventDefault(),!1},_updateScroll:function(o,s){var r=this.container,t=this.containerWrapper||r,i="scroll-scroll"+o+"_visible",n="x"===o?this.scrolly:this.scrollx,c=parseInt(this.container.css("x"===o?"left":"top"),10)||0,a=this.wrapper,d=s.size,h=s.visible+c;s.isVisible=d-h>1,s.isVisible?(s.scroll.addClass(i),n.scroll.addClass(i),t.addClass(i)):(s.scroll.removeClass(i),n.scroll.removeClass(i),t.removeClass(i)),"y"===o&&(r.is("textarea")||d
").css(l.extend({},s)),e.data.outer=l("").css(l.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},s)).append(e.data.inner).appendTo("body")}return e.data.outer.scrollLeft(1e3).scrollTop(1e3),{height:Math.ceil(e.data.outer.offset().top-e.data.inner.offset().top||0),width:Math.ceil(e.data.outer.offset().left-e.data.inner.offset().left||0)}}function a(l){var e=l.originalEvent;return(!e.axis||e.axis!==e.HORIZONTAL_AXIS)&&!e.wheelDeltaX}window.angular&&(i=window.angular).module("jQueryScrollbar",[]).provider("jQueryScrollbar",function(){var l=o;return{setOptions:function(e){i.extend(l,e)},$get:function(){return{options:i.copy(l)}}}}).directive("jqueryScrollbar",["jQueryScrollbar","$parse",function(l,e){return{restrict:"AC",link:function(o,s,r){var t=e(r.jqueryScrollbar)(o);s.scrollbar(t||l.options).on("$destroy",function(){s.scrollbar("destroy")})}}}])});
--------------------------------------------------------------------------------
/core/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/static/favicon.ico
--------------------------------------------------------------------------------
/core/static/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 | https://django-dashboard-dattaable.appseed.us
11 | 1
12 | monthly
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/core/staticfiles/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/core/staticfiles/.gitkeep
--------------------------------------------------------------------------------
/core/templates/accounts/login.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base-fullscreen.html" %}
2 |
3 | {% block title %} Login {% endblock %}
4 |
5 | {% block content %}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Login
21 |
22 |
23 | {% if msg %}
24 | {{ msg | safe }}
25 | {% else %}
26 | Default Credentials: test / ApS12_ZZs8
27 | {% endif %}
28 |
29 |
30 |
31 |
32 |
33 |
54 |
55 |
Don’t have an account? Signup
56 |
57 |
58 | © CodedThemes
60 | - Django Boilerplate Dashboard .
62 |
63 |
64 |
65 |
66 |
67 |
68 | {% endblock content %}
69 |
--------------------------------------------------------------------------------
/core/templates/accounts/register.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base-fullscreen.html" %}
2 |
3 | {% block title %} Login {% endblock %}
4 |
5 | {% block content %}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Sign up
21 |
22 |
23 | {% if msg %}
24 | {{ msg | safe }}
25 | {% else %}
26 | Add your credentials
27 | {% endif %}
28 |
29 |
30 |
31 |
32 |
33 |
66 |
67 |
Already have an account? Login
68 |
69 |
70 | © CodedThemes
72 | - Django Boilerplate Dashboard
74 |
75 |
76 |
77 |
78 |
79 |
80 | {% endblock content %}
81 |
--------------------------------------------------------------------------------
/core/templates/auth-reset-pass.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base-fullscreen.html" %}
2 |
3 | {% block title %} Reset Pass {% endblock %}
4 |
5 |
6 | {% block stylesheets %}{% endblock stylesheets %}
7 |
8 | {% block content %}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
Reset Password
24 |
25 |
26 |
27 |
Reset Password
28 |
Don’t have an account? Signup
29 |
30 |
31 |
32 |
33 |
34 | {% endblock content %}
35 |
36 |
37 | {% block javascripts %}{% endblock javascripts %}
38 |
--------------------------------------------------------------------------------
/core/templates/charts-from-file.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 | {% load static %}
3 |
4 | {% block title %} Charts from File {% endblock %}
5 |
6 |
7 | {% block stylesheets %}
8 |
9 | {% endblock stylesheets %}
10 |
11 | {% block content %}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
49 |
50 |
51 |
52 | Above chart is loaded from a sample file:
53 | chart_morris.json saved in the
55 |
56 | sample_data
58 | directory.
59 |
60 | To update the charts, open the file in your preferred editor, change the values from ""data" JSON node and refresh the page.
61 |
62 |
63 |
64 | # Contents of file: sample_data/chart_morris.json
65 | {
66 | "element": "morris-bar-chart",
67 | "data": [
68 | { "y": "2017", "a": "150", "b": "90", "c": "80" },
69 | { "y": "2018", "a": "220", "b": "350", "c": "50" },
70 | { "y": "2019", "a": "80", "b": "300", "c": "240" },
71 | { "y": "2020", "a": "180", "b": "30", "c": "10" }
72 | ],
73 | "xkey": "y",
74 | "barSizeRatio": 0.70,
75 | "barGap": 3,
76 | "resize": true,
77 | "responsive": true,
78 | "ykeys": ["a", "b", "c"],
79 | "labels": ["Product A", "Product B", "Product C"],
80 | "barColors": ["0-#1de9b6-#1dc4e9", "0-#899FD4-#A389D4", "#04a9f5"]
81 | }
82 |
83 |
84 |
85 |
86 |
87 |
The Routing Settings
88 |
89 |
90 | This page has a simple rule defined in the
91 | app/urls.py file:
92 |
93 |
94 |
95 | # Contents of file: app/urls.py
96 |
97 | urlpatterns = [
98 | ...
99 | # Charts from file
100 | path('charts-file', views.charts_file, name='home'),
101 | ...
102 | ]
103 |
104 |
105 |
106 |
107 |
App Controller
108 |
109 |
110 | The code that render this page is fairly simple. Just load the JSON file from the filesystem and inject it into the page.
111 |
112 | Source: app/views.py
113 | - charts_file() :
114 |
115 |
116 |
117 | # Partial content from file: app/views.py
118 |
119 | def charts_file(request):
120 | context = {'segment': 'charts_from_file'}
121 | html_template = loader.get_template('charts-from-file.html')
122 |
123 | with open('sample_data/chart_morris.json', 'r') as f:
124 | context['chart_data'] = json.dumps(json.load(f))
125 |
126 | return HttpResponse(html_template.render(context, request))
127 |
128 |
129 |
130 |
131 |
HTML File
132 |
133 |
134 | The chart data is rendered using Morris JS ,
135 | a popular open-source chart library.
136 |
137 | The source file
138 | core/templates/charts-from-file.html .
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 | {% endblock content %}
154 |
155 |
156 | {% block javascripts %}
157 |
158 |
159 |
160 |
163 | {% endblock javascripts %}
164 |
--------------------------------------------------------------------------------
/core/templates/charts-from-input.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 | {% load static %}
3 |
4 | {% block title %} Charts from Input {% endblock %}
5 |
6 |
7 | {% block stylesheets %}
8 |
9 | {% endblock stylesheets %}
10 |
11 | {% block content %}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
47 |
48 |
49 |
50 | Above chart is loaded from STATS table.
51 |
52 | {% if user.is_superuser %}
53 | To update the charts, please update the STATS table information and refresh the page.
54 | {% else %}
55 | To update the charts, please authenticate as admin, update the STATS table information and refresh the page.
56 |
57 | Note: Admin account can be created using the createsuperuser command.
58 | {% endif %}
59 |
60 |
61 |
62 |
The Routing Settings
63 |
64 |
65 | This page has a simple rule defined in the
66 | app/urls.py file:
67 |
68 |
69 |
70 | # Contents of file: app/urls.py
71 |
72 | urlpatterns = [
73 | ...
74 | # Charts from Input
75 | path('charts-input' , views.charts_input, name='charts-input' ),
76 | ...
77 | ]
78 |
79 |
80 |
81 |
82 |
Render Flow
83 |
84 |
85 | The code that render this page use the information from STATS table.
86 |
87 | The model
89 | comes with a inner method that selects all rows: get_report() .
90 |
91 | Once the STATS rows are selected, controller read the page template and inject the information.
92 |
93 |
94 | Source: app/views.py
95 | - charts_input() :
96 |
97 |
98 |
99 | # Partial content from file: app/views.py
100 | def charts_input(request):
101 | context = {'segment': 'charts_from_input'}
102 | html_template = loader.get_template('charts-from-input.html')
103 |
104 | stats, labels = Stats.get_report()
105 | data = [
106 | {
107 | 'y': year,
108 | 'a': '{:.2f}'.format( stats[year].get('prod1_sales') ),
109 | 'b': '{:.2f}'.format( stats[year].get('prod2_sales') ),
110 | 'c': '{:.2f}'.format( stats[year].get('prod3_sales') )
111 | } for year in stats
112 | ]
113 |
114 | context['chart_data'] = json.dumps({
115 | 'element': 'morris-bar-chart',
116 | 'data': data,
117 | 'xkey': 'y',
118 | 'barSizeRatio': 0.70,
119 | 'barGap': 3,
120 | 'resize': True,
121 | 'responsive': True,
122 | 'ykeys': ['a', 'b', 'c'], # it can be custom
123 | 'labels': labels,
124 | 'barColors': ['0-#1de9b6-#1dc4e9', '0-#899FD4-#A389D4', '#04a9f5'] # it can be custom
125 | })
126 |
127 | return HttpResponse(html_template.render(context, request))
128 |
129 |
130 |
131 |
132 |
Database Model - STATS
133 |
134 |
135 | The model
137 | comes with a inner method that selects all rows: get_report() .
138 |
139 |
140 |
141 |
142 | class Stats(models.Model):
143 |
144 | year = models.IntegerField(_('year') , db_index=True)
145 | prod1_sales = models.IntegerField(_('product 1 sales'), db_index=True)
146 | prod2_sales = models.IntegerField(_('product 2 sales'), db_index=True)
147 | prod3_sales = models.IntegerField(_('product 3 sales'), db_index=True)
148 |
149 | class Meta:
150 | verbose_name = _('statistic')
151 | verbose_name_plural = _('stats')
152 |
153 | @classmethod
154 | def get_report(cls):
155 |
156 | data = {}
157 | labels = ['prod1_sales', 'prod2_sales', 'prod3_sales']
158 |
159 | stats = Stats.objects.order_by('year').values()
160 |
161 | for line in stats:
162 |
163 | if line['year'] not in data:
164 | data[line['year']] = {}
165 |
166 | data[ line['year'] ]['prod1_sales'] = line['prod1_sales']
167 | data[ line['year'] ]['prod2_sales'] = line['prod2_sales']
168 | data[ line['year'] ]['prod3_sales'] = line['prod3_sales']
169 |
170 | return data, labels
171 |
172 |
173 |
174 |
175 |
HTML File
176 |
177 |
178 | The chart data is rendered using Morris JS ,
179 | a popular open-source chart library.
180 |
181 | The source file
182 | core/templates/charts-from-input.html .
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | {% endblock content %}
198 |
199 |
200 | {% block javascripts %}
201 |
202 |
203 |
204 |
207 | {% endblock javascripts %}
208 |
--------------------------------------------------------------------------------
/core/templates/charts-from-load.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 | {% load static %}
3 |
4 | {% block title %} Charts from Load {% endblock %}
5 |
6 |
7 | {% block stylesheets %}
8 |
9 | {% endblock stylesheets %}
10 |
11 | {% block content %}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
47 |
48 |
49 |
50 | Above chart is generated dinamically based on the information gathered by get_sales_report)(), a inner method defined by Sale model
51 |
52 | {% if user.is_superuser %}
53 | To update the charts, please update the SALES table information and refresh the page.
54 | {% else %}
55 | To update the charts, please authenticate as admin, update the SALES table information and refresh the page.
56 |
57 | Note: Admin account can be created using the createsuperuser command.
58 | {% endif %}
59 |
60 |
61 |
62 |
The Routing Settings
63 |
64 |
65 | This page has a simple rule defined in the
66 | app/urls.py file:
67 |
68 |
69 |
70 | # Contents of file: app/urls.py
71 |
72 | urlpatterns = [
73 | ...
74 | # Charts from Input
75 | path('charts-load' , views.charts_load, name='charts-load' ),
76 | ...
77 | ]
78 |
79 |
80 |
81 |
82 |
Render Flow
83 |
84 |
85 | The code that render this page use the information from SALES table.
86 |
87 | The model
89 | comes with a inner method that selects all rows: get_sales_report() .
90 |
91 | Once the SALES rows are selected, controller read the page template and inject the information.
92 |
93 |
94 | Source: app/views.py
95 | - charts_load() :
96 |
97 |
98 |
99 | # Partial content from file: app/views.py
100 | def charts_load(request):
101 | context = {'segment': 'charts_from_load'}
102 | html_template = loader.get_template('charts-from-load.html')
103 |
104 | # -----------------------------------------------
105 | # Extract data from Sale table
106 | # -----------------------------------------------
107 |
108 | sales, labels = Sale.get_sales_report()
109 | data = [
110 | {
111 | 'y': year,
112 | 'a': '{:.2f}'.format(sales[year].get('A')),
113 | 'b': '{:.2f}'.format(sales[year].get('B')),
114 | 'c': '{:.2f}'.format(sales[year].get('C'))
115 | } for year in sales
116 | ]
117 |
118 | context['chart_data'] = json.dumps({
119 | 'element': 'morris-bar-chart',
120 | 'data': data,
121 | 'xkey': 'y',
122 | 'barSizeRatio': 0.70,
123 | 'barGap': 3,
124 | 'resize': True,
125 | 'responsive': True,
126 | 'ykeys': ['a', 'b', 'c'], # it can be custom
127 | 'labels': labels,
128 | 'barColors': ['0-#1de9b6-#1dc4e9', '0-#899FD4-#A389D4', '#04a9f5'] # it can be custom
129 | })
130 |
131 | return HttpResponse(html_template.render(context, request))
132 |
133 |
134 |
135 |
136 |
Database Model - SALES
137 |
138 |
139 | The model
141 | comes with a inner method that selects all rows: get_sales_report() .
142 |
143 |
144 |
145 |
146 | class Sale(models.Model):
147 | amount = models.FloatField(_('amount'), db_index=True)
148 | product_name = models.CharField(_('product name'), max_length=40, db_index=True)
149 | created_time = models.DateTimeField(verbose_name=_('creation On'), db_index=True)
150 | updated_time = models.DateTimeField(verbose_name=_('modified On'), auto_now=True)
151 |
152 | class Meta:
153 | verbose_name = _('sale')
154 | verbose_name_plural = _('sales')
155 |
156 | @classmethod
157 | def get_sales_report(cls):
158 | annotates = {'total_amount': Sum('amount')}
159 |
160 | sales = cls.objects.annotate(
161 | year=TruncYear('created_time')
162 | ).values('product_name', 'year').order_by().annotate(**annotates)
163 |
164 | data = {}
165 | for sale in sales:
166 |
167 | if sale['year'].year not in data:
168 | data[sale['year'].year] = {}
169 |
170 | data[sale['year'].year][sale['product_name']] = sale['total_amount']
171 |
172 | labels = list(sales.values_list('product_name', flat=True).distinct())
173 | return data, labels
174 |
175 |
176 |
177 |
178 |
HTML File
179 |
180 |
181 | The chart data is rendered using Morris JS ,
182 | a popular open-source chart library.
183 |
184 | The source file
185 | core/templates/charts-from-load.html .
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 | {% endblock content %}
201 |
202 |
203 | {% block javascripts %}
204 |
205 |
206 |
207 |
210 | {% endblock javascripts %}
211 |
--------------------------------------------------------------------------------
/core/templates/charts-morris.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 |
3 | {% block title %} Charts Morris {% endblock %}
4 |
5 |
6 | {% block stylesheets %}
7 |
8 |
9 |
10 | {% endblock stylesheets %}
11 |
12 | {% block content %}
13 |
14 |
15 |
16 |
17 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
49 |
59 |
69 |
79 |
89 |
99 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | {% endblock content %}
119 |
120 |
121 | {% block javascripts %}
122 |
123 |
124 |
125 |
126 |
127 | {% endblock javascripts %}
128 |
--------------------------------------------------------------------------------
/core/templates/includes/navigation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
120 |
121 |
--------------------------------------------------------------------------------
/core/templates/includes/scripts.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/core/templates/layouts/base-fullscreen.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Django Dashboard Datta Able - {% block title %}{% endblock %} | AppSeed
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | {% block stylesheets %}{% endblock stylesheets %}
33 |
34 |
35 |
36 |
37 |
38 | {% block content %}{% endblock content %}
39 |
40 | {% include 'includes/scripts.html' %}
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/core/templates/layouts/base.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Django Dashboard Datta Able - {% block title %}{% endblock %} | AppSeed
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | {% block stylesheets %}{% endblock stylesheets %}
35 |
36 |
37 |
38 |
39 |
40 |
41 |
46 |
47 | {% include 'includes/navigation.html' %}
48 |
49 |
50 |
51 |
52 | {% block content %}{% endblock content %}
53 |
54 |
55 |
56 |
57 | {% include 'includes/scripts.html' %}
58 |
59 |
60 | {% block javascripts %}{% endblock javascripts %}
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/core/templates/maps-google.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 |
3 | {% block title %} Google Maps {% endblock %}
4 |
5 |
6 | {% block stylesheets %}{% endblock stylesheets %}
7 |
8 | {% block content %}
9 |
10 |
11 |
12 |
13 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
46 |
47 |
48 |
49 |
60 |
61 |
62 |
63 |
82 |
83 |
84 |
85 |
98 |
99 |
100 |
101 |
114 |
115 |
116 |
117 |
130 |
131 |
132 |
133 |
134 |
135 |
139 |
140 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 | {% endblock content %}
172 |
173 |
174 | {% block javascripts %}
175 |
176 |
177 |
178 |
179 |
180 |
181 | {% endblock javascripts %}
182 |
--------------------------------------------------------------------------------
/core/templates/page-403.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base-fullscreen.html" %}
2 |
3 | {% block title %} 403 Page {% endblock %}
4 |
5 | {% block content %}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Error 403
21 |
22 |
23 |
24 |
25 | Access denied - Please authenticate
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {% endblock content %}
34 |
--------------------------------------------------------------------------------
/core/templates/page-404.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base-fullscreen.html" %}
2 |
3 | {% block title %} 403 Page {% endblock %}
4 |
5 | {% block content %}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Error 404
21 |
22 |
23 |
24 |
25 | Page not found - Home
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {% endblock content %}
34 |
--------------------------------------------------------------------------------
/core/templates/page-500.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base-fullscreen.html" %}
2 |
3 | {% block title %} 403 Page {% endblock %}
4 |
5 | {% block content %}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Error 500
21 |
22 |
23 |
24 |
25 | Server Error - Home
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {% endblock content %}
34 |
--------------------------------------------------------------------------------
/core/templates/page-blank.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 |
3 | {% block title %} Page Blank {% endblock %}
4 |
5 |
6 | {% block stylesheets %}{% endblock stylesheets %}
7 |
8 | {% block content %}
9 |
10 |
11 |
12 |
13 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
39 |
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | {% endblock content %}
52 |
53 |
54 | {% block javascripts %}{% endblock javascripts %}
55 |
--------------------------------------------------------------------------------
/core/templates/ui-badges.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 |
3 | {% block title %} UI Badges {% endblock %}
4 |
5 |
6 | {% block stylesheets %}{% endblock stylesheets %}
7 |
8 | {% block content %}
9 |
10 |
11 |
12 |
13 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
40 |
41 |
Example heading New
42 | Example heading New
43 | Example heading New
44 | Example heading New
45 | Example heading New
46 | Example heading New
47 |
48 |
49 |
50 |
53 |
54 | primary 4
55 | secondary 4
56 | success 4
57 | danger 4
58 | warning 4
59 | info 4
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | {% endblock content %}
72 |
73 |
74 | {% block javascripts %}{% endblock javascripts %}
75 |
--------------------------------------------------------------------------------
/core/templates/ui-breadcrumb-pagination.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 |
3 | {% block title %} Ui BreadCrumb {% endblock %}
4 |
5 |
6 | {% block stylesheets %}{% endblock stylesheets %}
7 |
8 | {% block content %}
9 |
10 |
11 |
12 |
13 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
40 |
41 |
42 |
43 | Home
44 |
45 |
46 |
47 |
48 | Home
49 | Library
50 |
51 |
52 |
53 |
54 | Home
55 | Library
56 | Data
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | Library
77 |
78 |
79 |
80 |
81 |
82 | Library
83 | Data
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
94 |
95 |
96 |
103 |
104 |
Working With Icons
105 |
106 |
107 |
114 |
115 | Disabled and Active States
116 |
117 |
118 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | {% endblock content %}
139 |
140 |
141 | {% block javascripts %}{% endblock javascripts %}
142 |
--------------------------------------------------------------------------------
/core/templates/ui-collapse.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 |
3 | {% block title %} Ui Collapse {% endblock %}
4 |
5 |
6 | {% block stylesheets %}{% endblock stylesheets %}
7 |
8 | {% block content %}
9 |
10 |
11 |
12 |
13 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
Basic Collapse
37 |
38 |
39 |
43 |
44 |
45 |
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
46 |
47 |
48 |
49 |
50 |
51 |
Multiple Targets
52 |
53 |
Toggle first element
54 |
Toggle second element
55 |
Toggle both elements
56 |
57 |
58 |
59 |
60 |
61 |
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea
62 | proident.
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea
72 | proident.
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
Accordion Example
81 |
82 |
83 |
84 |
87 |
88 | Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum
89 | eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt
90 | sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore
91 | sustainable VHS.
92 |
93 |
94 |
95 |
98 |
99 | Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum
100 | eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt
101 | sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore
102 | sustainable VHS.
103 |
104 |
105 |
106 |
109 |
110 | Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum
111 | eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt
112 | sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore
113 | sustainable VHS.
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | {% endblock content %}
127 |
128 |
129 | {% block javascripts %}{% endblock javascripts %}
130 |
--------------------------------------------------------------------------------
/core/templates/ui-icons.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 |
3 | {% block title %} Feather Icons {% endblock %}
4 |
5 |
6 | {% block stylesheets %}{% endblock stylesheets %}
7 |
8 | {% block content %}
9 |
10 |
55 |
56 | {% endblock content %}
57 |
58 |
59 | {% block javascripts %}
60 |
61 |
109 |
110 | {% endblock javascripts %}
111 |
--------------------------------------------------------------------------------
/core/templates/ui-tables.html:
--------------------------------------------------------------------------------
1 | {% extends "layouts/base.html" %}
2 |
3 | {% block title %} UI Tables {% endblock %}
4 |
5 |
6 | {% block stylesheets %}{% endblock stylesheets %}
7 |
8 | {% block content %}
9 |
10 |
11 |
12 |
13 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
41 |
42 |
43 |
44 |
45 |
46 | #
47 | First Name
48 | Last Name
49 | Username
50 |
51 |
52 |
53 |
54 | 1
55 | Mark
56 | Otto
57 | @mdo
58 |
59 |
60 | 2
61 | Jacob
62 | Thornton
63 | @fat
64 |
65 |
66 | 3
67 | Larry
68 | the Bird
69 | @twitter
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
86 |
87 |
88 |
89 |
90 |
91 | #
92 | First Name
93 | Last Name
94 | Username
95 |
96 |
97 |
98 |
99 | 1
100 | Mark
101 | Otto
102 | @mdo
103 |
104 |
105 | 2
106 | Jacob
107 | Thornton
108 | @fat
109 |
110 |
111 | 3
112 | Larry
113 | the Bird
114 | @twitter
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
131 |
132 |
133 |
134 |
135 |
136 | #
137 | First Name
138 | Last Name
139 | Username
140 |
141 |
142 |
143 |
144 | 1
145 | Mark
146 | Otto
147 | @mdo
148 |
149 |
150 | 2
151 | Jacob
152 | Thornton
153 | @fat
154 |
155 |
156 | 3
157 | Larry
158 | the Bird
159 | @twitter
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 | {% endblock content %}
176 |
177 |
178 | {% block javascripts %}{% endblock javascripts %}
179 |
--------------------------------------------------------------------------------
/core/urls.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | from django.contrib import admin
7 | from django.urls import path, include # add this
8 |
9 | urlpatterns = [
10 | path('admin/', admin.site.urls), # Django admin route
11 | path('admin' , admin.site.urls), # Django admin route
12 | path("", include("authentication.urls")), # Auth routes - login / register
13 | path("", include("app.urls")) # UI Kits Html files
14 | ]
15 |
--------------------------------------------------------------------------------
/core/wsgi.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | import os
7 |
8 | from django.core.wsgi import get_wsgi_application
9 |
10 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
11 |
12 | application = get_wsgi_application()
13 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 | services:
3 | appseed-app:
4 | restart: always
5 | env_file: .env
6 | build: .
7 | ports:
8 | - "5005:5005"
9 | networks:
10 | - db_network
11 | - web_network
12 | nginx:
13 | restart: always
14 | image: "nginx:latest"
15 | ports:
16 | - "85:85"
17 | volumes:
18 | - ./nginx:/etc/nginx/conf.d
19 | networks:
20 | - web_network
21 | depends_on:
22 | - appseed-app
23 | networks:
24 | db_network:
25 | driver: bridge
26 | web_network:
27 | driver: bridge
28 |
--------------------------------------------------------------------------------
/gunicorn-cfg.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | bind = '0.0.0.0:5005'
7 | workers = 1
8 | accesslog = '-'
9 | loglevel = 'debug'
10 | capture_output = True
11 | enable_stdio_inheritance = True
12 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """
3 | Copyright (c) 2019 - present AppSeed.us
4 | """
5 |
6 | import os
7 | import sys
8 |
9 | def main():
10 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
11 | try:
12 | from django.core.management import execute_from_command_line
13 | except ImportError as exc:
14 | raise ImportError(
15 | "Couldn't import Django. Are you sure it's installed and "
16 | "available on your PYTHONPATH environment variable? Did you "
17 | "forget to activate a virtual environment?"
18 | ) from exc
19 | execute_from_command_line(sys.argv)
20 |
21 | if __name__ == '__main__':
22 | main()
23 |
--------------------------------------------------------------------------------
/media/admin_import.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/admin_import.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-card-low.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-card-low.jpg
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-card.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-card.jpg
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-content-image-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-content-image-low.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-content-image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-content-image.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-intro.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-intro.gif
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-1-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-1-low.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-1.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-2-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-2-low.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-2.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-3-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-3-low.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-3.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-4-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-4-low.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-4.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-login-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-login-low.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-login.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-low.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-register-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-register-low.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen-register.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen-register.png
--------------------------------------------------------------------------------
/media/boilerplate-code-django-dashboard-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/boilerplate-code-django-dashboard-screen.png
--------------------------------------------------------------------------------
/media/charts-fom-datasample.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/charts-fom-datasample.jpg
--------------------------------------------------------------------------------
/media/charts-fom-input.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/charts-fom-input.jpg
--------------------------------------------------------------------------------
/media/charts-fom-json.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/charts-fom-json.jpg
--------------------------------------------------------------------------------
/media/display.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/media/display.png
--------------------------------------------------------------------------------
/nginx/appseed-app.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 85;
3 |
4 | location / {
5 | proxy_pass http://localhost:5005/;
6 | proxy_set_header Host $host;
7 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
8 | }
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "boilerplate-code-django-dashboard",
3 | "mastertemplate": "boilerplate-code-django-dashboard",
4 | "version": "1.0.1",
5 | "description": "Template project - Django Boilerplate Code",
6 | "scripts": {
7 | },
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/app-generator/boilerplate-code-django-dashboard"
11 | },
12 | "bugs": {
13 | "url": "https://github.com/app-generator/boilerplate-code-django-dashboard/issues",
14 | "email": "support@appseed.us"
15 | },
16 | "author": "AppSeed App Generator
(https://appseed.us)",
17 | "engines": {
18 | "node": ">=10.0.0"
19 | },
20 | "dependencies": {
21 | },
22 | "devDependencies": {
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | asgiref
2 | autopep8
3 | django==2.2.10
4 | pycodestyle
5 | pytz
6 | sqlparse
7 | Unipath
8 | dj-database-url
9 | python-decouple
10 | gunicorn
11 | whitenoise
12 | django-import-export
13 |
--------------------------------------------------------------------------------
/runtime.txt:
--------------------------------------------------------------------------------
1 | python-3.6
2 |
--------------------------------------------------------------------------------
/sample_data/chart_morris.json:
--------------------------------------------------------------------------------
1 | {
2 | "element": "morris-bar-chart",
3 | "data": [
4 | { "y": "2017", "a": "150", "b": "90", "c": "80" },
5 | { "y": "2018", "a": "220", "b": "350", "c": "50" },
6 | { "y": "2019", "a": "80", "b": "300", "c": "240" },
7 | { "y": "2020", "a": "180", "b": "30", "c": "10" }
8 | ],
9 | "xkey": "y",
10 | "barSizeRatio": 0.70,
11 | "barGap": 3,
12 | "resize": true,
13 | "responsive": true,
14 | "ykeys": ["a", "b", "c"],
15 | "labels": ["Product A", "Product B", "Product C"],
16 | "barColors": ["0-#1de9b6-#1dc4e9", "0-#899FD4-#A389D4", "#04a9f5"]
17 | }
--------------------------------------------------------------------------------
/staticfiles/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/sample-django-charts-simple/0ea6906935600c121463b832df1d9ae0a99ab908/staticfiles/.gitkeep
--------------------------------------------------------------------------------