Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
from urlparse import urljoin | |
from django.contrib.auth.tokens import default_token_generator | |
from django.utils.http import int_to_base36 | |
from django.contrib.sites.models import Site | |
from django.core.urlresolvers import reverse | |
from emailtools import MarkdownEmail | |
def add_cors_headers(response): | |
response.headers['Access-Control-Allow-Origin'] = '*' | |
if request.method == 'OPTIONS': | |
response.headers['Access-Control-Allow-Methods'] = 'DELETE, GET, POST, PUT' | |
headers = request.headers.get('Access-Control-Request-Headers') | |
if headers: | |
response.headers['Access-Control-Allow-Headers'] = headers | |
return response | |
app.after_request(add_cors_headers) |
"""Flask Blueprint sublcass that overrides `route`. | |
Automatically adds rules for endpoints with and without trailing slash. | |
""" | |
from flask import Blueprint, Flask | |
class BaseBlueprint(Blueprint): | |
"""The Flask Blueprint subclass.""" |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
For the lesson today, we are going to deploy our application to a live server.
The current workspace provided by cloud9 is meant only for development and not for production. By that, we mean you can use the service to write and even test your code but not to run your service.
For this we will be using a platform called heroku. Heroku is a PAAS (Platform As A Service).
This means you will not need to work VMs and such. Heroku will work with your code as long as you push it, which do using a similar technique.
The main things to consider when hosting your code will be: