-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
35 lines (22 loc) · 816 Bytes
/
test.py
File metadata and controls
35 lines (22 loc) · 816 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
from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session
from flask_session import Session
import sqlite3
# Configure application
app = Flask(__name__)
# Configure CS50 Library to use SQLite database
db = SQL("sqlite:///mashup.db")
# Ensure responses aren't cached
@app.after_request
def after_request(response):
response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
response.headers["Expires"] = 0
response.headers["Pragma"] = "no-cache"
return response
# from bs4 import BeautifulSoup
# from urllib import request
# webpage = request.urlopen('https://courses.cs50.net/course/125186')
# soup = BeautifulSoup(webpage,'html.parser')
# file = open("courses.cs50.txt", "w")
# file.write(soup.prettify())
# #print(soup.prettify())