This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert a Date or Date/Time into Epoch | |
def datetime_to_epoch(dt, tz): | |
localtz = timezone(os.environ.get('SYSTEM_TIMEZONE', "America/Los_Angeles")) # Local System Timezone | |
if type(tz) == str or type(tz) == unicode: | |
dttz = timezone(tz) # pytz Timezone object (if tz is a string) | |
else: | |
dttz = tz | |
if type(dt) == datetime.date: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == '__main__': | |
import os, sys | |
basedir = os.path.abspath(os.path.dirname(__file__) + '/../') | |
sys.path.insert(0, basedir) | |
from app import app, db | |
from hakaru_test import MyAppTest | |
from pyquery import PyQuery as pq | |
from app.model import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from flask import Flask, render_template, request | |
app = Flask(__name__) | |
@app.route("/new_student", methods=['POST']) | |
def create_student(): | |
pass |