A basic template for building minimal web applications.
InsightFL is a basic Flask template created specifically to help budding data scientists in the Insight Data Science program get their web applications off the ground quickly. As a former Insight fellow, I spent way too much time troubleshooting the ins and outs of web development instead of focusing on what truly mattered, extracting insight from my data.
InsightFL comes with all the necessary tools you'll need to create your web app quickly:
- Twitter Bootstrap for designing your web pages.
- Bower to easily install third party libraries.
- Reveal.js for creating amazing presentations in HTML.
- And its already in version control from the Git go!
To get started building your web app, follow the instructions below to setup your development and production environments.
- Python with pip installed.
- node (make sure to install the packages that contain npm - Windows: .msi, MacOSX: .pkg)
- 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
- Change into the project directory and install node project dependencies.
cd /path/to/project/directory
npm install
- Install virtualenv and fire up a virtual environment.
sudo pip install virtualenv
virtualenv venv
source venv/bin/activate
- Install Python project dependencies.
pip install -r requirements.txt
That's it! You are ready to start coding your project.
Note: the setup script assumes you are deploying to an Ubuntu 12.04 Server
- Secure copy the setup script and nginx conf file (located in the deployment directory) to the remote host.
scp -i my-key.pem /path/to/setup.sh /path/to/nginx.conf ubuntu@ec2-12-345-67-89.us-west-2.compute.amazonaws.com:~
- SSH into the remote host and run the setup script.
ssh -i my-key.pem ubuntu@ec2ec2-12-345-67-89.us-west-2.compute.amazonaws.com
sudo chmod 755 setup.sh
./setup.sh
- Clone your project's repo (using https).
git clone https://github.com/<username>/<project>.git
- Change into the project directory and install dependencies.
cd ~/project/directory
npm install
sudo pip install -r requirements.txt
- Add nginx configuration file and start nginx.
sudo service nginx start
- Add your production settings to an environment variable.
export PROD_CONFIG="/path/to/settings/production.cfg"
- You should now be able to run your app!
python app.py