• Stars
    star
    177
  • Rank 215,985 (Top 5 %)
  • Language
    Python
  • Created over 13 years ago
  • Updated almost 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Flask skeleton for Google App Engine, using html5 boilerplate templating.

Flask Engine


                                                           EE                   
                                                          EtjK                  
                                                          EtjG                  
                f                                         EjfLE                 
              ###                     ##                  EffLGE  KEKKE         
   #########  ###                     ##                  ELLLGDK:.:::::K       
    ##     #   ##                      #                  ELLLG,,:::LLt:,K      
    ##         ##                      #                  ELL:,,.:,Ltfjt::.     
    ##         ##                      #                  EG,,,:.:i,itttt:K     
    ##         ##                      #                  E,,,,.:;;:;.ttt::     
    ##   #     ##     ####     ####    #  #####          E,,,,,,:LLL.i;tt,,     
    ######     ##    ## .#    #   #.   #   ##           E,,,,,,::LLti,:tti,     
    ##   #     ##    t   #    ##       #  #             K,,,,,,::GGGGiitti,.    
    ##         ##        #    ###.     # ##             EKKKKE,,:GGG,,,tt,,     
    ##         ##    L## #      ###    ## ##         EEjtjLtGD:::ff;itttt,:KE   
    ##         ##   ##   #        ##   #  ##;      EDLLfiDDDDD,,::t:,;itt,DGGE  
    ##         ##   ##   #   :#   ##   #.  ##.    ,jtffLGGEE;,,,,,ittftt,,GGDf  
   ####i      f###  ########  #####   ###K  ###L   KELDEK Eii,,,,,,,jtt,,EGj    
                                                           Kj,,,,,,,,,,:E       
                                                             ED:,,,,,,ED        
                                                                jEKEt           


                      github.com/zachwill/flask-engine

Changelog

###V1.0.3

  • Renamed repo to Flask Engine
    • Run git remote set-url upstream https://github.com/zachwill/flask-engine

Sorry about any headaches this causes, but the name gae-flask-html5 had become a little too verbose. You can still git pull upstream from any changes/updates I make -- just make sure you either git remote set-url or do the following: git remote rm upstream and then git remote add upstream https://github.com/zachwill/flask-engine.

###V1.0.2

  • Minor fixes to views.py file.
  • Ajax functionality for adding todos.

###V1.0.1

  • Fixed bug with werkzeug_debugger_appengine submodule.
  • Minor changes to files (fixed grammar issues, deleted comments, etc).

V1.0

  • Added send email functionality.
    • NOTE: You'll have to update the from_address variable in views.py for it to work properly.
    • Don't forget to run the development server with the dev_appserver.py --enable_sendmail . command.
  • Added test.py file for running unittest. Deleted gaeunit.py.
    • Tests kept in tests directory.
    • Now uses GAE v1.4.3's testbed functionality.

What is this?

It's just a simple Flask skeleton for Google App Engine, but made with all the baked-in-goodness of html5 boilerplate.

I'm planning on using this for my GAE projects going forward (I really like the speed of Flask compared to Django-Nonrel on GAE), so I thought someone else might find it useful, too.

Just about everything is ready to go right out of the box -- including QUnit for JavaScript tests and a tests directory for Python's unittest. Also, I included a style.less file since I primarily only use the Less.app when writing stylesheets nowadays.

Why should I use it?

I stumbled a bit figuring out how to add tests and use the unittest module, and also setup an appengine_console.py file to connect to GAE's remote API, so this skeleton might come in handy for you.

I looked at two other Flask GAE skeletons on Github (flask-gae-skeleton and flask-gae-template -- both of which were awesome for learning), and I adapted what I felt were some of their best parts. Recently, I've updated this project's structure after browsing the source code of another GAE project skeleton.

Lastly, as an added bonus, the scripts are PEP8 compliant.

How do I use it?

Make sure you have the Google App Engine SDK installed on your computer, and you've created an application for your Google account. The SDK will also install symlinks to its packages on your computer.

Steps to Get Up and Running

  1. Create a new application on Google App Engine.

  2. git clone this repo into your personal project folder.

  3. Amend the app.yaml file with your application's name.

  4. Run the project from your development server (use the dev_appserver.py . command or use the Google App Engine Launcher GUI).

  5. Browse the sample application in your web browser: http://localhost:8080

  6. Once you're ready to read the source code, check out the app directory.

  7. All static media is stored in the static directory.

    • This includes your favicon, robots.txt, and humans.txt
  8. Before you deploy, don't forget to:

    • Update the humans.txt file.
    • Uncomment the default_expiration in app.yaml
    • Change the SECRET_KEY in settings.py using Python's os.urandom function.

    >>> import os
    >>> os.urandom(24)
    '\xfd{H\xe5<\x95\xf9\xe3\x96.5\xd1\x01O

Useful Commands

Setup

git clone https://github.com/zachwill/flask-engine.git <your_app_name_here>

Run

dev_appserver.py .

If you're planning on using email functionality with the development server, use the following command:

dev_appserver.py --enable_sendmail .

Deploy

appcfg.py update .

Test

Tests are written using GAE v1.4.3's testbed functionality. Currently, there is a known bug for users without PIL installed.

python test.py

Remote Console

python appengine_console.py <your_app_name_here>

Todo

  • add more tests
  • add pep8.py to libs
    • create PEP8 TestCase, too

License

Author: Zach Williams

All of my code is released under the Unlicense (a.k.a. Public Domain).

More Repositories

1

moment

A Python library for dealing with dates
Python
724
star
2

flask_heroku

An easy-to-use Flask template for Heroku.
CSS
447
star
3

dom

Check domain name availability from the command line.
Python
214
star
4

fred

Python wrapper for the St. Louis Fed's FRED API.
Python
161
star
5

cracking-the-coding-interview

Python solutions for the book Cracking the Coding Interview
Python
124
star
6

asciifi

Turn your pictures into ASCII art
JavaScript
98
star
7

rottentomatoes

Rotten Tomatoes API for Python
Python
87
star
8

excssive

A drag and drop CSS compressor
JavaScript
58
star
9

markdrop

Drag and drop Markdown previews
JavaScript
48
star
10

pjax_flask

Testing out Flask with PJAX
JavaScript
43
star
11

hn

An easy-to-use CLI for HNSearch's API.
Python
31
star
12

ESPN-Basketball

An outdated ESPN Play-By-Play scraper... Not worth your time. Make your own!
Python
29
star
13

golf

Python
28
star
14

heroku_static

Serve all the things!
HTML
26
star
15

dotfiles

Command line goodness
Shell
19
star
16

cookiecutter-scrapy

A simple cookiecutter template for Scrapy projects
Python
18
star
17

dribbble

A simple Python wrapper for the Dribbble API
Python
10
star
18

mapq

An easy-to-use wrapper for the Mapquest Geocoding API.
Python
10
star
19

tumblr

An API wrapper for working with Tumblr and Tumblr's OAuth
Python
9
star
20

drinkups

Objective-C
9
star
21

beautiful_maps

A page-based iOS app highlighting some of Stamen's awesome maps.
Objective-C
8
star
22

darksky

A simple Python wrapper for the Dark Sky API
Python
7
star
23

blog

Current website.
JavaScript
7
star
24

usps_zipcodes

Scrape ZIP Codes from the USPS for a given city and state list.
Python
6
star
25

relaxml

Converting XML should be easy -- and fast.
Python
5
star
26

leetcode

Scraping Leetcode's GraphQL endpoint with Scrapy
Python
5
star
27

flask_cloud

A Flask template to get up and running with DotCloud.
JavaScript
5
star
28

github.vim

Github color scheme for iTerm vim
Vim Script
5
star
29

mcmc

Kruschke "Doing Bayesian Data Analysis" and Gelman/Hill "ARM" in PyMC3
Jupyter Notebook
4
star
30

covid-19

My simple COVID-19 death-to-recovery rate model
Jupyter Notebook
4
star
31

smsified

Sending SMS messages should be dead simple.
Python
4
star
32

playing-with-pulp

Playing around with PuLP in Python
Jupyter Notebook
4
star
33

zappa_template

An easy-to-use template for Zappa and CoffeeScript on Heroku
JavaScript
4
star
34

old

My personal website.
JavaScript
4
star
35

abhi_ipsum

Lorem ipsum with some panache
JavaScript
4
star
36

xml2dict

Fork of xml2dict project
Python
4
star
37

espn_ncaab

CoffeeScript
3
star
38

bittorrent-challenge

Python solution to the BitTorrent Developer Challenge
Python
3
star
39

random

CoffeeScript
3
star
40

bootmaker

Automated Bootstrap workflow
2
star
41

sinatra_template

A simple Sinatra template
JavaScript
2
star
42

background_color

A small app to help learn Backbone.js
JavaScript
2
star
43

madewithdata

Concept site for exploring data APIs.
JavaScript
2
star
44

stamen_maps

A simple UIWebView used to grab screenshots of Stamen's maps.
Objective-C
2
star
45

amazon-reviewers

Find profiles of reviewers who gave the same rating for a product.
Python
2
star
46

import_screencast

JavaScript
2
star
47

applescripts

Simple AppleScript examples.
2
star
48

import_zach

Because the name was available on PyPI.
Python
2
star
49

rebus_generator

ITA's Rebus Generator Puzzle
Python
2
star
50

abhi.info

Because the domain was available
JavaScript
1
star
51

practical_c

Solutions to exercises in the Practical C book.
C
1
star
52

img64

A service to base64 encode external image links
JavaScript
1
star
53

status

Objective-C
1
star
54

heroku_relaxml

A gut server that makes dealing with XML a whole lot easier.
JavaScript
1
star
55

popcorndoc.js

My fork of the popcorndoc.js plugin for Popcorn.js
JavaScript
1
star
56

domainsaurus

An easy-to-use mashup connecting Domainr's API with Wordnik's API
JavaScript
1
star
57

tatooine

A map of Tunisia with all marked Star Wars locations.
JavaScript
1
star
58

zippy

A simple wrapper for the Ziptastic ZIPCode API.
Python
1
star
59

word_dump

Python
1
star
60

xcode_textmate_theme

An XCode 4 color scheme from the theme I use in Vim and TextMate.
1
star
61

simplest

Working with Redis should be simple and Pythonic
Python
1
star
62

cookiecutter-streamlit

A quick cookiecutter template for creating Streamlit sites
Python
1
star
63

lr

JavaScript
1
star
64

wadsworth_constant

A Python script that returns the Wadsworth Constant for input
Python
1
star
65

holy_catchphrase

Catchphrases and action words from the Adam West Batman show
JavaScript
1
star
66

epa_pcs_zip_codes

EPA permits to pollute public water sources by ZIP Code.
Python
1
star
67

boardgames

Find new boardgames to play
Jupyter Notebook
1
star
68

backbone_zombie_test

A simple Backbone.js testing example using Vows and Zombie.js
CoffeeScript
1
star
69

bootstrap_tutorials

Quick Bootstrap tutorials
JavaScript
1
star