mrgnr / flask-vanilla-demo

Demo website using Flask and Vanilla Framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flask-Vanilla Demo

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.

What it implements

Project setup and running

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.

Deployment

Heroku

Click the button below to deploy to Heroku:

Deploy to Heroku

About

Demo website using Flask and Vanilla Framework.

License:BSD 2-Clause "Simplified" License


Languages

Language:CSS 87.7%Language:Python 6.9%Language:HTML 4.6%Language:JavaScript 0.5%Language:Mako 0.1%Language:SCSS 0.1%Language:Shell 0.1%