Giter Club home page Giter Club logo

flask-aws-scaffolding's Introduction

Flask AWS Scaffolding

This Flask application comes with a few batteries included...

  • Registration and Login system (bare bones)
  • Facebook Page integration and analytics
  • Search your Facebook Page posts within Elasticsearch
  • Query your Facebook Page analytics using InfluxDB
  • Schedule tasks and distribute processing with RabbitMQ and Celery
  • Like Python? Like MongoDB? Like models? Use Humongolus it's included
  • Make pretty graphs with D3 and NVD3
  • Run everything in containers, and keep your host machine pristine with Docker ;)
  • One click deploy to AWS VPC using Terraform.io

Installation

install Docker

install Nginx

add this entry to your host machine's /etc/hosts file

127.0.0.1	entropealabs.dev auth.entropealabs.dev

install fig, not in a virtualenv, it needs sudo to talk to Docker (If you know how to give sudo access to a module installed in virtualenv, I would love to hear it)

sudo pip install fig==1.0.1

Edit config/nginx.conf, change this line

alias /app/views/static;

to point to the static directory in the flask-aws-scaffolding git checkout (you may need to adjust the permissions of the static files, as well as their parent directories, so that nginx has access to open/read the files)

alias /home/entropealabs/dev/flask-aws-scaffolding/flaskaws/views/static;

copy the nginx.conf file to the nginx conf directory

sudo cp ./config/nginx.conf /etc/nginx/sites-enabled

remove the default conf file (don't worry, it's just a symlink, the file still exists in sites-available)

sudo rm /etc/nginx/sites-enabled/default

restart nginx

sudo service nginx restart

make sure docker is running...

ps aux | grep docker

you should seee somthing like this

root     25919  0.0  0.2 2174776 32720 ?       Ssl  Feb18   5:55 /usr/bin/docker -d

from within the base directory of flask-aws-scaffolding run

sudo fig up

grab some coffee... it's going to download a few hundred MB of image files, but everything should be working when you get back...

assuming everything ran ok, you should be able to see some log files

INFO:root:Running
web_1           | [2015-02-25 02:05:24 +0000] [8] [INFO] Starting gunicorn 19.1.1
web_1           | [2015-02-25 02:05:24 +0000] [8] [DEBUG] Arbiter booted
web_1           | [2015-02-25 02:05:24 +0000] [8] [INFO] Listening at: http://0.0.0.0:8000 (8)
web_1           | [2015-02-25 02:05:24 +0000] [8] [INFO] Using worker: gevent
web_1           | [2015-02-25 02:05:24 +0000] [19] [INFO] Booting worker with pid: 19
mongodb_1       | 2015-02-25T02:05:24.784+0000 [conn1] end connection 172.17.8.210:59764 (1 connection now open)
web_1           | 2015-02-25 02:05:24,784 INFO exited: init_dbs (exit status 0; expected)

you may see some errors as the databases are coming up and the app is waiting for them to be available.

you should now be able to point your browser to http://entropealabs.dev

we will be creating another readme for using the included terraform configurations to deploy to a AWS VPC (Amazon Web Service | Virtual Private Cloud)

For the Facebook Page management you will need to create a Website Facebook Application and provide the App ID and App secret in the fig.yml file. Change these lines.

environment:
    SERVER_NAME: entropealabs.dev
    FACEBOOK_APP_ID: YOURAPPID
    FACEBOOK_APP_SECRET: YOURAPPSECRET

flask-aws-scaffolding's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.