Skip to content

Commit 36d5363

Browse files
committed
Bump UI / Added CDN Support
1 parent 9b4f7f6 commit 36d5363

File tree

337 files changed

+52188
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+52188
-0
lines changed

.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# True for development, False for production
2+
DEBUG=True
3+
4+
# Deployment SERVER address
5+
SERVER=.appseed.us
6+
7+
ASSETS_ROOT=/static/assets

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# tests and coverage
6+
*.pytest_cache
7+
.coverage
8+
9+
# database & logs
10+
*.db
11+
*.sqlite3
12+
*.log
13+
14+
# venv
15+
env
16+
venv
17+
18+
# other
19+
.DS_Store
20+
21+
# javascript
22+
package-lock.json
23+
24+
staticfiles/*
25+
!staticfiles/.gitkeep
26+
.vscode/symbols.json
27+
28+
apps/static/assets/node_modules
29+
apps/static/assets/yarn.lock
30+
apps/static/assets/.temp
31+

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM python:3.9
2+
3+
COPY . .
4+
5+
# set environment variables
6+
ENV PYTHONDONTWRITEBYTECODE 1
7+
ENV PYTHONUNBUFFERED 1
8+
9+
# install python dependencies
10+
RUN pip install --upgrade pip
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# running migrations
14+
RUN python manage.py migrate
15+
16+
# gunicorn
17+
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]
18+

LICENSE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# MIT License
2+
3+
Copyright (c) 2019 - present [AppSeed](http://appseed.us/)
4+
5+
<br />
6+
7+
## Licensing Information
8+
9+
<br />
10+
11+
| Item | - |
12+
| ---------------------------------- | --- |
13+
| License Type | MIT |
14+
| Use for print | **YES** |
15+
| Create single personal website/app | **YES** |
16+
| Create single website/app for client | **YES** |
17+
| Create multiple website/apps for clients | **YES** |
18+
| Create multiple SaaS applications | **YES** |
19+
| End-product paying users | **YES** |
20+
| Product sale | **YES** |
21+
| Remove footer credits | **YES** |
22+
| --- | --- |
23+
| Remove copyright mentions from source code | NO |
24+
| Production deployment assistance | NO |
25+
| Create HTML/CSS template for sale | NO |
26+
| Create Theme/Template for CMS for sale | NO |
27+
| Separate sale of our UI Elements | NO |
28+
29+
<br />
30+
31+
---
32+
For more information regarding licensing, please contact the AppSeed Service < *support@appseed.us* >

apps/__init__.py

Whitespace-only changes.

apps/authentication/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""

apps/authentication/admin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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.

apps/authentication/config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from django.apps import AppConfig
7+
8+
9+
class AuthConfig(AppConfig):
10+
name = 'apps.auth'
11+
label = 'apps_auth'

apps/authentication/forms.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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+
11+
class LoginForm(forms.Form):
12+
username = forms.CharField(
13+
widget=forms.TextInput(
14+
attrs={
15+
"placeholder": "Username",
16+
"class": "form-control"
17+
}
18+
))
19+
password = forms.CharField(
20+
widget=forms.PasswordInput(
21+
attrs={
22+
"placeholder": "Password",
23+
"class": "form-control"
24+
}
25+
))
26+
27+
28+
class SignUpForm(UserCreationForm):
29+
username = forms.CharField(
30+
widget=forms.TextInput(
31+
attrs={
32+
"placeholder": "Username",
33+
"class": "form-control"
34+
}
35+
))
36+
email = forms.EmailField(
37+
widget=forms.EmailInput(
38+
attrs={
39+
"placeholder": "Email",
40+
"class": "form-control"
41+
}
42+
))
43+
password1 = forms.CharField(
44+
widget=forms.PasswordInput(
45+
attrs={
46+
"placeholder": "Password",
47+
"class": "form-control"
48+
}
49+
))
50+
password2 = forms.CharField(
51+
widget=forms.PasswordInput(
52+
attrs={
53+
"placeholder": "Password check",
54+
"class": "form-control"
55+
}
56+
))
57+
58+
class Meta:
59+
model = User
60+
fields = ('username', 'email', 'password1', 'password2')
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""

apps/authentication/models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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.

apps/authentication/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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.

apps/authentication/urls.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
]

apps/authentication/views.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
# Create your views here.
7+
from django.shortcuts import render, redirect
8+
from django.contrib.auth import authenticate, login
9+
from .forms import LoginForm, SignUpForm
10+
11+
12+
def login_view(request):
13+
form = LoginForm(request.POST or None)
14+
15+
msg = None
16+
17+
if request.method == "POST":
18+
19+
if form.is_valid():
20+
username = form.cleaned_data.get("username")
21+
password = form.cleaned_data.get("password")
22+
user = authenticate(username=username, password=password)
23+
if user is not None:
24+
login(request, user)
25+
return redirect("/")
26+
else:
27+
msg = 'Invalid credentials'
28+
else:
29+
msg = 'Error validating the form'
30+
31+
return render(request, "accounts/login.html", {"form": form, "msg": msg})
32+
33+
34+
def register_user(request):
35+
msg = None
36+
success = False
37+
38+
if request.method == "POST":
39+
form = SignUpForm(request.POST)
40+
if form.is_valid():
41+
form.save()
42+
username = form.cleaned_data.get("username")
43+
raw_password = form.cleaned_data.get("password1")
44+
user = authenticate(username=username, password=raw_password)
45+
46+
msg = 'User created - please <a href="/login">login</a>.'
47+
success = True
48+
49+
# return redirect("/login/")
50+
51+
else:
52+
msg = 'Form is not valid'
53+
else:
54+
form = SignUpForm()
55+
56+
return render(request, "accounts/register.html", {"form": form, "msg": msg, "success": success})

apps/config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AppsConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'apps'
7+
label = 'apps'

apps/context_processors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.conf import settings
2+
3+
def cfg_assets_root(request):
4+
5+
return { 'ASSETS_ROOT' : settings.ASSETS_ROOT }
6+

apps/home/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""

apps/home/admin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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.

apps/home/config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from django.apps import AppConfig
7+
8+
9+
class MyConfig(AppConfig):
10+
name = 'apps.home'
11+
label = 'apps_home'

apps/home/migrations/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""

apps/home/models.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from django.db import models
7+
from django.contrib.auth.models import User
8+
9+
# Create your models here.
10+

apps/home/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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.

apps/home/urls.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from django.urls import path, re_path
7+
from apps.home import views
8+
9+
urlpatterns = [
10+
11+
# The home page
12+
path('', views.index, name='home'),
13+
14+
# Matches any html file
15+
re_path(r'^.*\.*', views.pages, name='pages'),
16+
17+
]

0 commit comments

Comments
 (0)