-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ae5862a
Showing
2,577 changed files
with
402,130 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from flask import Flask , render_template, request, redirect | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/') | ||
def index(): | ||
return render_template('index.html') | ||
|
||
@app.route('/home') | ||
def home(): | ||
fruit=['apple','banana','pear'] | ||
return render_template('home.html', fruit=fruit) | ||
|
||
@app.route('/login',methods=['POST','GET']) | ||
def login(): | ||
error=None | ||
if request.method == 'POST': | ||
if request.form['email'] !='rai@gmail.com' or request.form['password'] !='nsoc': | ||
error='Wrong credentials' | ||
else: | ||
return redirect('/home') | ||
return render_template('login.html',error=error) | ||
return render_template('login.html') | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
app.jinja_env.globals.update(chr=chr) | ||
app.run(host='0.0.0.0' ,port=8000,debug=True, threaded=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
body | ||
{ | ||
font-size: 50px; | ||
font-family: algerian; | ||
background-image: url('/static/images/bm.jpg') ; | ||
background-repeat: no-repeat; | ||
color: white; | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Home</title> | ||
<link rel="stylesheet" href="/static/css/style.css"> | ||
|
||
</head> | ||
<body> | ||
NIE is awesome. I hope my principal reads this. | ||
<ul> | ||
{%set x= 'abcdefghijklmnopqrstuvwxyz'%} | ||
{% for i in x %} | ||
{% print(i) %} | ||
{% endfor %} | ||
</ul> | ||
<ul> | ||
{% for i in fruit %} | ||
<li> | ||
{{i}} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
<a href="/login"><button type="submit" name="logout_submit">Sign out</button></a> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title> | ||
Home | ||
</title> | ||
This is my homepage<br> | ||
<link rel="stylesheet" href="/static/css/style.css"> | ||
</head> | ||
<body> | ||
NSoC 5.0<br>I like computers a lot | ||
<a href="/home" target="_blank"><h1>Home</h1></a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>login</title> | ||
<link rel="stylesheet" href="/static/css/style.css"> | ||
|
||
</head> | ||
<body> | ||
<form class="" method="post"> | ||
<input type="text" name="email" placeholder="Email"> | ||
<input type="password" name="password" placeholder="Password"> | ||
<button type="submit" name="login_submit">Sign in</button> | ||
</form> | ||
{% if error %} | ||
{{ error }} | ||
{% endif %} | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.