Flask application framework pre-configured for SQL Alchemy, flask-login, and Twitter bootstrap frontend. Meant to serve as a skeleton application for you to customize as desired, not as a Flask extension.
If you are looking for a Flask extension that uses Flask blueprints to provide Bootstrap support, try the other flask-bootstrap.
- Install the system dependencies and Python dependencies
- Customize your
config/app.cfg
(make create_cfg
creates a basicconfig/local.cfg
) - Fill out appropriate
Makefile
variables and runmake
- Then:
python run.py
ormake run
The main system dependencies are Python, Postgreql, and their respective development packages. It could be easily adapted to run on MySQL or even SQLite, but the default installation instructions and Makefile below assume the use of PostgreSQL.
If you're on Ubuntu or Mint and you using Make, you're in luck. There is a very convenient Makefile to install and run the application (should work with Debian with a few minor changes). If you wish to use the Makefile, then simply fill in the appropriate config variables in the Makefile, run make install
to install dependencies, and make run
to start the application. The Makefile installation will even create a default local.cfg
containing your project's configuration, for you to use and customize.
Otherwise, refer to the instructions below.
On Ubuntu or Debian, first install:
sudo apt-get install postgresql python-dev libpq-dev
Red Hat, Fedora, and other derivatives are said to require (confirmation would be welcome):
yum install yum install postgresql-devel postgresql-libs libpqxx-devel
Here's a brief article on getting these dependencies running on Windows (exact instructions would be welcome).
It's probably a good idea to create a virtual environment for this project using virtualenv
and virtualenvwrapper
, which are installed using:
pip install virtualenvwrapper
Then, clone the repo, cd into it, and create a project virtual environment. I like to host my virtual environments in each project directory (but include it in the .gitignore so it's not gitable). So something like:
git clone git://github.com/esbullington/flask-bootstrap.git
cd flask-bootstrap
virtualenv venv
source venv/bin/activate
Once you have the virtual environment installed on your system, and the system dependencies, the rest is simple:
pip install -r config/requirements.txt
- If you're using the Makefile, be sure to set your config filename
- Otherwise, you can either:
- pass your config file using
python manage.py -c config/yourconfig.cfg runserver
or else - set an environmental variable
FLASK_APPLICATION_SETTINGS
to point to your config file
- pass your config file using
- Check to be sure your
SECRET_KEY
config setting is indeed secret and cryptographically strong (120+ bits of entropy) - The Makefile command
make create_cfg
sets thisSECRET_KEY
automatically as part of the config creation
make test
or python manage.py testall
Master:
Dev:
- Base requirements.txt.
- Bootstrap 3.1 frontend framework from Twitter.
- Pre-integrated with flask-login, just create your postgres db and fill in models and app.cfg accordingly.
- Existing user model and basic login/signup.
- For v0.0.2 release (imminent)
- More unit tests for Flask app and JavaScript
- Coherent organization of CSS assets
- Flask-WTF support
- For v0.0.3
- Integrate some sort of Python asset manager for static assets (i.e., JS/CSS minifier, file concatenator)
- Automated app naming through Flask-Script or Makefile
- Add more and better documentation, using Sphinx and mitsuhiko/flask-sphinx-themes
- Comprehensive security review and tests using OWASP standards