Skip to content

Commit fabb1eb

Browse files
committed
Code CleanUP (Minor)
1 parent 2447033 commit fabb1eb

File tree

12 files changed

+60
-107
lines changed

12 files changed

+60
-107
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ FLASK_ENV=development
55

66
ASSETS_ROOT=/static/assets
77

8-
#MONGO_DB=materialkit-flask
9-
#MONGO_HOST=mongodb://localhost:27017
8+
# MONGO_DB=materialkit-flask
9+
# MONGO_HOST=mongodb://localhost:27017

README.md

Lines changed: 9 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,32 @@
1-
# [Flask Material Kit](https://appseed.us/product/material-kit/flask/)
1+
# [Flask & Mongo](https://github.com/app-generator/sample-flask-mongo) `sample`
22

33
`Open-Source` seed project generated by AppSeed in **Flask** Framework on top of **[Material Kit](https://appseed.us/product/material-kit/flask/)** 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.
44

5-
- 👉 [Flask Material Kit](https://appseed.us/product/material-kit/flask/) - product page
6-
- 👉 [Flask Material Kit](https://flask-material-kit.appseed-srv1.com/) - LIVE App
7-
- ✅ Compatible with [LIVE Deployer](https://appseed.us/go-live/)
8-
- [Deploy Flask MKit with Drag & Drop](https://www.youtube.com/watch?v=I8G-0AO64Yo) - `video material`
5+
- 👉 [Flask Material Kit](https://flask-material-kit.appseed-srv1.com/) - `LIVE App`
6+
- 🚀 [Support](https://appseed.us/support/) - via `Email` & `Discord`
97

108
<br />
119

12-
> 🚀 Built with [App Generator](https://appseed.us/generator/), Timestamp: `2022-06-08 12:24`
10+
> Features:
1311
1412
-`Up-to-date dependencies`
15-
-Database: `sqlite`
16-
-`DB Tools`: SQLAlchemy ORM, Flask-Migrate (schema migrations)
13+
-Persistence: `Mongo`
14+
- ✅ DB Tools: `Flask-MongoEngine`
1715
- ✅ Session-Based authentication (via **flask_login**), Forms validation
18-
-`Docker`
1916

2017
<br />
2118

2219
![Material Kit - Starter generated by AppSeed.](https://user-images.githubusercontent.com/51070104/167396765-c88b7a95-155f-4236-8691-7b80fa2d9cd9.png)
2320

2421
<br />
2522

26-
## ✨ Start the app in Docker
27-
28-
> 👉 **Step 1** - Download the code from the GH repository (using `GIT`)
29-
30-
```bash
31-
$ git clone https://github.com/app-generator/flask-material-kit.git
32-
$ cd flask-material-kit
33-
```
34-
35-
<br />
36-
37-
> 👉 **Step 2** - Start the APP in `Docker`
38-
39-
```bash
40-
$ docker-compose up --build
41-
```
42-
43-
Visit `http://localhost:5085` in your browser. The app should be up & running.
44-
45-
<br />
46-
4723
## ✨ How to use it
4824

4925
> Download the code
5026
5127
```bash
52-
$ git clone https://github.com/app-generator/flask-material-kit.git
53-
$ cd flask-material-kit
28+
$ git clone https://github.com/app-generator/sample-flask-mongo.git
29+
$ cd sample-flask-mongo
5430
```
5531

5632
<br />
@@ -134,16 +110,6 @@ By default, the app redirects guest users to authenticate. In order to access th
134110

135111
<br />
136112

137-
## `Go LIVE` via [LIVE Deployer](https://appseed.us/go-live/)
138-
139-
> This video explains `how to deploy` the product LIVE using a `Drag & Drop` gesture.
140-
141-
<br />
142-
143-
https://user-images.githubusercontent.com/51070104/202416162-885c30d3-5066-40cb-abcd-1668689c9463.mp4
144-
145-
<br />
146-
147113
## ✨ Code-base structure
148114

149115
The project is coded using blueprints, app factory pattern, dual configuration profile (development and production) and an intuitive structure presented bellow:
@@ -197,21 +163,5 @@ The project is coded using blueprints, app factory pattern, dual configuration p
197163

198164
<br />
199165

200-
## PRO Version
201-
202-
> For more components, pages and priority on support, feel free to take a look at this amazing starter:
203-
204-
**Material Kit 2** is a premium design crafted by the `Creative-Tim` agency on top of Bootstrap 5 Framework. Designed for those who like bold elements and beautiful websites, Material Kit 2 is made of hundreds of elements, designed blocks, and fully coded pages built with an impressive level of quality.
205-
206-
- 👉 [Flask Material Kit2 PRO](https://appseed.us/product/material-kit2-pro/flask/) - product page
207-
-`Enhanced UI` - more pages and components
208-
-`Priority` on support
209-
210-
<br >
211-
212-
![Mk2 PRO - Premium Seed project by AppSeed.](https://user-images.githubusercontent.com/51070104/168224733-b054bb46-d454-4aea-bb94-2d01bf4760d2.png)
213-
214-
<br />
215-
216166
---
217-
[Flask Material Kit](https://appseed.us/product/material-kit/flask/) - Open-source starter generated by **[App Generator](https://appseed.us/generator/)**.
167+
[Flask & Mongo](https://github.com/app-generator/sample-flask-mongo) `sample` - Open-source starter generated by **[App Generator](https://appseed.us/generator/)**.

apps/__init__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from importlib import import_module
1010
from flask_mongoengine import MongoEngine,MongoEngineSessionInterface
1111

12-
1312
db = MongoEngine()
1413
login_manager = LoginManager()
1514

@@ -24,22 +23,9 @@ def register_blueprints(app):
2423
module = import_module('apps.{}.routes'.format(module_name))
2524
app.register_blueprint(module.blueprint)
2625

27-
28-
# def configure_database(app):
29-
30-
# @app.before_first_request
31-
# def initialize_database():
32-
# db.create_all()
33-
34-
# @app.teardown_request
35-
# def shutdown_session(exception=None):
36-
# db.session.remove()
37-
38-
3926
def create_app(config):
4027
app = Flask(__name__)
4128
app.config.from_object(config)
4229
register_extensions(app)
4330
register_blueprints(app)
44-
# configure_database(app)
4531
return app

apps/authentication/routes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ def login():
5656

5757
@blueprint.route('/register', methods=['GET', 'POST'])
5858
def register():
59+
5960
create_account_form = CreateAccountForm(request.form,instance=Users())
61+
6062
if 'register' in request.form:
6163

6264
username = request.form['username']
63-
email = request.form['email']
65+
email = request.form['email']
6466
password = request.form['password']
6567

6668
# Check usename exists
@@ -100,7 +102,6 @@ def logout():
100102
logout_user()
101103
return redirect(url_for('authentication_blueprint.login'))
102104

103-
104105
# Errors
105106

106107
@login_manager.unauthorized_handler

apps/templates/accounts/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
2121
<div class="bg-gradient-primary shadow-primary border-radius-lg py-3 pe-1">
2222
<h4 class="text-white font-weight-bolder text-center mt-2 mb-0">
23-
Flask Material Kit
23+
Flask & MongoDB
2424
</h4>
2525
<div class="row mt-3">
2626
<p class="mb-0 text-white text-center">

apps/templates/accounts/register.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
2121
<div class="bg-gradient-primary shadow-primary border-radius-lg py-3 pe-1">
2222
<h4 class="text-white font-weight-bolder text-center mt-2 mb-0">
23-
Flask Material Kit
23+
Flask & MongoDB
2424
</h4>
2525
<div class="row mt-3">
2626
<p class="mb-0 text-white text-center">

apps/templates/includes/footer-auth.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<div class="col-12 col-md-6">
1212
<ul class="nav nav-footer justify-content-center justify-content-lg-end">
1313
<li class="nav-item">
14-
<a href="https://github.com/app-generator/jinja-material-kit" class="nav-link text-white" target="_blank">Sources</a>
14+
<a href="https://github.com/app-generator/sample-flask-mongo" class="nav-link text-white" target="_blank">Sources</a>
1515
</li>
1616
<li class="nav-item">
17-
<a href="https://appseed.us/support" class="nav-link text-white" target="_blank">Support</a>
17+
<a href="https://appseed.us/support/" class="nav-link text-white" target="_blank">Support</a>
1818
</li>
1919
<li class="nav-item">
2020
<a href="https://appseed.us" class="nav-link text-white" target="_blank">AppSeed</a>

apps/templates/includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class=" row">
55
<div class="col-md-3 mb-4 ms-auto">
66
<div>
7-
<a href="https://appseed.us/apps/flask-apps/flask-material-kit">
7+
<a href="https://appseed.us/product/material-kit/flask/">
88
<img src="/static/assets/img/logo-ct-dark.png" class="mb-3 footer-logo" alt="main_logo">
99
</a>
1010
<h6 class="font-weight-bolder mb-4">Material Kit 2</h6>

apps/templates/includes/navigation-light.html

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,9 @@ <h6 class="dropdown-header text-dark font-weight-bolder d-flex justify-content-c
340340
</div>
341341
</ul>
342342
</li>
343-
<li class="nav-item ms-lg-auto">
344-
<a class="nav-link nav-link-icon me-2" href="https://appseed.us/apps/flask-apps/flask-material-kit" target="_blank">
345-
<i class="fa fa-download me-1"></i>
346-
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Get Sources">Download</p>
347-
</a>
348-
</li>
343+
349344
<li class="nav-item my-auto ms-3 ms-lg-0">
350-
<a href="https://appseed.us/product/flask-material-kit2-pro" target="_blank" class="btn btn-sm bg-gradient-primary mb-0 me-1 mt-2 mt-md-0">Upgrade to Pro</a>
345+
<a href="https://appseed.us/support/" target="_blank" class="btn btn-sm bg-gradient-primary mb-0 me-1 mt-2 mt-md-0">Support</a>
351346
</li>
352347

353348
{% if current_user.is_authenticated %}
@@ -357,7 +352,17 @@ <h6 class="dropdown-header text-dark font-weight-bolder d-flex justify-content-c
357352
<i class="fa fa-sign-out me-1"></i>
358353
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Sign OUT">Logout</p>
359354
</a>
360-
</li>
355+
</li>
356+
357+
{% else %}
358+
359+
<li class="nav-item ms-lg-auto">
360+
<a class="nav-link nav-link-icon me-2" href="https://github.com/app-generator/sample-flask-mongo" target="_blank">
361+
<i class="fa fa-download me-1"></i>
362+
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Get Sources">Download</p>
363+
</a>
364+
</li>
365+
361366
{% endif %}
362367

363368
</ul>

apps/templates/includes/navigation-transparent.html

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,24 +346,30 @@ <h6 class="dropdown-header text-dark font-weight-bolder d-flex justify-content-c
346346
</div>
347347
</ul>
348348
</li>
349-
<li class="nav-item ms-lg-auto">
350-
<a class="nav-link nav-link-icon me-2" href="https://appseed.us/apps/flask-apps/flask-material-kit" target="_blank">
351-
<i class="fa fa-download me-1"></i>
352-
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Get Sources">Download</p>
353-
</a>
354-
</li>
349+
355350
<li class="nav-item my-auto ms-3 ms-lg-0">
356-
<a href="https://appseed.us/product/flask-material-kit2-pro" target="_blank" class="btn btn-sm bg-white mb-0 me-1 mt-2 mt-md-0">Upgrade to Pro</a>
351+
<a href="https://appseed.us/support/" target="_blank" class="btn btn-sm bg-white mb-0 me-1 mt-2 mt-md-0">Support</a>
357352
</li>
358353

359354
{% if current_user.is_authenticated %}
355+
360356
<li class="nav-item ms-lg-auto">
361357
<a class="nav-link nav-link-icon me-2"
362358
href="{{ url_for('authentication_blueprint.logout') }}">
363359
<i class="fa fa-sign-out me-1"></i>
364360
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Sign OUT">Logout</p>
365361
</a>
366-
</li>
362+
</li>
363+
364+
{% else %}
365+
366+
<li class="nav-item ms-lg-auto">
367+
<a class="nav-link nav-link-icon me-2" href="https://github.com/app-generator/sample-flask-mongo" target="_blank">
368+
<i class="fa fa-download me-1"></i>
369+
<p class="d-inline text-sm z-index-1 font-weight-bold" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Get Sources">Download</p>
370+
</a>
371+
</li>
372+
367373
{% endif %}
368374

369375
</ul>

0 commit comments

Comments
 (0)