Skip to content

Commit 1651128

Browse files
author
App Generator
committed
Bump Codebase & UI - Pixel Lite v4.0.0
1 parent f68d9a5 commit 1651128

File tree

1,951 files changed

+69146
-4
lines changed

Some content is hidden

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

1,951 files changed

+69146
-4
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SECRET_KEY=S3cr3t_K#Key

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
flask/
2+
*.pyc
3+
dev
4+
node_modules
5+
app/database.db
6+
app/build
7+
yarn.lock
8+
yarn-error.log
9+
*.psd
10+
env/
11+
env__/
12+
.vscode/symbols.json
13+
app/db.sqlite3

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## [1.0.3] 2021-05-21
4+
### Improvements
5+
6+
- Bump UI: [Jinja Pixel Lite](https://github.com/app-generator/jinja-pixel-lite) v1.0.2 / Pixel Lite v4.0.0
7+
- Bump Codebase: [Flask Boilerplate](https://github.com/app-generator/boilerplate-code-flask) v1.0.5
8+
39
## [1.0.2] 2020-03-25
410
### Improvements
511

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM python:3.6
2+
3+
ENV FLASK_APP run.py
4+
5+
COPY run.py gunicorn-cfg.py requirements.txt .env ./
6+
COPY app app
7+
8+
RUN pip install -r requirements.txt
9+
10+
EXPOSE 5005
11+
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "run:app"]

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn run:app --log-file=-

app/__init__.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
import os
7+
8+
from flask import Flask
9+
from flask_sqlalchemy import SQLAlchemy
10+
from flask_login import LoginManager
11+
from flask_bcrypt import Bcrypt
12+
13+
# Grabs the folder where the script runs.
14+
basedir = os.path.abspath(os.path.dirname(__file__))
15+
16+
app = Flask(__name__)
17+
18+
app.config.from_object('app.config.Config')
19+
20+
db = SQLAlchemy (app) # flask-sqlalchemy
21+
bc = Bcrypt (app) # flask-bcrypt
22+
23+
lm = LoginManager( ) # flask-loginmanager
24+
lm.init_app(app) # init the login manager
25+
26+
# Setup database
27+
@app.before_first_request
28+
def initialize_database():
29+
db.create_all()
30+
31+
# Import routing, models and Start the App
32+
from app import views, models

app/config.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
import os
7+
from decouple import config
8+
9+
# Grabs the folder where the script runs.
10+
basedir = os.path.abspath(os.path.dirname(__file__))
11+
12+
class Config():
13+
14+
CSRF_ENABLED = True
15+
16+
# Set up the App SECRET_KEY
17+
SECRET_KEY = config('SECRET_KEY', default='S#perS3crEt_007')
18+
19+
# This will create a file in <app> FOLDER
20+
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'db.sqlite3')
21+
SQLALCHEMY_TRACK_MODIFICATIONS = False

app/forms.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from flask_wtf import FlaskForm
7+
from flask_wtf.file import FileField, FileRequired
8+
from wtforms import StringField, TextAreaField, SubmitField, PasswordField
9+
from wtforms.validators import InputRequired, Email, DataRequired
10+
11+
class LoginForm(FlaskForm):
12+
username = StringField (u'Username' , validators=[DataRequired()])
13+
password = PasswordField(u'Password' , validators=[DataRequired()])
14+
15+
class RegisterForm(FlaskForm):
16+
name = StringField (u'Name' )
17+
username = StringField (u'Username' , validators=[DataRequired()])
18+
password = PasswordField(u'Password' , validators=[DataRequired()])
19+
email = StringField (u'Email' , validators=[DataRequired(), Email()])

app/models.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -*- encoding: utf-8 -*-
2+
"""
3+
Copyright (c) 2019 - present AppSeed.us
4+
"""
5+
6+
from app import db
7+
from flask_login import UserMixin
8+
9+
class User(UserMixin, db.Model):
10+
11+
id = db.Column(db.Integer, primary_key=True)
12+
user = db.Column(db.String(64), unique = True)
13+
email = db.Column(db.String(120), unique = True)
14+
password = db.Column(db.String(500))
15+
16+
def __init__(self, user, email, password):
17+
self.user = user
18+
self.password = password
19+
self.email = email
20+
21+
def __repr__(self):
22+
return str(self.id) + ' - ' + str(self.user)
23+
24+
def save(self):
25+
26+
# inject self into db session
27+
db.session.add ( self )
28+
29+
# commit change and save the object
30+
db.session.commit( )
31+
32+
return self

0 commit comments

Comments
 (0)