Skip to content

ulisescab/gae-boilerplate

 
 

Repository files navigation

Google App Engine Boilerplate

Google App Engine Boilerplate gets your project off the ground quickly using the Google App Engine platform. It introduces new developers to App Engine and advanced developers to best practices.

Try it online

What’s a Boilerplate?

A Boilerplate is used to describe sections of code that can be reused over and over in new contexts or applications which provides good default values, reducing the need to specify program details in every project. (wikipedia)

What makes this Boilerplate Amazing?

It is fully featured, actively maintained, and uses the latest technologies supported by Google App Engine.

New to Google App Engine? Learn about it by watching this video or reading this website.

Just 6 easy steps

  1. Download the last version of the App Engine SDK for Linux, Mac OS or Windows (Tested with SDK version 1.6.6).

  2. Download the code of this Boilerplate (here)

  3. Run locally (instructions).

  4. Set your ‘application’ name in app.yaml

  5. Set parameters in config.py. (secret key, recaptcha code, salt etc.)

  6. Deploy it to your own app (instructions)

This Boilerplate has the following functions:

  • Authentication (Login, Logout, Sign Up)

  • Reset Password

  • Update User Profile

  • Automatic detection of user language

  • Support for 5 Languages (English, Spanish, Italian, Chinese and Indonesian)

  • Visit’s Log

  • Notifications and Confirmation for users when he changes his email or password

  • Contact Form (getting information for logged user)

  • Responsive Design (synchronized with Twitter-Bootstrap project)

  • Mobile identification

Open Source

If you want to add, fix or improve something, create an issue or a Pull Request.

Feel free to commit improvements or new features. Feedback, comments and ideas are welcome.

Try online this Boilerplate

appengine.beecoss.com

Technologies used

  • Python 2.7

  • NDB 1.0.1 (A new datastore API for the Google App Engine Python runtime).

  • Jinja2 2.6 (A fully featured template engine for Python).

  • WTForms-1.0.1 (Forms validation framework keeping user interaction secure and flexible with or without javascript).

  • webapp2 2.5.1 (A lightweight Python web framework compatible with Google App Engine).

  • Babel-0.9.6 and gaepytz-2011h (Industy standard internationalization renders the site in multiple languages).

    • webapp2_extras.sessions

    • webapp2_extras.routes

    • webapp2_extras.auth

    • webapp2_extras.i18n

  • Code written following the Google Python Style Guide

Front-end Technologies

Help us translate and add new languages

This boilerplate comes bundled with babel, pytz, and automatic language detection which together provide powerful internationalization capability.

Text to be translated needs to be indicated in code and then translated by users like you after which it is compiled for speed. If you know english and another language, please help us translate by skipping to step 5 below (provide translations). It requires no special tools except the ability to download the boilerplate and commit it back to github. Once committed you may ask us to perform step 6 for you (compile the translations).

Adding or updating text to be translated or adding new languages requires more work as indicated in the steps below:

  1. Text to be translated should be enclosed in _(“text to translate”) in *.py files. In html templates translated text is indicated by:

    1. {% trans %}text to translate{% endtrans %}

    2. {{..._("text to translate")...}}

    3. {%..._("text to translate")...%}

    Translations can be added to other types of files too. See babel.cfg and babel.cfg documentation

  2. Obtain pybabel to perform the steps below. You will need to install and compile babel. Note that you may need to first install setuptools and easy_install. pybabel.exe can be run from the Scripts directory in your python installation.

  3. Babel then needs to find all translationed text blocks throughout code and templates. After installing pybabl run this command to extract messages (assuming ./ is the location of this boilerplate): pybabel extract -F ./locale/babel.cfg -o ./locale/messages.pot ./ --sort-output --no-location --omit-header

  4. Update translations of existing languages or add new languages

    1. Update translations of existing languages by running this command for each locale: pybabel update -l es_ES -d ./locale -i ./locale/messages.pot --previous --ignore-obsolete Run this command for each locale by replacing es_ES in the command. Locale names are the directory names in ./locale.

    2. Add new languages Run this command for each new language to add. You will need to replace es_ES in the command with the locale code to add. pybabel init -l es_ES -d ./locale -i ./localemessages.pot See the comments at the top of i18n.py to learn how to define locale codes. Add the locale code to the AVAILABLE_LOCALES and LANGUAGES arrays in i18n.py. Add the locale to the language selection dropdown code in base.html if necessary.

  5. Provide translations for each language In each locale/<locale code>/LC_MESSAGES directory there is a file messages.po. Please help us translate the text in these files. msgid is the text in English. msgstr is the translation to the language indicated by the locale code. For example:

    msgid "Change your password" msgstr "Cambiar tu contrase�a"

  6. Compile translations Run: pybabel compile -f -d ./locale

See webapp2’s tutorial and pybabel’s docs for more details.

Security

SSL

  • SSL is enabled site wide by adding secure: always to the section: - url: /.* in app.yaml (remove this line to disable)

  • SSL either requires a free google app engine *.appspot.com domain or a custom domain and certificate

  • Alternatively SSL can be enabled at a controller level via webapp2 schemes. Use the secure_scheme provided in routes.py

  • It is recommended to enable ssl site wide to help prevent session hijacking

Passwords

  • passwords encrypted with SHA512

Acknowledgements

Google App Engine Boilerplate is a collaborative project which is bringing to you thanks to the help of these amazing people

Special thanks to:

About

Google App Engine Boilerplate

Resources

License

Stars

Watchers

Forks

Packages

No packages published