Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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 BIN +0 Bytes (100%) .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions 1 JWilson/Flask/dojo_survey
Submodule dojo_survey added at e7ce72
20 changes: 20 additions & 0 deletions 20 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 14 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 10 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 1 JWilson/Flask/landing_page
Submodule landing_page added at 3211cc
1 change: 1 addition & 0 deletions 1 JWilson/Flask/my_name
Submodule my_name added at bb6411
26 changes: 26 additions & 0 deletions 26 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 BIN +90.8 KB 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 BIN +97.1 KB 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 BIN +20.1 KB 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 BIN +38.6 KB 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 BIN +65.4 KB 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 BIN +143 KB 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 30 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 31 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 5 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 5 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 8 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 16 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 1 JWilson/mySQL/Books
Submodule Books added at c705b4
Morty Proxy This is a proxified and sanitized view of the page, visit original site.