A small shop-app showing a company and its catalog of products (available categories and items, including top 10 latest items).
It is possible to register as a new user and use delete, edit and add categories and items functions when logged in.
The app includes a sqlite database to store the products and user information.
To test the program you can download a sample database here with this repository -
flaskshop.db consists of 4 tables:
- categories
- items
- users
- oauth
The tables categories and items are connected via Foreign Keys:
items.category = categories.id
items.user_id = users.id
categories.user_id = users.id
oauth.user_id = users.id
Requires Python 3.7.1 and Flask 1.0.2.
We recommend using this program in a virtual environment. If you like to do so follow the steps listed here:
Here's a Download Link where you can download the latest version of VB. If you need help installing and getting started with VB check out the Official Documentation.
Currently (October 2017), the supported version of VirtualBox to install is version 5.1. Newer versions do not work with the current release of Vagrant.
Ubuntu users: If you are running Ubuntu 14.04, install VirtualBox using the Ubuntu Software Center instead. Due to a reported bug, installing VirtualBox from the site may uninstall other software you need.
You can download vagrant here and install the version for your OS.
Windows users: The Installer may ask you to grant network permissions to Vagrant or make a firewall exception. Be sure to allow this.
You can download a .zip file with VM configuration files here.
Then follow the following steps using your terminal:
cd
to the VM config folder (if you didn't change the name it's calledFSND Virtual Machine
)- direct into the vagrant folder
$ cd vagrant/
- start vagrant
$ vagrant up
(this will install Linux OS) - log in to Linux VM with
$ vagrant ssh
Official Flask Installation Guide
pip3 install Flask
Furthermore you will need the following packages:
flask_migrate
flask_login
flask_dance
passlib
sqlalchemy
sqlalchemy_utils
environs
wtforms
wtforms_alchemy
blinker
flask_script
To use the GitHub Login functionality
- create a GitHub account
- add the app here If you got any problems follow this tutorial. In your app folder create a .env file and add the following two variables there:
GITHUB_ID
=mygithubidGITHUB_SECRET
=mygithubsecret
$ python3 app.py
- IP Address 89.22.107.197
- OPS Ubuntu 16.04
- SSH Port 2200
- URL to application: http://89.22.107.197
apt-get install nano
apt-get install git
apt-get install python3-pip
apt-get install libapache2-mod-wsgi-py3
- in
etc/ssh/sshd_config
changed port ssh from 22 to 2200 - installed
ufw
and made the following changes:ufw default allow outgoing
ufw default deny incoming
ufw allow ssh
ufw allow 2200
ufw allow www
ufw enable
- added WSGIScriptAlias to apache2 conf-enabled:
- new file flaskapp.conf with following content:
WSGIScriptAlias / /usr/share/caros-apps/flaskapp/wsgi/flask.wsgi
WSGIScriptReloading On
<Directory /usr/share/caros-apps/flaskapp/wsgi>
Order allow,deny
Allow from all
</Directory>
- Flask
- flask_migrate
- flask_login
- flask_dance
- passlib
- sqlalchemy
- sqlalchemy_utils
- environs
- wtforms
- wtforms_alchemy
- blinker
- flask_script
- passlib
- wtforms
- environs
- blinker
- sqlalchemy
No licence required.
For any questions please send a message to our support.