Skip to content

Commit

Permalink
Bump Codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
App Generator committed Feb 10, 2021
1 parent 8fededb commit d8b8911
Show file tree
Hide file tree
Showing 59 changed files with 79 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DEBUG=True
SECRET_KEY=S3cr3t_K#Key
SERVER=black-dashboard-django.creative-tim.com
SERVER=boilerplate-code-django-dashboard.appseed.us
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ package-lock.json

staticfiles/*
!staticfiles/.gitkeep
.vscode/symbols.json
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM python:3.6

ENV FLASK_APP run.py

COPY manage.py gunicorn-cfg.py requirements.txt .env ./
COPY app app
COPY authentication authentication
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 - present Creative-Tim / AppSeed.us
Copyright (c) 2019 - present Creative-Tim / [AppSeed.us](https://appseed.us)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
1 change: 0 additions & 1 deletion app/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
1 change: 0 additions & 1 deletion app/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
1 change: 0 additions & 1 deletion app/migrations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
1 change: 0 additions & 1 deletion app/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
1 change: 0 additions & 1 deletion app/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
7 changes: 4 additions & 3 deletions app/urls.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

from django.urls import path, re_path
from app import views

urlpatterns = [
# Matches any html file
re_path(r'^.*\.html', views.pages, name='pages'),

# The home page
path('', views.index, name='home'),

# Matches any html file
re_path(r'^.*\.*', views.pages, name='pages'),

]
16 changes: 11 additions & 5 deletions app/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand All @@ -12,7 +11,12 @@

@login_required(login_url="/login/")
def index(request):
return render(request, "index.html")

context = {}
context['segment'] = 'index'

html_template = loader.get_template( 'index.html' )
return HttpResponse(html_template.render(context, request))

@login_required(login_url="/login/")
def pages(request):
Expand All @@ -21,16 +25,18 @@ def pages(request):
# Pick out the html file name from the url. And load that template.
try:

load_template = request.path.split('/')[-1]
load_template = request.path.split('/')[-1]
context['segment'] = load_template

html_template = loader.get_template( load_template )
return HttpResponse(html_template.render(context, request))

except template.TemplateDoesNotExist:

html_template = loader.get_template( 'error-404.html' )
html_template = loader.get_template( 'page-404.html' )
return HttpResponse(html_template.render(context, request))

except:

html_template = loader.get_template( 'error-500.html' )
html_template = loader.get_template( 'page-500.html' )
return HttpResponse(html_template.render(context, request))
4 changes: 4 additions & 0 deletions authentication/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
1 change: 0 additions & 1 deletion authentication/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
1 change: 0 additions & 1 deletion authentication/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
9 changes: 3 additions & 6 deletions authentication/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand All @@ -13,16 +12,14 @@ class LoginForm(forms.Form):
widget=forms.TextInput(
attrs={
"placeholder" : "Username",
"value" : "test",
"class" : "form-control"
"class": "form-control"
}
))
password = forms.CharField(
widget=forms.PasswordInput(
attrs={
"placeholder" : "Password",
"value" : "ApS12_ZZs8",
"class" : "form-control"
"placeholder" : "Password",
"class": "form-control"
}
))

Expand Down
4 changes: 4 additions & 0 deletions authentication/migrations/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
1 change: 0 additions & 1 deletion authentication/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
1 change: 0 additions & 1 deletion authentication/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
1 change: 0 additions & 1 deletion authentication/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
3 changes: 1 addition & 2 deletions authentication/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down Expand Up @@ -48,7 +47,7 @@ def register_user(request):
raw_password = form.cleaned_data.get("password1")
user = authenticate(username=username, password=raw_password)

msg = 'User created.'
msg = 'User created - please <a href="/login">login</a>.'
success = True

#return redirect("/login/")
Expand Down
4 changes: 4 additions & 0 deletions core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
1 change: 0 additions & 1 deletion core/asgi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand Down
19 changes: 8 additions & 11 deletions core/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""

Expand All @@ -10,14 +9,14 @@
import dj_database_url

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_DIR = Path(__file__).parent
BASE_DIR = Path(__file__).parent
CORE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config('SECRET_KEY', default='S#perS3crEt_1122')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config('DEBUG', default=False)
DEBUG = config('DEBUG', default=True, cast=bool)

# load production server from .env
ALLOWED_HOSTS = ['localhost', '127.0.0.1', config('SERVER', default='127.0.0.1')]
Expand All @@ -36,19 +35,19 @@

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
]

ROOT_URLCONF = 'core.urls'
LOGIN_REDIRECT_URL = "home" # Route defined in app/urls.py
LOGOUT_REDIRECT_URL = "home" # Route defined in app/urls.py
TEMPLATE_DIR = os.path.join(BASE_DIR, "core/templates") # ROOT dir for templates
TEMPLATE_DIR = os.path.join(CORE_DIR, "core/templates") # ROOT dir for templates

TEMPLATES = [
{
Expand All @@ -74,7 +73,7 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'NAME' : 'db.sqlite3',
}
}

Expand Down Expand Up @@ -113,16 +112,14 @@
#############################################################
# SRC: https://devcenter.heroku.com/articles/django-assets

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_ROOT = os.path.join(CORE_DIR, 'staticfiles')
STATIC_URL = '/static/'

# Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'core/static'),
os.path.join(CORE_DIR, 'core/static'),
)
#############################################################
#############################################################
Empty file added core/staticfiles/.gitkeep
Empty file.
8 changes: 2 additions & 6 deletions core/templates/accounts/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@ <h5 class="title">Login</h5>

<h6 class="card-category">
{% if msg %}
<span class="text-danger">{{ msg }}</span>
<span class="text-danger">{{ msg | safe }}</span>
{% else %}

Use default credentials: test / ApS12_ZZs8
<br />
OR <a href={% url 'register' %} >create your own user</a>

Add your credentials
{% endif %}
</h6>
</div>
Expand Down
4 changes: 2 additions & 2 deletions core/templates/accounts/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ <h5 class="title">Register</h5>

<h6 class="card-category">
{% if msg %}
<span class="text-danger">{{ msg }}</span>
<span class="text-danger">{{ msg | safe }}</span>
{% else %}
Add your credentials or <a href={% url 'login' %} >authenticate</a> with an existing account.
Add your credentials
{% endif %}
</h6>
</div>
Expand Down
16 changes: 8 additions & 8 deletions core/templates/includes/sidebar-rtl.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,49 @@

{% if user.is_authenticated %}
<ul class="nav">
<li class="active ">
<li class="{% if 'index' in segment %} active {% endif %} ">
<a href="/">
<i class="tim-icons icon-chart-pie-36"></i>
<p>لوحة القيادة</p>
</a>
</li>
<li>
<li class="{% if 'icons' in segment %} active {% endif %}">
<a href="/ui-icons.html">
<i class="tim-icons icon-atom"></i>
<p>الرموز</p>
</a>
</li>
<li>
<li class="{% if 'maps' in segment %} active {% endif %}">
<a href="/ui-maps.html">
<i class="tim-icons icon-pin"></i>
<p>خرائط</p>
</a>
</li>
<li>
<li class="{% if 'notifications' in segment %} active {% endif %}">
<a href="/ui-notifications.html">
<i class="tim-icons icon-bell-55"></i>
<p>إخطارات</p>
</a>
</li>
<li>
<li class="{% if 'page-user' in segment %} active {% endif %}">
<a href="/page-user.html">
<i class="tim-icons icon-single-02"></i>
<p>ملف تعريفي للمستخدم</p>
</a>
</li>
<li>
<li class="{% if 'tables' in segment %} active {% endif %}">
<a href="/ui-tables.html">
<i class="tim-icons icon-puzzle-10"></i>
<p>قائمة الجدول</p>
</a>
</li>
<li>
<li class="{% if 'typography' in segment %} active {% endif %}">
<a href="/ui-typography.html">
<i class="tim-icons icon-align-center"></i>
<p>طباعة</p>
</a>
</li>
<li>
<li class="{% if 'rtl-support' in segment %} active {% endif %}">
<a href="/page-rtl-support.html">
<i class="tim-icons icon-world"></i>
<p>دعم RTL</p>
Expand Down
Loading

0 comments on commit d8b8911

Please sign in to comment.