from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from config import prod_config,local_config,checkENV DB_URL='' if checkENV()=='LOCAL': # it is local envrn lc=local_config() DB_URL=lc.DB_URI print('database.py called in Local environment '+str(DB_URL)) else: pc=prod_config() DB_URL=pc.DB_URI print('database.py called in Prod environment URL->'+str(DB_URL)) engine = create_engine(DB_URL, echo=False) Session = sessionmaker(autocommit=False,autoflush=False,bind=engine) Base=declarative_base() metadata = Base.metadata def addUser(name, age, email, phone, dose_no,search_by,pincode ,state_id=-1,dist_id=-1,dist_name='NA'): from cowin_get_email.databases.user_model import addUser
from flask import render_template,redirect,url_for,session from flask import url_for, Blueprint, request,Response from flask import jsonify from cowin_get_email.databases import database from cowin_get_email.utility import api,validator,send_email,user_util import json from config import checkENV bp = Blueprint('route1', __name__) print("Calling Routes") local=False if checkENV()=="LOCAL": local=True @bp.route('/') def home(): res,login=isLoggedIn() if login==True: # redirect to dashboard. return redirect(url_for('routeDashboard.dashboard')) else: return render_template('landing.html',local=local) @bp.route('/addUser', methods=['POST', 'GET']) def addUser():