Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions JWilson/Flask/dojo_survey
Submodule dojo_survey added at e7ce72
20 changes: 20 additions & 0 deletions JWilson/Flask/form_test/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from flask import Flask, render_template, request, redirect
app = Flask(__name__)

@app.route('/')
def index():
return render_template('index.html')

@app.route('/users', methods=['POST'])
def create_user():
print "Got POST Info"
name = request.form['name']
email = request.form['email']
return redirect('/')

@app.route('/users/<username>')
def show_user_profile(username):
print username
return render_template("user.html")

app.run(debug=False)
14 changes: 14 additions & 0 deletions JWilson/Flask/form_test/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<head>
<title>Form Test Index</title>
</head>
<body>
<h1>Index Page</h1>
<h3>Create a User</h3>
<form action='/users' method='post'>
Name: <input type='text' name='name'>
Email: <input type='text' name='email'>
<input type='submit' value='create_user'>
</form>
</body>
</html>
Empty file.
Empty file.
10 changes: 10 additions & 0 deletions JWilson/Flask/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')

@app.route('/success')
def success():
return render_template('success.html')
app.run(debug=True)
1 change: 1 addition & 0 deletions JWilson/Flask/landing_page
Submodule landing_page added at 3211cc
1 change: 1 addition & 0 deletions JWilson/Flask/my_name
Submodule my_name added at bb6411
26 changes: 26 additions & 0 deletions JWilson/Flask/ninjas/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from flask import Flask, render_template, request, redirect, session

app = Flask(__name__)
app.secret_key = "TestKey"
colors = ['red','orange','purple','blue']

@app.route('/')
def index():
return render_template('index.html')

@app.route('/ninjas')
def ninjas():
image = 'imgs/tmnt.png'
return render_template('ninja.html',image=image)

@app.route('/ninjas/<color>')
def ninja(color):
turtle = 'imgs/{}.jpg'.format(color)
april = 'imgs/notapril.jpg'

image = turtle if color in colors else april


return render_template('ninja.html', image=image)

app.run(debug=True)
Empty file.
Binary file added JWilson/Flask/ninjas/static/imgs/blue.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JWilson/Flask/ninjas/static/imgs/notapril.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JWilson/Flask/ninjas/static/imgs/orange.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JWilson/Flask/ninjas/static/imgs/purple.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JWilson/Flask/ninjas/static/imgs/red.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added JWilson/Flask/ninjas/static/imgs/tmnt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions JWilson/Flask/ninjas/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dojo Survey</title>
<meta charset="utf-8"> <!--Universal Text Format - Allows for different language character sets to appear-->
<meta name="description" content="Template">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="jscript.js"></script>
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/styles.css')}}">
</head>

<body>
<div id="wrapper">
<h1>NO NINJAS HERE!</h1>

<div id="main_content">










</div>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions JWilson/Flask/ninjas/templates/ninja.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dojo Survey</title>
<meta charset="utf-8"> <!--Universal Text Format - Allows for different language character sets to appear-->
<meta name="description" content="Template">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="jscript.js"></script>
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/styles.css')}}">
</head>

<body>
<div id="wrapper">
<h1>Teh Turtles:</h1>

<div id="main_content">
<img src ="{{url_for('static', filename=image)}}" />










</div>
</div>
</body>
</html>
5 changes: 5 additions & 0 deletions JWilson/Flask/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<h1>Hello World!</h1>
</body>
</html>
5 changes: 5 additions & 0 deletions JWilson/Flask/templates/success.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<p>Yay you successfully created another GET route that serves a page!</p>
</body>
</html>
8 changes: 8 additions & 0 deletions JWilson/Flask/test_templates/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from flask import Flask, render_template
app = Flask(__name__)

@app.route('/')
def index():
return render_template('index.html', phrase="hello", times=5)

app.run(debug=True)
16 changes: 16 additions & 0 deletions JWilson/Flask/test_templates/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<html>
<head>
<title>My First Template</title>
</head>
<body>
<h3>My flask template with embedded Python-like code</h3>
<p>Phrase {{ phrase }}</p>
<p>Times: {{ times }}</p>
{% for x in range (0,times): %}
<p>{{ x }}</p>
{% endfor %}
{% if phrase == "hello" %}
<p>The phrase says hello</p>
{% endif %}
</body>
</html>
1 change: 1 addition & 0 deletions JWilson/mySQL/Books
Submodule Books added at c705b4