-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
38 lines (34 loc) · 1.19 KB
/
config.py
File metadata and controls
38 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from flask import Flask, render_template, request, redirect, flash, url_for, session
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.sql import func
from flask_migrate import Migrate
from flask_bcrypt import Bcrypt
from datetime import datetime
import re
import stripe
from flask_socketio import SocketIO
app = Flask(__name__)
# configurations to tell our app about the database we'll be connecting to
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///pizza.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
# an instance of the ORM
db = SQLAlchemy(app)
# a tool for allowing migrations/creation of tables
migrate = Migrate(app, db)
app.secret_key="secret#key#is#set"
bcrypt = Bcrypt(app)
# Stripe API #
#Strip API keys go in a folder above called StripeAPIkeys.txt
#open path for Unix
f = open("../stripe/StripeAPIkeys.txt", "r")
#open path for Windows
#f = open("..\StripeAPIkeys.txt", "r")
stripe_keys = {
'publishable_key':f.readline().strip('\n').strip('\r'),
'secret_key': f.readline().strip('\n').strip('\r')
}
f.close()
stripe.api_key = stripe_keys['secret_key']
# print("Public key: ",stripe_keys['publishable_key'])
# print("Secret key: ",stripe_keys['secret_key'])
socketio = SocketIO(app)