Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, psycopg2, psycopg2.extras
- from flask import Flask, request, session, g, redirect, url_for,
- abort, render_template, flash
- app = Flask(__name__)
- app.config.from_object(__name__)
- app.config.update(dict(
- SECRET_KEY='development key',
- USERNAME='admin',
- PASSWORD='default'
- ))
- def connect_db():
- """Connects to the specific database."""
- rv = psycopg2.connect(database='database_name', user='username')
- return rv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement