Skip to content
Example applications for Flask beginners.
JavaScript HTML CSS Python PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Initial commit Jul 23, 2019
cache
database Initial commit Jul 23, 2019
email Initial commit Jul 23, 2019
form Initial commit Jul 23, 2019
hello Pin werkzeug to 0.15.4 & add python-dotenv Jul 24, 2019
http
template Initial commit Jul 23, 2019
.gitignore Initial commit Jul 23, 2019
CHANGES.md Initial commit Jul 23, 2019
LICENSE Initial commit Jul 23, 2019
Pipfile Pin werkzeug to 0.15.4 & add python-dotenv Jul 24, 2019
Pipfile.lock Pin werkzeug to 0.15.4 & add python-dotenv Jul 24, 2019
README.md Update README.md Jul 24, 2019
requirements.txt Pin werkzeug to 0.15.4 & add python-dotenv Jul 24, 2019

README.md

Flask Examples

Example applications for Flask beginners.

Installation

First, you need to clone this repo:

$ git clone git@github.com:greyli/flask-examples.git

Or:

$ git clone https://github.com/greyli/flask-examples.git

Then change into the flask-examples folder:

$ cd flask-examples

Now, we will need to create a virtual environment and install all the dependencies. We have two options available for now.

Use Pipenv:

$ pipenv install
$ pipenv shell

Or use pip + virtualenv:

$ virtualenv venv
$ . venv/bin/activate  # on Windows, use "venv\Scripts\activate" instead
$ pip install -r requirements.txt

How to Run a Specific Example Application?

Before run a specific example application, make sure you have activated the virtual enviroment:

$ cd flask-examples
$ pipenv shell  # or ". venv/bin/activate" / "venv\Scripts\activate" (Windows)

For example, if you want to run the Hello application, just execute these commands:

$ cd hello
$ flask run

Similarly, you can run HTTP application like this:

$ cd http
$ flask run

The applications will always running on http://localhost:5000.

Example Applications Menu

  • Hello (/hello): Say hello with Flask.
  • HTTP (/http): HTTP handing in Flask.
  • Templates (/templates): Templating with Flask and Jinja2.
  • Form (/form): Form handing with Flask-WTF (WTForms), File upload and integrating with Flask-CKEditor, Flask-Dropzone.
  • Database (/database): Database with Flask-SQLAlchemy (SQLAlchemy).
  • Email (/email): Email with Flask-Mail, SendGrid
  • Assets (/assets): Assets profiling with Flask-Assets.
  • Cache (/cache): Cache with Flask-Caching.

Advanced Examples Flask Applications

  • SayHello: A simple message board.
  • Bluelog: A blog engine that supports category and resource management.
  • Albumy: A full-featured photo-sharing social networking.
  • Todoism: A to-do application implements as SPA, it supports i18n and provides web APIs.
  • CatChat: A chat room based on WebSocket.

Contributions

Any contribution is welcome, just fork and submit your PR.

License

This project is licensed under the MIT License (see the LICENSE file for details).

You can’t perform that action at this time.