Skip to content

stormpython/insightfl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InsightFL

A basic template for building minimal web applications.

Introduction

InsightFL is a basic Flask template created specifically to help budding data scientists in the Insight Data Science program. It comes with a very basic Bootstrap template to help Insight fellows get started building their web application. If you are new to Flask and/or web development, take a look at the resources below.

To get started building your web app, follow the instructions below to setup your development environment.

Note: This assumes you are comfortable with the Terminal and have some familiarity with Unix/Linux commands. If this is not the case, take a look at this guide.

Getting Started

System Requirements

  1. Python(v2.7+) with pip installed.

Setup

  1. Fork the project and clone the repository.

Note: It is helpful to change the repository name before cloning. In Github, click on Settings on the right-hand side of your screen. Within the Settings box at the top of the screen, rename the repository and click Rename.

git clone git@github.com:<username>/<project>.git
  1. Recommended: Install virtualenv and fire up a virtual environment.
# cd into your InsightFL project folder
# Install virtualenv
sudo pip install virtualenv

# Create virtualenv folder `venv`
virtualenv venv

# Activate the virtual environment
source venv/bin/activate
  1. Install Python project dependencies.
pip install -r requirements.txt
  1. To test your application, run the manage.py file: python manage.py runserver, and open your web browser to localhost:5000.

Home Page

That's it! You are ready to start building your web application.

Note: manage.py uses the builtin server for development. You should not use the builtin development server in production (i.e. when you're launching your web application). To run in production, use gunicorn manage:app at the command line.

Application Structure

Philosophy

InsightFL's project layout mimics that of large Flask applications. This is done intentionally. Despite the fact that most Insight projects are small applications, utilizing this structure allows you to separate your development concerns more effectively. Instead of having all your web app code in one file, it can be broken up into separate, smaller chunks, which makes for cleaner code and easier debugging.

Project Layout

  • app - Where your Flask web application lives. This is where you'll spend the majority of your time
  • .gitignore - Git ignore file
  • config.py - Project configuration file for storing sensitive or dynamic settings, e.g. database settings
  • LICENSE.md - Project license
  • manage.py - Entry point to your Flask application during development, click here for more info.
  • README.md - You're looking at it! :)
  • requirements.txt - Tracks all your Python dependencies using pip
  • schema.sql - Your SQL database schemas

Resources

  1. Documentation

  2. Interactive Tutorials

  3. Books

About

Basic template for building minimal flask applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published