-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathapp.py
More file actions
46 lines (31 loc) · 876 Bytes
/
app.py
File metadata and controls
46 lines (31 loc) · 876 Bytes
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
45
46
# ---- YOUR APP STARTS HERE ----
# -- Import section --
from flask import Flask
from flask import render_template
from flask import request
# from flask_pymongo import PyMongo
# -- Initialization section --
app = Flask(__name__)
events = [
{"event":"First Day of Classes", "date":"2019-08-21"},
{"event":"Winter Break", "date":"2019-12-20"},
{"event":"Finals Begin", "date":"2019-12-01"}
]
# name of database
# app.config['MONGO_DBNAME'] = 'database-name'
# URI of database
# app.config['MONGO_URI'] = 'mongo-uri'
# mongo = PyMongo(app)
# -- Routes section --
# INDEX
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html', events = events)
# CONNECT TO DB, ADD DATA
@app.route('/add')
def add():
# connect to the database
# insert new data
# return a message to the user
return ""