-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
44 lines (30 loc) · 955 Bytes
/
app.py
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
39
40
41
42
43
44
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import os
from flask_migrate import Migrate
from flask_mail import Mail
from datetime import timedelta
app = Flask(__name__)
app.secret_key = os.urandom(24)
app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(minutes=30)
app.debug = True
# Database configuration
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///productrental.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
migrate = Migrate(app, db,render_as_batch=True)
# Email configuration
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USERNAME'] = 'product.rental09@gmail.com'
app.config['MAIL_PASSWORD'] = 'luhxxqxygbawygxb'
mail = Mail(app)
# module impoting
from routes import *
from models import *
# creating all tables
with app.app_context():
db.create_all()
if __name__ == "__main__":
app.run()