- Configure Gmail in you gitconfig:
[sendemail]
smtpserver = smtp.gmail.com
smtpserverport = 587
smtpencryption = tls
smtpuser = <gmail email address>
from = <email address for From: field>
'use strict'; | |
var Sequelize = require('sequelize'); | |
var sequelize = new Sequelize('mainDB', null, null, { | |
dialect: "sqlite", | |
storage: './test.sqlite', | |
}); | |
sequelize |
1) Create a branch with the tag | |
git branch {tagname}-branch {tagname} | |
git checkout {tagname}-branch | |
2) Include the fix manually if it's just a change .... | |
git add . | |
git ci -m "Fix included" | |
or cherry-pick the commit, whatever is easier | |
git cherry-pick {num_commit} | |
[sendemail]
smtpserver = smtp.gmail.com
smtpserverport = 587
smtpencryption = tls
smtpuser = <gmail email address>
from = <email address for From: field>
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) |
from flask import Flask, Blueprint | |
app = Flask(__name__) | |
bp = Blueprint("test", __name__) | |
@bp.route("/test/") | |
def test(): | |
return "TEST" | |
app.register_blueprint(bp, subdomain="test") |
from flask import Flask, render_template_string, request | |
from flask_bootstrap import Bootstrap | |
from jinja2 import Template | |
from flask_wtf import Form | |
from wtforms import StringField | |
from wtforms.validators import DataRequired | |
from flask_sqlalchemy import SQLAlchemy | |
# Build the app along with its extensions and the route |
Persuading WTForms to Generate Checkboxes | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
WTForms takes the pain out of handling forms and validation, you define your form, | |
tell it what validation checks the data needs to pass, then WTForms uses it's | |
widgets to generate the html. | |
A common problem you'll face is "Multiple select fields suck, they are confusing-- | |
how can I show the user a nice list of checkboxes instead?" |