Exemple #1
0
from flask import Flask, jsonify, request, render_template, url_for, redirect, flash, session, flash
from werkzeug import secure_filename

import rethinkdb as r
import json
import sys
import os
app = Flask(__name__)
app.config['SECRET_KEY'] = '2312ghas'
from models import dbSetUp

# starts database
dbSetUp()

conn = r.connect(host='localhost', port='28015')


@app.route('/', methods=['GET', 'POST'])
@app.route('/home', methods=['GET', 'POST'])
def home():
    return render_template('home/index.html')


@app.route('/login', methods=['GET', 'POST'])
def login():
    if request.method == 'GET':
        if 'apiKey' in session:
            return redirect(url_for('discover'))
        return render_template('login/index.html')
    if request.method == 'POST':
        username = request.form['username']
Exemple #2
0
app=Flask(__name__)
#CORS(app)
app.secret_key='akshaytaggem '
import google_login
from google_login import session
import test
from models import dbSetUp
import mail
import api
import contactsAPI
#SSL  temporary
#context = SSL.Context(SSL.SSLv23_METHOD)
#context.use_privatekey_file('server.key')
#context.use_certificate_file('server.crt')
dbSetUp()


notification=[{ "item": { "time":123 , "user":"******"} }]

notification=json.dumps(notification)
msg="Welcome to Dashboard. Here you can find all your shared stuffs. We keep it safe here."
# dbSetUp()

@app.errorhandler(404)
def page_not_found(e):
    return render_template('page_error/404.html')


@app.route('/')
def home():