def portfolio_route(): return render_template("portfolio.html", projects=projects.setup()) #adds the app routes so we can have seprate sites for each of the locations where we can include information about them @p2_newbiecodersbp.route("/greece/") def greece_route(): return render_template("greece.html", projects=projects.setup()) @p2_newbiecodersbp.route("/italy/") def italy_route(): return render_template("italy.html", projects=projects.setup()) @p2_newbiecodersbp.route("/spain/") def spain_route(): return render_template("spain.html", projects=projects.setup()) @p2_newbiecodersbp.route("/france/") def france_route(): return render_template("france.html", projects=projects.setup()) @p2_newbiecodersbp.route("/germany/") def germany_route(): return render_template("germany.html", projects=projects.setup()) @p2_newbiecodersbp.route("/all/") def all_route(): return render_template("all.html", datalist=data.alldata()) @p2_newbiecodersbp.route("/england/") def england_route(): return "<h1 style='background-color:blue;color:white'>England!</h1>" if __name__ == "__main__": #runs the application on the repl development server app.run(debug=True)
def italy_route(): return render_template("italy.html", projects=projects.setup()) @p2_newbiecodersbp.route("/spain/") def spain_route(): return render_template("spain.html", projects=projects.setup()) @p2_newbiecodersbp.route("/france/") def france_route(): return render_template("france.html", projects=projects.setup()) @p2_newbiecodersbp.route("/germany/") def germany_route(): return render_template("germany.html", projects=projects.setup()) @p2_newbiecodersbp.route("/all/") def all_route(): return render_template("all.html", datalist=data.alldata()) @p2_newbiecodersbp.route("/england/") def england_route(): return "<h1 style='background-color:blue;color:white'>England!</h1>" if __name__ == "__main__": #runs the application on the repl development server app.run(debug=True)
def signup(): form = RegisterForm() if form.validate_on_submit(): new_user = User(username = form.username.data, email = form.email.data, password = form.password.data) db.session.add(new_user) db.session.commit() return redirect(url_for('home_route')) return render_template("signup.html", form = form, projects=projects.setup())
def spotify(): if (request.method == 'POST'): form = request.form link = form['link'] if not (link.startswith("https://open.spotify.com/embed/")): return render_template_string( "<h1>Please enter a valid spotify playlist url</h1><br><p>Did you add the /embed between /playlist/ and the playlist id?</p>" ) return else: open("spotify.txt", "a").write("\n" + link) a = open("spotify.txt", "r").read() links = a.split("\n") return render_template("spotify.html", projects=projects.setup(), links=links)
def youtube(): if (request.method == 'POST'): form = request.form link = form['link'] if not (link.startswith("https://youtube.com/embed/")): return render_template_string( '<h1>please enter a valid link<br><p>If you have a "www." make sure to remove it</p><iframe frameborder="0" width="666px" height="375px" src="https://owo.whats-th.is/ARRGFC3.gif"</iframe>' ) else: open("youtube.txt", "a").write("\n" + link + '?controls=0') a = open("youtube.txt", "r").read() links = a.split("\n") return render_template("youtube.html", projects=projects.setup(), links=links)
def login(): #TODO: Make the form accept the User Value, or somehow update the form form = LoginForm() #TODO Make The SQL Database work if form.validate_on_submit(): #exists = db.session.query( #db.session.query(User).filter_by(username='******').exists() #).scalar() #if exists == True: #return "Exists" user = User.query.filter_by(username = form.username.data).first() if user: if user.password == form.password.data: return redirect(url_for('showboard')) return '<h1>Invalid username or password</h1>' return render_template("login.html", form = form, projects=projects.setup())
def home(): if (request.method == 'POST'): form = request.form product = form['product'] open("products.txt", "a").write("\n" + product) a = open("products.txt", "r").read() popular = a.split("\n") if (len(popular) > 7): popular.pop(0) seperator = '\n' newContent = seperator.join(popular) open("products.txt", "w").write(newContent) return redirect("https://www.amazon.com/s?k=" + product + "&ref=nb_sb_noss") a = open("products.txt", "r").read() popular = a.split("\n") return render_template('home.html', projects=model.setup(), popular=popular) return render_template("home.html", projects=projects.setup(), popular=popular)
def hello_route(): return render_template("low_maint.html", projects=projects.setup())
def showboard(): return render_template("DashBoard.html", projects=projects.setup())
def videos(): return render_template('videos.html', projects=projects.setup())
def selfgrade(): return render_template("selfgrade.html", projects=projects.setup())
def apguidelines(): return render_template("apcsp.html", projects=projects.setup())
def fruit_route(): return render_template("fruit_veggie.html", projects=projects.setup())
def submit_route(): return render_template("submit.html", projects=projects.setup())
def popularitems(): a = open("products.txt", "r").read() popular = a.split("\n") return render_template("popularitem.html", projects=projects.setup(), popular=popular)
def basic_route(): return render_template("basic.html", projects=projects.setup())
def pairshare(): return render_template("pairshare.html", projects=projects.setup())
def dnhscsp(): return render_template("dnhscsp.html", projects=projects.setup())
def highmaint_route(): return render_template("high_maint.html", projects=projects.setup())
def home_route(): return render_template("home.html", projects=projects.setup())
def sdplant_route(): return render_template("SD_plants.html", projects=projects.setup())
def historyofcomedy_route(): return render_template("historyofcomedy.html", projects=projects.setup())
def plantpictures(): return render_template("test.html", projects=projects.setup())
def lucas_route(): return render_template("TX.html", projects=projects.setup())
def hello(): #Flask import uses Jinga to render HTML return render_template("hseries.html", projects=projects.setup())
def scientific_route(): return render_template("scientific.html", projects=projects.setup())
def comediandecades_route(): return render_template("comediandecades.html", projects=projects.setup())
def testing(): return render_template("template1.html", projects=projects.setup())
def knock_route(): return render_template("knock.html", projects=projects.setup())
def ava_route(): return render_template("CA.html", projects=projects.setup())