Skip to content

Latest commit

 

History

History
93 lines (56 loc) · 2.33 KB

README.md

File metadata and controls

93 lines (56 loc) · 2.33 KB

Python Flask E-Commerce Website

A simple e-commerce website using Flask, Jinja2, SQLite, jQuery, Bootstrap and Python.

The application loads a gallery of clothing items that includes: image, name, price, and a small form to add clothing items to shopping cart. The clothing information is stored in a SQLite database and is displayed using Bootstrap's card class.

The application contains filters that were implemented through SQLite queries so that the user can scroll through the items according to different categories such as, Shirts, Pants, Shoes, Price etc.

accessibility text

The application can be visited here:

https://sampleclothing.herokuapp.com/

Installation

Use the package manager pip to install the dependencies.

Go in the same directory as the requirements.txt file and run the following

pip install -r requirements.txt

Usage

There are two ways to run the application the application

Run as Python application

Go to the same directory as the main application and run the following

python wsgi.py

Run as Flask application

Go to the same directory as the main application and run the following

set FLASK_APP=application.py
flask run

Deploying on Heroku

The entry point to the application is in wsgi.py file

from application import app

if __name__ == "__main__":
    app.run()

We then need to create a Procfile to deploy to Heroku

web: gunicorn wsgi:app

Create the Heroku application

Use the HerokuCLI to deploy the application to Heroku

heroku login
git init
heroku create sampleclothing
git add.
git commit -am "First python app"
git push heroku master

Once the files are deployed your application will be visible and can be visited. In our case the application is deployed at the link below:

https://sampleclothing.herokuapp.com/

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT