Skip to content

Commit ee44fc4

Browse files
committed
Initial commit
0 parents  commit ee44fc4

File tree

360 files changed

+58394
-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.

360 files changed

+58394
-0
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DEBUG=True
2+
SECRET_KEY=S3cr3t_K#Key
3+
SERVER=boilerplate-code-django.appseed.us

.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+
env__
17+
venv
18+
19+
# other
20+
.DS_Store
21+
22+
# javascript
23+
package-lock.json
24+
25+
staticfiles/*
26+
!staticfiles/.gitkeep
27+
.vscode/symbols.json
28+
29+
apps/static/assets/node_modules
30+
apps/static/assets/yarn.lock
31+
apps/static/assets/.temp

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Change Log
2+
3+
## [1.0.2] 2021-01-19
4+
### Improvements
5+
6+
- Migrate all UI kit pages to Jinja
7+
8+
## [1.0.1] 2022-01-17
9+
### Improvements
10+
11+
- Bump Django Codebase to [v2.0.0](https://github.com/app-generator/boilerplate-code-django/releases)
12+
- Dependencies update (all packages)
13+
- Django==4.0.1
14+
- Settings update for Django 4.x
15+
- `New Parameter`: CSRF_TRUSTED_ORIGINS
16+
- [Origin header checking isn`t performed in older versions](https://docs.djangoproject.com/en/4.0/ref/settings/#csrf-trusted-origins)
17+
18+
## [1.0.0] 2021-10-30
19+
### Initial Release
20+
21+
- Bump UI: Material Kit v3.0.0
22+
- Update Bootstrap to v5.1.1
23+
- Update to Material Design 2
24+
- Codebase: [Django Boilerplate](https://github.com/app-generator/boilerplate-code-django) v1.0.6
25+
- Dependencies update (all packages)
26+
- Django==3.2.6 (latest stable version)
27+
- Codebase:
28+
- Better Code formatting
29+
- Improved Files organization
30+
- Optimize imports
31+
- Docker Scripts Update
32+
- Tooling: Added Gulp SCSS compilation scripts

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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
| Create HTML/CSS template for sale | NO |
25+
| Create Theme/Template for CMS for sale | NO |
26+
| Separate sale of our UI Elements | NO |
27+
28+
<br />
29+
30+
---
31+
For more information regarding licensing, please contact the AppSeed Service < *support@appseed.us* >

README.md

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
# [Django Material Kit](https://appseed.us/product/material-kit/django/)
2+
3+
`Open-Source` seed project generated by AppSeed in **[Django](https://appseed.us/admin-dashboards/django)** Framework on top of **[Material Kit](https://appseed.us/product/material-kit/django/)** design. Designed for those who like bold elements and beautiful websites, **Material Kit 2** is ready to help you create stunning websites and web apps. `Material Kit 2` is built with over 60 frontend individual elements, like buttons, inputs, navbars, nav tabs, cards, or alerts, giving you the freedom of choosing and combining.
4+
5+
<br />
6+
7+
> Features
8+
9+
- `Up-to-date dependencies`
10+
- [SCSS compilation](#recompile-css) via **Gulp**
11+
- UI Kit: **Material Dashboard - v3.0.0** (Bootstrap 5 Version) by **Creative-Tim**
12+
- Modular design, clean codebase
13+
- `Session-Based Authentication`, Forms validation
14+
- `Deployment`: **Docker**, Gunicorn / Nginx
15+
- Support via **Github** and [Discord](https://discord.gg/fZC6hup).
16+
17+
<br />
18+
19+
> Links
20+
21+
- 👉 [Django Material Kit](https://appseed.us/product/material-kit/django/) - Product page
22+
- 👉 [Django Material Kit](https://django-material-kit.appseed-srv1.com/) - LIVE Demo
23+
- 👉 More [Django Apps](https://appseed.us/django) - provided by AppSeed
24+
25+
<br />
26+
27+
## ✨ Quick Start in `Docker`
28+
29+
> Get the code
30+
31+
```bash
32+
$ git clone https://github.com/app-generator/django-material-kit.git
33+
$ cd django-material-kit
34+
```
35+
36+
> Start the app in Docker
37+
38+
```bash
39+
$ docker-compose up --build
40+
```
41+
42+
Visit `http://localhost:85` in your browser. The app should be up & running.
43+
44+
<br />
45+
46+
![Django Material Kit 2 - Starter provided by AppSeed.](https://user-images.githubusercontent.com/51070104/139474054-a223e8e0-d441-4f9f-8237-627a77bdd49c.gif)
47+
48+
<br />
49+
50+
## ✨ How to use it
51+
52+
```bash
53+
$ # Get the code
54+
$ git clone https://github.com/app-generator/django-material-kit.git
55+
$ cd django-material-kit
56+
$
57+
$ # Virtualenv modules installation (Unix based systems)
58+
$ virtualenv env
59+
$ source env/bin/activate
60+
$
61+
$ # Virtualenv modules installation (Windows based systems)
62+
$ # virtualenv env
63+
$ # .\env\Scripts\activate
64+
$
65+
$ # Install modules - SQLite Storage
66+
$ pip3 install -r requirements.txt
67+
$
68+
$ # Create tables
69+
$ python manage.py makemigrations
70+
$ python manage.py migrate
71+
$
72+
$ # Start the application (development mode)
73+
$ python manage.py runserver # default port 8000
74+
$
75+
$ # Start the app - custom port
76+
$ # python manage.py runserver 0.0.0.0:<your_port>
77+
$
78+
$ # Access the web app in browser: http://127.0.0.1:8000/
79+
```
80+
81+
> Note: To use the app, please access the registration page and create a new user. After authentication, the app will unlock the private pages.
82+
83+
<br />
84+
85+
## ✨ Code-base structure
86+
87+
The project is coded using a simple and intuitive structure presented bellow:
88+
89+
```bash
90+
< PROJECT ROOT >
91+
|
92+
|-- core/ # Implements app configuration
93+
| |-- settings.py # Defines Global Settings
94+
| |-- wsgi.py # Start the app in production
95+
| |-- urls.py # Define URLs served by all apps/nodes
96+
|
97+
|-- apps/
98+
| |
99+
| |-- home/ # A simple app that serve HTML files
100+
| | |-- views.py # Serve HTML pages for authenticated users
101+
| | |-- urls.py # Define some super simple routes
102+
| |
103+
| |-- authentication/ # Handles auth routes (login and register)
104+
| | |-- urls.py # Define authentication routes
105+
| | |-- views.py # Handles login and registration
106+
| | |-- forms.py # Define auth forms (login and register)
107+
| |
108+
| |-- static/
109+
| | |-- <css, JS, images> # CSS files, Javascripts files
110+
| |
111+
| |-- templates/ # Templates used to render pages
112+
| |-- includes/ # HTML chunks and components
113+
| | |-- navigation.html # Top menu component
114+
| | |-- sidebar.html # Sidebar component
115+
| | |-- footer.html # App Footer
116+
| | |-- scripts.html # Scripts common to all pages
117+
| |
118+
| |-- layouts/ # Master pages
119+
| | |-- base-fullscreen.html # Used by Authentication pages
120+
| | |-- base.html # Used by common pages
121+
| |
122+
| |-- accounts/ # Authentication pages
123+
| | |-- login.html # Login page
124+
| | |-- register.html # Register page
125+
| |
126+
| |-- home/ # UI Kit Pages
127+
| |-- index.html # Index page
128+
| |-- 404-page.html # 404 page
129+
| |-- *.html # All other pages
130+
|
131+
|-- requirements.txt # Development modules - SQLite storage
132+
|
133+
|-- .env # Inject Configuration via Environment
134+
|-- manage.py # Start the app - Django default start script
135+
|
136+
|-- ************************************************************************
137+
```
138+
139+
<br />
140+
141+
> The bootstrap flow
142+
143+
- Django bootstrapper `manage.py` uses `core/settings.py` as the main configuration file
144+
- `core/settings.py` loads the app magic from `.env` file
145+
- Redirect the guest users to Login page
146+
- Unlock the pages served by *app* node for authenticated users
147+
148+
<br />
149+
150+
## ✨ Recompile CSS
151+
152+
To recompile SCSS files, follow this setup:
153+
154+
<br />
155+
156+
**Step #1** - Install tools
157+
158+
- [NodeJS](https://nodejs.org/en/) 12.x or higher
159+
- [Gulp](https://gulpjs.com/) - globally
160+
- `npm install -g gulp-cli`
161+
- [Yarn](https://yarnpkg.com/) (optional)
162+
163+
<br />
164+
165+
**Step #2** - Change the working directory to `assets` folder
166+
167+
```bash
168+
$ cd apps/static/assets
169+
```
170+
171+
<br />
172+
173+
**Step #3** - Install modules (this will create a classic `node_modules` directory)
174+
175+
```bash
176+
$ npm install
177+
// OR
178+
$ yarn
179+
```
180+
181+
<br />
182+
183+
**Step #4** - Edit & Recompile SCSS files
184+
185+
```bash
186+
$ gulp scss
187+
```
188+
189+
The generated file is saved in `static/assets/css` directory.
190+
191+
<br />
192+
193+
## ✨ Deployment
194+
195+
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/).
196+
197+
### [Gunicorn](https://gunicorn.org/)
198+
---
199+
200+
Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX.
201+
202+
> Install using pip
203+
204+
```bash
205+
$ pip install gunicorn
206+
```
207+
> Start the app using gunicorn binary
208+
209+
```bash
210+
$ gunicorn --bind=0.0.0.0:8001 core.wsgi:application
211+
Serving on http://localhost:8001
212+
```
213+
214+
Visit `http://localhost:8001` in your browser. The app should be up & running.
215+
216+
217+
<br />
218+
219+
### [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/)
220+
---
221+
222+
Waitress (Gunicorn equivalent for Windows) is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones that live in the Python standard library.
223+
224+
> Install using pip
225+
226+
```bash
227+
$ pip install waitress
228+
```
229+
> Start the app using [waitress-serve](https://docs.pylonsproject.org/projects/waitress/en/stable/runner.html)
230+
231+
```bash
232+
$ waitress-serve --port=8001 core.wsgi:application
233+
Serving on http://localhost:8001
234+
```
235+
236+
Visit `http://localhost:8001` in your browser. The app should be up & running.
237+
238+
<br />
239+
240+
## ✨ Credits & Links
241+
242+
- [Django](https://www.djangoproject.com/) - The official website
243+
- [Boilerplate Code](https://appseed.us/boilerplate-code) - Index provided by **AppSeed**
244+
- [Boilerplate Code](https://github.com/app-generator/boilerplate-code) - Index published on Github
245+
246+
<br />
247+
248+
---
249+
[Django Material Kit](https://appseed.us/product/material-kit/django/) - Provided by **AppSeed** [App Generator](https://appseed.us/generator).

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'

0 commit comments

Comments
 (0)