├── flaskSaaS-master
├── _gitignore
├── _dockerignore
├── _DS_Store
├── app
│ ├── app.db
│ ├── _DS_Store
│ ├── forms
│ │ ├── mmm.jpg
│ │ ├── hqdefault.jpg
│ │ ├── chest-example.png
│ │ ├── __pycache__
│ │ │ ├── user.cpython-36.pyc
│ │ │ └── __init__.cpython-36.pyc
│ │ └── user.py
│ ├── templates
│ │ ├── _DS_Store
│ │ ├── admin
│ │ │ └── index.html
│ │ ├── logo.png
│ │ ├── user
│ │ │ ├── account.html
│ │ │ ├── buy.html
│ │ │ ├── forgot.html
│ │ │ ├── charge.html
│ │ │ ├── reset.html
│ │ │ ├── signup.html
│ │ │ └── signin.html
│ │ ├── email
│ │ │ ├── reset.html
│ │ │ └── confirm.html
│ │ ├── contact.html
│ │ ├── error.html
│ │ ├── index.html
│ │ ├── macros.html
│ │ ├── uploaded.html
│ │ ├── map.html
│ │ └── layout.html
│ ├── static
│ │ ├── img
│ │ │ ├── error.png
│ │ │ └── favicon.ico
│ │ └── css
│ │ │ └── custom.css
│ ├── __pycache__
│ │ ├── admin.cpython-36.pyc
│ │ ├── config.cpython-36.pyc
│ │ ├── models.cpython-36.pyc
│ │ ├── __init__.cpython-36.pyc
│ │ ├── logger_setup.cpython-36.pyc
│ │ └── config_common.cpython-36.pyc
│ ├── views
│ │ ├── __pycache__
│ │ │ ├── main.cpython-36.pyc
│ │ │ ├── user.cpython-36.pyc
│ │ │ ├── error.cpython-36.pyc
│ │ │ └── __init__.cpython-36.pyc
│ │ ├── error.py
│ │ ├── main.py
│ │ └── user.py
│ ├── toolbox
│ │ ├── __pycache__
│ │ │ ├── email.cpython-36.pyc
│ │ │ └── __init__.cpython-36.pyc
│ │ └── email.py
│ ├── config_common.py
│ ├── config_prod.py
│ ├── config.py
│ ├── config_dev.py
│ ├── admin.py
│ ├── models.py
│ ├── __init__.py
│ └── logger_setup.py
├── hqdefault.jpg
├── screenshots
│ ├── map.png
│ ├── sign_in.png
│ ├── sign_up.png
│ ├── admin_auth.png
│ └── admin_panel.png
├── nginx
│ ├── Dockerfile
│ └── sites-enabled
│ │ └── api.openbikes.co
├── docker-compose.yml
├── _pylintrc
├── requirements.txt
├── Makefile
├── Dockerfile
├── manage.py
├── LICENSE
└── README.md
├── app
├── app.db
├── _DS_Store
├── forms
│ ├── mmm.jpg
│ ├── hqdefault.jpg
│ ├── chest-example.png
│ ├── __pycache__
│ │ ├── user.cpython-36.pyc
│ │ └── __init__.cpython-36.pyc
│ └── user.py
├── templates
│ ├── _DS_Store
│ ├── logo.png
│ ├── admin
│ │ └── index.html
│ ├── user
│ │ ├── account.html
│ │ ├── buy.html
│ │ ├── forgot.html
│ │ ├── charge.html
│ │ ├── reset.html
│ │ ├── signup.html
│ │ └── signin.html
│ ├── email
│ │ ├── reset.html
│ │ └── confirm.html
│ ├── contact.html
│ ├── error.html
│ ├── index.html
│ ├── macros.html
│ ├── uploaded.html
│ ├── map.html
│ └── layout.html
├── static
│ ├── img
│ │ ├── error.png
│ │ └── favicon.ico
│ └── css
│ │ └── custom.css
├── __pycache__
│ ├── admin.cpython-36.pyc
│ ├── config.cpython-36.pyc
│ ├── models.cpython-36.pyc
│ ├── __init__.cpython-36.pyc
│ ├── logger_setup.cpython-36.pyc
│ └── config_common.cpython-36.pyc
├── views
│ ├── __pycache__
│ │ ├── error.cpython-36.pyc
│ │ ├── main.cpython-36.pyc
│ │ ├── user.cpython-36.pyc
│ │ └── __init__.cpython-36.pyc
│ ├── error.py
│ ├── main.py
│ └── user.py
├── toolbox
│ ├── __pycache__
│ │ ├── email.cpython-36.pyc
│ │ └── __init__.cpython-36.pyc
│ └── email.py
├── config_common.py
├── config_prod.py
├── config.py
├── config_dev.py
├── admin.py
├── models.py
├── __init__.py
└── logger_setup.py
├── README.md
├── BuildanAIStartup.ipynb
└── Transfer_Learning.ipynb
/flaskSaaS-master/_gitignore:
--------------------------------------------------------------------------------
1 | *.db
2 | *.log
3 | *.pyc
4 | config.py
5 |
--------------------------------------------------------------------------------
/flaskSaaS-master/_dockerignore:
--------------------------------------------------------------------------------
1 | *.db
2 | *.log
3 | *.pyc
4 | .git/
5 | config.py
6 |
--------------------------------------------------------------------------------
/app/app.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/app.db
--------------------------------------------------------------------------------
/app/_DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/_DS_Store
--------------------------------------------------------------------------------
/app/forms/mmm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/forms/mmm.jpg
--------------------------------------------------------------------------------
/app/forms/hqdefault.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/forms/hqdefault.jpg
--------------------------------------------------------------------------------
/app/templates/_DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/templates/_DS_Store
--------------------------------------------------------------------------------
/app/templates/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/templates/logo.png
--------------------------------------------------------------------------------
/app/static/img/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/static/img/error.png
--------------------------------------------------------------------------------
/app/forms/chest-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/forms/chest-example.png
--------------------------------------------------------------------------------
/app/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/static/img/favicon.ico
--------------------------------------------------------------------------------
/flaskSaaS-master/_DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/_DS_Store
--------------------------------------------------------------------------------
/flaskSaaS-master/app/app.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/app.db
--------------------------------------------------------------------------------
/flaskSaaS-master/app/_DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/_DS_Store
--------------------------------------------------------------------------------
/flaskSaaS-master/hqdefault.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/hqdefault.jpg
--------------------------------------------------------------------------------
/app/templates/admin/index.html:
--------------------------------------------------------------------------------
1 | {% extends 'admin/master.html' %}
2 |
3 | {% block body %}
4 | Welcome admin.
5 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/forms/mmm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/forms/mmm.jpg
--------------------------------------------------------------------------------
/app/__pycache__/admin.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/__pycache__/admin.cpython-36.pyc
--------------------------------------------------------------------------------
/app/__pycache__/config.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/__pycache__/config.cpython-36.pyc
--------------------------------------------------------------------------------
/app/__pycache__/models.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/__pycache__/models.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/screenshots/map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/screenshots/map.png
--------------------------------------------------------------------------------
/app/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/forms/hqdefault.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/forms/hqdefault.jpg
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/_DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/templates/_DS_Store
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/admin/index.html:
--------------------------------------------------------------------------------
1 | {% extends 'admin/master.html' %}
2 |
3 | {% block body %}
4 | Welcome admin.
5 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/templates/logo.png
--------------------------------------------------------------------------------
/flaskSaaS-master/nginx/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM tutum/nginx
2 | RUN rm /etc/nginx/sites-enabled/default
3 | ADD sites-enabled/ /etc/nginx/sites-enabled
4 |
--------------------------------------------------------------------------------
/flaskSaaS-master/screenshots/sign_in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/screenshots/sign_in.png
--------------------------------------------------------------------------------
/flaskSaaS-master/screenshots/sign_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/screenshots/sign_up.png
--------------------------------------------------------------------------------
/app/__pycache__/logger_setup.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/__pycache__/logger_setup.cpython-36.pyc
--------------------------------------------------------------------------------
/app/forms/__pycache__/user.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/forms/__pycache__/user.cpython-36.pyc
--------------------------------------------------------------------------------
/app/views/__pycache__/error.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/views/__pycache__/error.cpython-36.pyc
--------------------------------------------------------------------------------
/app/views/__pycache__/main.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/views/__pycache__/main.cpython-36.pyc
--------------------------------------------------------------------------------
/app/views/__pycache__/user.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/views/__pycache__/user.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/static/img/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/static/img/error.png
--------------------------------------------------------------------------------
/flaskSaaS-master/app/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/static/img/favicon.ico
--------------------------------------------------------------------------------
/flaskSaaS-master/screenshots/admin_auth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/screenshots/admin_auth.png
--------------------------------------------------------------------------------
/app/__pycache__/config_common.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/__pycache__/config_common.cpython-36.pyc
--------------------------------------------------------------------------------
/app/forms/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/forms/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/app/toolbox/__pycache__/email.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/toolbox/__pycache__/email.cpython-36.pyc
--------------------------------------------------------------------------------
/app/views/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/views/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/forms/chest-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/forms/chest-example.png
--------------------------------------------------------------------------------
/flaskSaaS-master/screenshots/admin_panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/screenshots/admin_panel.png
--------------------------------------------------------------------------------
/app/toolbox/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/app/toolbox/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/__pycache__/admin.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/__pycache__/admin.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/__pycache__/config.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/__pycache__/config.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/__pycache__/models.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/__pycache__/models.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/forms/__pycache__/user.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/forms/__pycache__/user.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/views/__pycache__/main.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/views/__pycache__/main.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/views/__pycache__/user.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/views/__pycache__/user.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/__pycache__/logger_setup.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/__pycache__/logger_setup.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/views/__pycache__/error.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/views/__pycache__/error.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/__pycache__/config_common.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/__pycache__/config_common.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/forms/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/forms/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/toolbox/__pycache__/email.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/toolbox/__pycache__/email.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/views/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/views/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/flaskSaaS-master/app/toolbox/__pycache__/__init__.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/llSourcell/AI_Startup_Prototype/HEAD/flaskSaaS-master/app/toolbox/__pycache__/__init__.cpython-36.pyc
--------------------------------------------------------------------------------
/app/templates/user/account.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
11 | {% endblock %}
12 |
--------------------------------------------------------------------------------
/app/templates/email/reset.html:
--------------------------------------------------------------------------------
1 | Please click on the following link to reset your password:
2 |
3 |
4 | {{ reset_url }}
5 |
6 |
7 |
8 | --
9 | Flask boilerplate, by Max Halford.
10 |
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/user/account.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
11 | {% endblock %}
12 |
--------------------------------------------------------------------------------
/app/templates/email/confirm.html:
--------------------------------------------------------------------------------
1 | Please click on the following link to confirm your email address:
2 |
3 |
4 | {{ confirm_url }}
5 |
6 |
7 |
8 | --
9 | Flask boilerplate, by Max Halford.
10 |
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/email/reset.html:
--------------------------------------------------------------------------------
1 | Please click on the following link to reset your password:
2 |
3 |
4 | {{ reset_url }}
5 |
6 |
7 |
8 | --
9 | Flask boilerplate, by Max Halford.
10 |
--------------------------------------------------------------------------------
/flaskSaaS-master/docker-compose.yml:
--------------------------------------------------------------------------------
1 | web:
2 | restart: always
3 | build: ./
4 | expose:
5 | - "8000"
6 | command: /usr/local/bin/gunicorn -w 2 -b :8000 app:app
7 |
8 | nginx:
9 | restart: always
10 | build: ./nginx/
11 | ports:
12 | - "80:80"
13 | links:
14 | - web:web
15 |
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/email/confirm.html:
--------------------------------------------------------------------------------
1 | Please click on the following link to confirm your email address:
2 |
3 |
4 | {{ confirm_url }}
5 |
6 |
7 |
8 | --
9 | Flask boilerplate, by Max Halford.
10 |
--------------------------------------------------------------------------------
/flaskSaaS-master/_pylintrc:
--------------------------------------------------------------------------------
1 | [FORMAT]
2 | max-line-length=100
3 | indent-string=' '
4 |
5 | [REPORTS]
6 | files-output=no
7 | reports=yes
8 | evaluation=10 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
9 |
10 | [TYPECHECK]
11 | ignored-modules=flask_sqlalchemy
12 | ignored-classes=SQLObject,SQLAlchemy,Base
13 |
--------------------------------------------------------------------------------
/app/templates/contact.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
11 | {% if current_user.is_authenticated %}
12 |
13 | {% endif %}
14 |
15 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/contact.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
11 | {% if current_user.is_authenticated %}
12 |
13 | {% endif %}
14 |
15 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/nginx/sites-enabled/api.openbikes.co:
--------------------------------------------------------------------------------
1 | server {
2 |
3 | listen 80;
4 | server_name openbikes.co;
5 | charset utf-8;
6 |
7 | location / {
8 | proxy_pass http://web:8000;
9 | proxy_set_header Host $host;
10 | proxy_set_header X-Real-IP $remote_addr;
11 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/templates/error.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
 }})
11 |
13 |
14 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/error.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
 }})
11 |
13 |
14 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/requirements.txt:
--------------------------------------------------------------------------------
1 | Tensorflow==1.13.1
2 | Keras==2.2.4
3 | Flask==0.10.1
4 | Flask-Admin==1.3.0
5 | Flask-Bcrypt==0.7.1
6 | Flask-DebugToolbar==0.10.0
7 | Flask-Login==0.3.2
8 | Flask-Mail==0.9.1
9 | Flask-Script==2.0.5
10 | Flask-SQLAlchemy==2.1
11 | Flask-WTF==0.12
12 | gunicorn==19.4.5
13 | itsdangerous==0.24
14 | pytz==2016.10
15 | structlog==16.1.0
16 | termcolor==1.1.0
17 | WTForms==2.1
18 | stripe==2.23.0
19 |
--------------------------------------------------------------------------------
/flaskSaaS-master/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile
2 |
3 | ## Configuration
4 |
5 | BUILD_TIME := $(shell date +%FT%T%z)
6 | PROJECT := $(shell basename $(PWD))
7 |
8 |
9 | ## Install dependencies
10 | .PHONY: install
11 | install:
12 | pip install -r requirements.txt
13 |
14 | ## Setup developpement environment
15 | .PHONY: dev
16 | dev:
17 | cd app && ln -sf config_dev.py config.py
18 |
19 | ## Setup production environment
20 | .PHONY: prod
21 | prod:
22 | cd app && ln -sf config_prod.py config.py
23 |
--------------------------------------------------------------------------------
/app/templates/user/buy.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 | {% block content %}
3 |
17 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/user/buy.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 | {% block content %}
3 |
17 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/user/forgot.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
16 |
17 |
18 | {% endblock %}
--------------------------------------------------------------------------------
/app/views/error.py:
--------------------------------------------------------------------------------
1 | from flask import render_template
2 | from app import app
3 |
4 |
5 | @app.errorhandler(403)
6 | def forbidden(e):
7 | return render_template('error.html', message='403 forbidden'), 403
8 |
9 |
10 | @app.errorhandler(404)
11 | def page_not_found(e):
12 | return render_template('error.html', message='404 not found'), 404
13 |
14 |
15 | @app.errorhandler(410)
16 | def gone(e):
17 | return render_template('error.html', message='410 gone'), 410
18 |
19 |
20 | @app.errorhandler(500)
21 | def internal_error(e):
22 | return render_template('error.html', message='500 internal error'), 500
23 |
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/user/forgot.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
16 |
17 |
18 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/user/charge.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 | {% block content %}
3 |
4 | Thanks, you paid $10.00!
5 | Upload your image below
6 |
7 |
8 |
13 | {% endblock %}
--------------------------------------------------------------------------------
/app/templates/user/reset.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
17 |
18 |
19 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/views/error.py:
--------------------------------------------------------------------------------
1 | from flask import render_template
2 | from app import app
3 |
4 |
5 | @app.errorhandler(403)
6 | def forbidden(e):
7 | return render_template('error.html', message='403 forbidden'), 403
8 |
9 |
10 | @app.errorhandler(404)
11 | def page_not_found(e):
12 | return render_template('error.html', message='404 not found'), 404
13 |
14 |
15 | @app.errorhandler(410)
16 | def gone(e):
17 | return render_template('error.html', message='410 gone'), 410
18 |
19 |
20 | @app.errorhandler(500)
21 | def internal_error(e):
22 | return render_template('error.html', message='500 internal error'), 500
23 |
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/user/charge.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 | {% block content %}
3 |
4 | Thanks, you paid $10.00!
5 | Upload your image below
6 |
7 |
8 |
13 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/user/reset.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
17 |
18 |
19 | {% endblock %}
--------------------------------------------------------------------------------
/app/config_common.py:
--------------------------------------------------------------------------------
1 | TIMEZONE = 'Europe/Paris'
2 |
3 | # Secret key for generating tokens
4 | SECRET_KEY = 'houdini'
5 |
6 | # Admin credentials
7 | ADMIN_CREDENTIALS = ('admin', 'pa$$word')
8 |
9 | # Database choice
10 | SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
11 | SQLALCHEMY_TRACK_MODIFICATIONS = True
12 |
13 | # Configuration of a Gmail account for sending mails
14 | MAIL_SERVER = 'smtp.googlemail.com'
15 | MAIL_PORT = 465
16 | MAIL_USE_TLS = False
17 | MAIL_USE_SSL = True
18 | MAIL_USERNAME = 'flask.boilerplate'
19 | MAIL_PASSWORD = 'flaskboilerplate123'
20 | ADMINS = ['flask.boilerplate@gmail.com']
21 |
22 | # Number of times a password is hashed
23 | BCRYPT_LOG_ROUNDS = 12
24 |
--------------------------------------------------------------------------------
/flaskSaaS-master/app/config_common.py:
--------------------------------------------------------------------------------
1 | TIMEZONE = 'Europe/Paris'
2 |
3 | # Secret key for generating tokens
4 | SECRET_KEY = 'houdini'
5 |
6 | # Admin credentials
7 | ADMIN_CREDENTIALS = ('admin', 'pa$$word')
8 |
9 | # Database choice
10 | SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
11 | SQLALCHEMY_TRACK_MODIFICATIONS = True
12 |
13 | # Configuration of a Gmail account for sending mails
14 | MAIL_SERVER = 'smtp.googlemail.com'
15 | MAIL_PORT = 465
16 | MAIL_USE_TLS = False
17 | MAIL_USE_SSL = True
18 | MAIL_USERNAME = 'flask.boilerplate'
19 | MAIL_PASSWORD = 'flaskboilerplate123'
20 | ADMINS = ['flask.boilerplate@gmail.com']
21 |
22 | # Number of times a password is hashed
23 | BCRYPT_LOG_ROUNDS = 12
24 |
--------------------------------------------------------------------------------
/app/templates/user/signup.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block content %}
4 |
5 |
6 |
17 |
18 |
19 | {% endblock %}
20 |
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/user/signup.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block content %}
4 |
5 |
6 |
17 |
18 |
19 | {% endblock %}
20 |
--------------------------------------------------------------------------------
/app/templates/index.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 | {% if current_user.is_authenticated %}
10 |
11 |
12 |
13 |
27 |
28 | {% endif %}
29 |
30 | {% endblock %}
31 |
--------------------------------------------------------------------------------
/app/toolbox/email.py:
--------------------------------------------------------------------------------
1 | from threading import Thread
2 | from flask.ext.mail import Message
3 | from app import app, mail
4 |
5 |
6 | def send(recipient, subject, body):
7 | '''
8 | Send a mail to a recipient. The body is usually a rendered HTML template.
9 | The sender's credentials has been configured in the config.py file.
10 | '''
11 | sender = app.config['ADMINS'][0]
12 | message = Message(subject, sender=sender, recipients=[recipient])
13 | message.html = body
14 | # Create a new thread
15 | thr = Thread(target=send_async, args=[app, message])
16 | thr.start()
17 |
18 |
19 | def send_async(app, message):
20 | ''' Send the mail asynchronously. '''
21 | with app.app_context():
22 | mail.send(message)
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/index.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 | {% if current_user.is_authenticated %}
10 |
11 |
12 |
13 |
27 |
28 | {% endif %}
29 |
30 | {% endblock %}
31 |
--------------------------------------------------------------------------------
/app/templates/user/signin.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
23 |
24 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/user/signin.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
23 |
24 | {% endblock %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/toolbox/email.py:
--------------------------------------------------------------------------------
1 | from threading import Thread
2 | from flask.ext.mail import Message
3 | from app import app, mail
4 |
5 |
6 | def send(recipient, subject, body):
7 | '''
8 | Send a mail to a recipient. The body is usually a rendered HTML template.
9 | The sender's credentials has been configured in the config.py file.
10 | '''
11 | sender = app.config['ADMINS'][0]
12 | message = Message(subject, sender=sender, recipients=[recipient])
13 | message.html = body
14 | # Create a new thread
15 | thr = Thread(target=send_async, args=[app, message])
16 | thr.start()
17 |
18 |
19 | def send_async(app, message):
20 | ''' Send the mail asynchronously. '''
21 | with app.app_context():
22 | mail.send(message)
--------------------------------------------------------------------------------
/flaskSaaS-master/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM phusion/baseimage:0.9.19
2 |
3 | # Use baseimage-docker's init system.
4 | CMD ["/sbin/my_init"]
5 |
6 | ENV TERM=xterm-256color
7 |
8 | # Set the locale
9 | RUN locale-gen en_US.UTF-8
10 | ENV LANG en_US.UTF-8
11 | ENV LANGUAGE en_US:en
12 | ENV LC_ALL en_US.UTF-8
13 |
14 | # Install necessary packages
15 | RUN apt-get update && apt-get install -y \
16 | build-essential \
17 | python3-pip
18 |
19 | # Install Python requirements
20 | RUN mkdir -p /usr/src/app
21 | COPY requirements.txt /usr/src/app/
22 | RUN pip3 install --upgrade pip
23 | RUN pip3 install -r /usr/src/app/requirements.txt
24 |
25 | # Copy the files from the host to the container
26 | COPY . /usr/src/app
27 | WORKDIR /usr/src/app
28 | RUN chmod 777 -R *
29 |
30 | # Clean up
31 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
32 |
--------------------------------------------------------------------------------
/app/static/css/custom.css:
--------------------------------------------------------------------------------
1 | /* Layout */
2 |
3 | html,
4 | body {
5 | margin:0;
6 | padding:0;
7 | height:100%;
8 | overflow-x: hidden;
9 | }
10 |
11 | #container {
12 | height: 100%;
13 | min-height: 100%;
14 | position: relative;
15 | }
16 |
17 | #body {
18 | margin: 20px;
19 | min-height: 100%;
20 | }
21 |
22 | #footer {
23 | bottom: 0;
24 | width: 100%;
25 | height: 50px; /* Height of the footer */
26 | text-align: center;
27 | }
28 |
29 | /* Forms */
30 |
31 | .form-user {
32 | width: 33% !important;
33 | margin: 0 auto !important;
34 | margin-top: 10% !important;
35 | }
36 |
37 | .form-error {
38 | color: #E50000 !important;
39 | }
40 |
41 | /* Flask flashes */
42 |
43 | .flash {
44 | margin-right: 20px !important;
45 | }
46 |
47 | /* Errors */
48 |
49 | .error-box {
50 | margin-top: 8%;
51 | }
--------------------------------------------------------------------------------
/flaskSaaS-master/app/static/css/custom.css:
--------------------------------------------------------------------------------
1 | /* Layout */
2 |
3 | html,
4 | body {
5 | margin:0;
6 | padding:0;
7 | height:100%;
8 | overflow-x: hidden;
9 | }
10 |
11 | #container {
12 | height: 100%;
13 | min-height: 100%;
14 | position: relative;
15 | }
16 |
17 | #body {
18 | margin: 20px;
19 | min-height: 100%;
20 | }
21 |
22 | #footer {
23 | bottom: 0;
24 | width: 100%;
25 | height: 50px; /* Height of the footer */
26 | text-align: center;
27 | }
28 |
29 | /* Forms */
30 |
31 | .form-user {
32 | width: 33% !important;
33 | margin: 0 auto !important;
34 | margin-top: 10% !important;
35 | }
36 |
37 | .form-error {
38 | color: #E50000 !important;
39 | }
40 |
41 | /* Flask flashes */
42 |
43 | .flash {
44 | margin-right: 20px !important;
45 | }
46 |
47 | /* Errors */
48 |
49 | .error-box {
50 | margin-top: 8%;
51 | }
--------------------------------------------------------------------------------
/flaskSaaS-master/manage.py:
--------------------------------------------------------------------------------
1 | from flask.ext.script import Manager, prompt_bool, Shell, Server
2 | from termcolor import colored
3 |
4 | from app import app, db, models
5 |
6 |
7 | manager = Manager(app)
8 |
9 |
10 | def make_shell_context():
11 | return dict(app=app)
12 |
13 |
14 | @manager.command
15 | def initdb():
16 | ''' Create the SQL database. '''
17 | db.create_all()
18 | print(colored('The SQL database has been created', 'green'))
19 |
20 |
21 | @manager.command
22 | def dropdb():
23 | ''' Delete the SQL database. '''
24 | if prompt_bool('Are you sure you want to lose all your SQL data?'):
25 | db.drop_all()
26 | print(colored('The SQL database has been deleted', 'green'))
27 |
28 |
29 | manager.add_command('runserver', Server())
30 | manager.add_command('shell', Shell(make_context=make_shell_context))
31 |
32 | if __name__ == '__main__':
33 | manager.run()
34 |
--------------------------------------------------------------------------------
/app/config_prod.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from app.config_common import *
4 |
5 |
6 | # DEBUG has to be to False in a production environment for security reasons
7 | DEBUG = False
8 |
9 | # Secret key for generating tokens
10 | SECRET_KEY = 'houdini'
11 |
12 | # Admin credentials
13 | ADMIN_CREDENTIALS = ('admin', 'pa$$word')
14 |
15 | # Database choice
16 | SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
17 | SQLALCHEMY_TRACK_MODIFICATIONS = True
18 |
19 | # Configuration of a Gmail account for sending mails
20 | MAIL_SERVER = 'smtp.googlemail.com'
21 | MAIL_PORT = 465
22 | MAIL_USE_TLS = False
23 | MAIL_USE_SSL = True
24 | MAIL_USERNAME = 'flask.boilerplate'
25 | MAIL_PASSWORD = 'flaskboilerplate123'
26 | ADMINS = ['flask.boilerplate@gmail.com']
27 |
28 | # Number of times a password is hashed
29 | BCRYPT_LOG_ROUNDS = 12
30 |
31 | LOG_LEVEL = logging.INFO
32 | LOG_FILENAME = 'activity.log'
33 | LOG_MAXBYTES = 1024
34 | LOG_BACKUPS = 2
35 |
--------------------------------------------------------------------------------
/flaskSaaS-master/app/config_prod.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from app.config_common import *
4 |
5 |
6 | # DEBUG has to be to False in a production environment for security reasons
7 | DEBUG = False
8 |
9 | # Secret key for generating tokens
10 | SECRET_KEY = 'houdini'
11 |
12 | # Admin credentials
13 | ADMIN_CREDENTIALS = ('admin', 'pa$$word')
14 |
15 | # Database choice
16 | SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
17 | SQLALCHEMY_TRACK_MODIFICATIONS = True
18 |
19 | # Configuration of a Gmail account for sending mails
20 | MAIL_SERVER = 'smtp.googlemail.com'
21 | MAIL_PORT = 465
22 | MAIL_USE_TLS = False
23 | MAIL_USE_SSL = True
24 | MAIL_USERNAME = 'flask.boilerplate'
25 | MAIL_PASSWORD = 'flaskboilerplate123'
26 | ADMINS = ['flask.boilerplate@gmail.com']
27 |
28 | # Number of times a password is hashed
29 | BCRYPT_LOG_ROUNDS = 12
30 |
31 | LOG_LEVEL = logging.INFO
32 | LOG_FILENAME = 'activity.log'
33 | LOG_MAXBYTES = 1024
34 | LOG_BACKUPS = 2
35 |
--------------------------------------------------------------------------------
/app/config.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from app.config_common import *
4 |
5 |
6 | # DEBUG can only be set to True in a development environment for security reasons
7 | DEBUG = True
8 |
9 | # Secret key for generating tokens
10 | SECRET_KEY = 'houdini'
11 |
12 | # Admin credentials
13 | ADMIN_CREDENTIALS = ('admin', 'pa$$word')
14 |
15 | # Database choice
16 | SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
17 | SQLALCHEMY_TRACK_MODIFICATIONS = True
18 |
19 | # Configuration of a Gmail account for sending mails
20 | MAIL_SERVER = 'smtp.googlemail.com'
21 | MAIL_PORT = 465
22 | MAIL_USE_TLS = False
23 | MAIL_USE_SSL = True
24 | MAIL_USERNAME = 'flask.boilerplate'
25 | MAIL_PASSWORD = 'flaskboilerplate123'
26 | ADMINS = ['flask.boilerplate@gmail.com']
27 |
28 | # Number of times a password is hashed
29 | BCRYPT_LOG_ROUNDS = 12
30 |
31 | LOG_LEVEL = logging.DEBUG
32 | LOG_FILENAME = 'activity.log'
33 | LOG_MAXBYTES = 1024
34 | LOG_BACKUPS = 2
35 |
36 |
37 | UPLOAD_FOLDER = '/Users/sirajr/Downloads/flaskSaaS-master/app/forms'
--------------------------------------------------------------------------------
/app/config_dev.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from app.config_common import *
4 |
5 |
6 | # DEBUG can only be set to True in a development environment for security reasons
7 | DEBUG = True
8 |
9 | # Secret key for generating tokens
10 | SECRET_KEY = 'houdini'
11 |
12 | # Admin credentials
13 | ADMIN_CREDENTIALS = ('admin', 'pa$$word')
14 |
15 | # Database choice
16 | SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
17 | SQLALCHEMY_TRACK_MODIFICATIONS = True
18 |
19 | # Configuration of a Gmail account for sending mails
20 | MAIL_SERVER = 'smtp.googlemail.com'
21 | MAIL_PORT = 465
22 | MAIL_USE_TLS = False
23 | MAIL_USE_SSL = True
24 | MAIL_USERNAME = 'flask.boilerplate'
25 | MAIL_PASSWORD = 'flaskboilerplate123'
26 | ADMINS = ['flask.boilerplate@gmail.com']
27 |
28 | # Number of times a password is hashed
29 | BCRYPT_LOG_ROUNDS = 12
30 |
31 | LOG_LEVEL = logging.DEBUG
32 | LOG_FILENAME = 'activity.log'
33 | LOG_MAXBYTES = 1024
34 | LOG_BACKUPS = 2
35 |
36 |
37 | UPLOAD_FOLDER = '/Users/sirajr/Downloads/flaskSaaS-master/app/forms'
--------------------------------------------------------------------------------
/flaskSaaS-master/app/config.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from app.config_common import *
4 |
5 |
6 | # DEBUG can only be set to True in a development environment for security reasons
7 | DEBUG = True
8 |
9 | # Secret key for generating tokens
10 | SECRET_KEY = 'houdini'
11 |
12 | # Admin credentials
13 | ADMIN_CREDENTIALS = ('admin', 'pa$$word')
14 |
15 | # Database choice
16 | SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
17 | SQLALCHEMY_TRACK_MODIFICATIONS = True
18 |
19 | # Configuration of a Gmail account for sending mails
20 | MAIL_SERVER = 'smtp.googlemail.com'
21 | MAIL_PORT = 465
22 | MAIL_USE_TLS = False
23 | MAIL_USE_SSL = True
24 | MAIL_USERNAME = 'flask.boilerplate'
25 | MAIL_PASSWORD = 'flaskboilerplate123'
26 | ADMINS = ['flask.boilerplate@gmail.com']
27 |
28 | # Number of times a password is hashed
29 | BCRYPT_LOG_ROUNDS = 12
30 |
31 | LOG_LEVEL = logging.DEBUG
32 | LOG_FILENAME = 'activity.log'
33 | LOG_MAXBYTES = 1024
34 | LOG_BACKUPS = 2
35 |
36 |
37 | UPLOAD_FOLDER = '/Users/sirajr/Downloads/flaskSaaS-master/app/forms'
--------------------------------------------------------------------------------
/app/templates/macros.html:
--------------------------------------------------------------------------------
1 | {# myapp/templates/macros.html #}
2 |
3 |
4 | {% macro nav_link(endpoint, text) %}
5 | {% if request.endpoint is not none %}
6 | {% if request.endpoint.endswith(endpoint) %}
7 | {{ text }}
8 | {% else %}
9 | {{ text }}
10 | {% endif %}
11 | {% else %}
12 | {{ text }}
13 | {% endif %}
14 | {% endmacro %}
15 |
16 |
17 | {% macro render_field(field) %}
18 |
19 | {{ field(name_=field.name, id=field.name, placeholder=field.description, class_="field") }}
20 |
21 | {% if field.errors %}
22 |
23 | {% for error in field.errors %}
24 | - {{ error }}
25 | {% endfor %}
26 |
27 | {% endif %}
28 | {% endmacro %}
--------------------------------------------------------------------------------
/flaskSaaS-master/app/config_dev.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from app.config_common import *
4 |
5 |
6 | # DEBUG can only be set to True in a development environment for security reasons
7 | DEBUG = True
8 |
9 | # Secret key for generating tokens
10 | SECRET_KEY = 'houdini'
11 |
12 | # Admin credentials
13 | ADMIN_CREDENTIALS = ('admin', 'pa$$word')
14 |
15 | # Database choice
16 | SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
17 | SQLALCHEMY_TRACK_MODIFICATIONS = True
18 |
19 | # Configuration of a Gmail account for sending mails
20 | MAIL_SERVER = 'smtp.googlemail.com'
21 | MAIL_PORT = 465
22 | MAIL_USE_TLS = False
23 | MAIL_USE_SSL = True
24 | MAIL_USERNAME = 'flask.boilerplate'
25 | MAIL_PASSWORD = 'flaskboilerplate123'
26 | ADMINS = ['flask.boilerplate@gmail.com']
27 |
28 | # Number of times a password is hashed
29 | BCRYPT_LOG_ROUNDS = 12
30 |
31 | LOG_LEVEL = logging.DEBUG
32 | LOG_FILENAME = 'activity.log'
33 | LOG_MAXBYTES = 1024
34 | LOG_BACKUPS = 2
35 |
36 |
37 | UPLOAD_FOLDER = '/Users/sirajr/Downloads/flaskSaaS-master/app/forms'
--------------------------------------------------------------------------------
/flaskSaaS-master/app/templates/macros.html:
--------------------------------------------------------------------------------
1 | {# myapp/templates/macros.html #}
2 |
3 |
4 | {% macro nav_link(endpoint, text) %}
5 | {% if request.endpoint is not none %}
6 | {% if request.endpoint.endswith(endpoint) %}
7 | {{ text }}
8 | {% else %}
9 | {{ text }}
10 | {% endif %}
11 | {% else %}
12 | {{ text }}
13 | {% endif %}
14 | {% endmacro %}
15 |
16 |
17 | {% macro render_field(field) %}
18 |
19 | {{ field(name_=field.name, id=field.name, placeholder=field.description, class_="field") }}
20 |
21 | {% if field.errors %}
22 |
23 | {% for error in field.errors %}
24 | - {{ error }}
25 | {% endfor %}
26 |
27 | {% endif %}
28 | {% endmacro %}
--------------------------------------------------------------------------------
/app/admin.py:
--------------------------------------------------------------------------------
1 | import os.path as op
2 |
3 | from flask import request, Response
4 | from werkzeug.exceptions import HTTPException
5 | from flask_admin import Admin
6 | from flask.ext.admin.contrib.sqla import ModelView
7 | from flask.ext.admin.contrib.fileadmin import FileAdmin
8 |
9 | from app import app, db
10 | from app.models import User
11 |
12 |
13 | admin = Admin(app, name='Admin', template_mode='bootstrap3')
14 |
15 | class ModelView(ModelView):
16 |
17 | def is_accessible(self):
18 | auth = request.authorization or request.environ.get('REMOTE_USER') # workaround for Apache
19 | if not auth or (auth.username, auth.password) != app.config['ADMIN_CREDENTIALS']:
20 | raise HTTPException('', Response('You have to an administrator.', 401,
21 | {'WWW-Authenticate': 'Basic realm="Login Required"'}
22 | ))
23 | return True
24 |
25 | # Users
26 | admin.add_view(ModelView(User, db.session))
27 |
28 | # Static files
29 | path = op.join(op.dirname(__file__), 'static')
30 | admin.add_view(FileAdmin(path, '/static/', name='Static'))
31 |
--------------------------------------------------------------------------------
/app/templates/uploaded.html:
--------------------------------------------------------------------------------
1 | {% extends "layout.html" %}
2 |
3 | {% block head %}
4 | {{ super() }}
5 | {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
33 |
34 |
35 |
36 | Results
37 |
38 |
39 |
40 | | Disease |
41 | Percent Likelihood |
42 |
43 |
44 | | Pneumonia |
45 | 98% |
46 |
47 |
48 | | Fibrosis |
49 | 43% |
50 |
51 |
52 |
53 |
54 |
55 | Index
56 |
57 |
58 |
59 |