-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
62 lines (51 loc) · 1.49 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from flask import Flask, render_template, jsonify, redirect, session, url_for, request , flash, make_response
from os import environ as env
from pymongo import MongoClient
import pymongo
import requests
from flask_pymongo import PyMongo
# Database
client = pymongo.MongoClient(
""
)
database = client["Main"]
db_test = database["Test_sites"]
db_food = database["Food_distribution"]
db_book = database["Book"]
db_anime = database["Anime"]
db_manga = database["Manga"]
db_games = database["Games"]
db_youtube = database["Youtube"]
app = Flask(__name__, static_url_path="")
app.debug = True
@app.route("/")
def home():
return render_template("/index.html")
@app.route("/testsites")
def test_sites():
testsites = db_test.find()
return render_template("/testsites.html", testsites=testsites)
@app.route("/fooddistribution")
def food():
food = db_food.find()
return render_template("/food.html", food=food)
@app.route("/book")
def book():
book = db_book.find()
return render_template("/book.html", book=book)
@app.route("/anime")
def anime():
anime = db_anime.find()
return render_template("/anime.html", anime=anime)
@app.route("/manga")
def manga():
manga = db_manga.find()
return render_template("/manga.html", manga=manga)
@app.route("/games")
def games():
games = db_games.find()
return render_template("/games.html", games=games)
@app.route("/youtube")
def youtube():
youtube = db_youtube.find()
return render_template("/youtube.html", youtube=youtube)