-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1cc443b
Showing
45 changed files
with
13,561 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
### Python ### | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
pytestdebug.log | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
doc/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
pythonenv* | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# profiling data | ||
.prof | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
*.code-workspace | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
.ionide | ||
|
||
### Windows ### | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
# specific files and folders I don't want uploaded | ||
c_buildr/.gcloudignore | ||
c_buildr/config.py | ||
c_buildr/main.py | ||
cloudbuild.yaml | ||
c_buildr/emails.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
runtime: python38 | ||
|
||
handlers: | ||
# This configures Google App Engine to serve the files in the app's static | ||
# directory. | ||
- url: /static | ||
static_dir: c_buildr/static/ | ||
|
||
# This handler routes all requests not caught above to your main app. It is | ||
# required when static routes are defined, but can be omitted (along with | ||
# the entire handlers section) when there are no static files defined. | ||
- url: /.* | ||
script: auto | ||
secure: always | ||
redirect_http_response_code: 301 | ||
|
||
# warmup requests to reduce latency | ||
inbound_services: | ||
- warmup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FLASK_APP=main | ||
FLASK_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Flask Template Ecommerce site | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from flask import Flask | ||
|
||
from .config import ( | ||
CLOUD_SQL_CONNECTION_NAME, | ||
CLOUD_SQL_DATABASE_NAME, | ||
CLOUD_SQL_PASSWORD, | ||
CLOUD_SQL_USERNAME, | ||
SQLALCHEMY_DATABASE_URI, | ||
) | ||
|
||
# import flask_login | ||
from flask_login import LoginManager | ||
# from werkzeug.security import generate_password_hash, check_password_hash | ||
from flask_cors import CORS | ||
from flask_sqlalchemy import SQLAlchemy | ||
from flask_migrate import Migrate | ||
|
||
# app.config["SECRET_KEY"] = SECRET_KEY | ||
app = Flask(__name__) | ||
CORS(app) | ||
# Enter your database connection details below | ||
# app.config['MYSQL_HOST'] = CLOUD_SQL_HOST | ||
app.config["MYSQL_USER"] = CLOUD_SQL_USERNAME | ||
app.config["MYSQL_PASSWORD"] = CLOUD_SQL_PASSWORD | ||
app.config["MYSQL_DB"] = CLOUD_SQL_DATABASE_NAME | ||
app.config["MYSQL_CONNECTION_NAME"] = CLOUD_SQL_CONNECTION_NAME | ||
app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI | ||
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False | ||
|
||
db = SQLAlchemy(app) | ||
|
||
# db migrations | ||
# db.init_app(app) | ||
migrate = Migrate(app,db) | ||
|
||
# db = sqlalchemy.create_engine(SQLALCHEMY_DATABASE_URI) | ||
login_manager = LoginManager() | ||
login_manager.init_app(app) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import os | ||
from dotenv import load_dotenv | ||
|
||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
load_dotenv(os.path.join(basedir, ".flaskenv")) | ||
|
||
# Uncomment line below for a new 16 character secret key everytime you launch your web app | ||
# SECRET_KEY = ''.join(random.choices(string.ascii_letters + string.digits,k=16)) | ||
|
||
SECRET_KEY = "ANY RANDOM LETTERS YOU CHOOSE TO USE" | ||
# print(SECRET_KEY) | ||
|
||
# DB details based on Google Cloud MySQL Auth Proxy Setup | ||
CLOUD_SQL_USERNAME = "" | ||
CLOUD_SQL_PASSWORD = "" | ||
CLOUD_SQL_DATABASE_NAME = "" | ||
CLOUD_SQL_CONNECTION_NAME = "" | ||
|
||
# when deploying, be sure to change .flaskenv variable 'FLASK_ENV' to 'production' | ||
if os.environ.get("FLASK_ENV") == "production": | ||
SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{CLOUD_SQL_USERNAME}:{CLOUD_SQL_PASSWORD}@/{CLOUD_SQL_DATABASE_NAME}?unix_socket=/cloudsql/{CLOUD_SQL_CONNECTION_NAME}" | ||
else: | ||
SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{CLOUD_SQL_USERNAME}:{CLOUD_SQL_PASSWORD}@127.0.0.1:3306/{CLOUD_SQL_DATABASE_NAME}" | ||
SQLALCHEMY_ECHO = False | ||
|
||
|
||
# twilio auth details for messaging function | ||
ACCOUNT_SID = "" | ||
AUTH_TOKEN = "" | ||
|
||
# stripe integration details, use test keys unless running in production/live mode | ||
STRIPE_PUBLISHABLE_KEY_TEST = "" | ||
STRIPE_SECRET_KEY_TEST = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from flask_wtf import Form | ||
from wtforms import StringField, PasswordField, TextField | ||
from wtforms.validators import DataRequired, Email | ||
|
||
|
||
class EmailForm(Form): | ||
email = StringField("Email", validators=[DataRequired(), Email()]) | ||
|
||
|
||
class PasswordForm(Form): | ||
password = PasswordField("Email", validators=[DataRequired()]) |
Oops, something went wrong.