This is a demo website that uses Flask to serve pages styled with Vanilla Framework. I worked on this while learning Vanilla and going through the Flask Framework Cookbook.
- Create & view products and categories
- uses Vanilla Framework for front end styling and Flask-WTForms for form processing
- uses Flask-SQLAlchemy and Flask-Migrate to store & manage data in the database
- User accounts with authentication
- uses Flask-Login for local registration and Flask-Dance for logging in via GitHub
- RESTful API to create, update, and delete products
- uses Flask-RESTful
- Admin interface to manage the database through the site
- uses Flask-Admin
Copy .env
to .env.local
and modify it with your configuration settings:
export SECRET_KEY=YourSecretKey
export FLASK_ENV=development
export GITHUB_OAUTH_CLIENT_ID=YourGithubOauthClienId
export GITHUB_OAUTH_CLIENT_SECRET=YourGithubOauthClientSecret
To allow user authentication via GitHub,
create an OAuth app on GitHub and use
the client ID and secret to set GITHUB_OAUTH_CLIENT_ID
and
GITHUB_OAUTH_CLIENT_SECRET
.
Create a virtual environment and install requirements:
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
Run the server:
$ source .env.local
$ flask run --cert=adhoc
You should be able to access the site at https://localhost:5000.
Note: OAuth2 integration with GitHub requires HTTPS to work, so the above command uses the
--cert=adhoc
option to generate self-signed certificates for development. You can leave this option off and access the site over plain HTTP if you don't care about using GitHub for user authentication.
Click the button below to deploy to Heroku: