diff --git a/.DS_Store b/.DS_Store index e274363..0e4346d 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/JWilson/Flask/dojo_survey b/JWilson/Flask/dojo_survey new file mode 160000 index 0000000..e7ce72b --- /dev/null +++ b/JWilson/Flask/dojo_survey @@ -0,0 +1 @@ +Subproject commit e7ce72b728c54929fb24c3aaac5637af1d2acf1e diff --git a/JWilson/Flask/form_test/server.py b/JWilson/Flask/form_test/server.py new file mode 100644 index 0000000..43023f7 --- /dev/null +++ b/JWilson/Flask/form_test/server.py @@ -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/') +def show_user_profile(username): + print username + return render_template("user.html") + +app.run(debug=False) \ No newline at end of file diff --git a/JWilson/Flask/form_test/templates/index.html b/JWilson/Flask/form_test/templates/index.html new file mode 100644 index 0000000..aaeaf98 --- /dev/null +++ b/JWilson/Flask/form_test/templates/index.html @@ -0,0 +1,14 @@ + + + Form Test Index + + +

Index Page

+

Create a User

+
+ Name: + Email: + +
+ + \ No newline at end of file diff --git a/JWilson/Flask/form_test/templates/success.html b/JWilson/Flask/form_test/templates/success.html new file mode 100644 index 0000000..e69de29 diff --git a/JWilson/Flask/form_test/templates/users.html b/JWilson/Flask/form_test/templates/users.html new file mode 100644 index 0000000..e69de29 diff --git a/JWilson/Flask/hello.py b/JWilson/Flask/hello.py new file mode 100644 index 0000000..66e16e3 --- /dev/null +++ b/JWilson/Flask/hello.py @@ -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) diff --git a/JWilson/Flask/landing_page b/JWilson/Flask/landing_page new file mode 160000 index 0000000..3211cc2 --- /dev/null +++ b/JWilson/Flask/landing_page @@ -0,0 +1 @@ +Subproject commit 3211cc2929a7848c490913e8c466065b27b96d16 diff --git a/JWilson/Flask/my_name b/JWilson/Flask/my_name new file mode 160000 index 0000000..bb64113 --- /dev/null +++ b/JWilson/Flask/my_name @@ -0,0 +1 @@ +Subproject commit bb64113634f992c3eb63f21a3160c5e0437e4fcc diff --git a/JWilson/Flask/ninjas/server.py b/JWilson/Flask/ninjas/server.py new file mode 100644 index 0000000..fdc79d4 --- /dev/null +++ b/JWilson/Flask/ninjas/server.py @@ -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/') +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) \ No newline at end of file diff --git a/JWilson/Flask/ninjas/static/css/styles.css b/JWilson/Flask/ninjas/static/css/styles.css new file mode 100644 index 0000000..e69de29 diff --git a/JWilson/Flask/ninjas/static/imgs/blue.jpg b/JWilson/Flask/ninjas/static/imgs/blue.jpg new file mode 100755 index 0000000..c049cfd Binary files /dev/null and b/JWilson/Flask/ninjas/static/imgs/blue.jpg differ diff --git a/JWilson/Flask/ninjas/static/imgs/notapril.jpg b/JWilson/Flask/ninjas/static/imgs/notapril.jpg new file mode 100755 index 0000000..39b2f0a Binary files /dev/null and b/JWilson/Flask/ninjas/static/imgs/notapril.jpg differ diff --git a/JWilson/Flask/ninjas/static/imgs/orange.jpg b/JWilson/Flask/ninjas/static/imgs/orange.jpg new file mode 100755 index 0000000..4ad75d0 Binary files /dev/null and b/JWilson/Flask/ninjas/static/imgs/orange.jpg differ diff --git a/JWilson/Flask/ninjas/static/imgs/purple.jpg b/JWilson/Flask/ninjas/static/imgs/purple.jpg new file mode 100755 index 0000000..8912292 Binary files /dev/null and b/JWilson/Flask/ninjas/static/imgs/purple.jpg differ diff --git a/JWilson/Flask/ninjas/static/imgs/red.jpg b/JWilson/Flask/ninjas/static/imgs/red.jpg new file mode 100755 index 0000000..57fb2a3 Binary files /dev/null and b/JWilson/Flask/ninjas/static/imgs/red.jpg differ diff --git a/JWilson/Flask/ninjas/static/imgs/tmnt.png b/JWilson/Flask/ninjas/static/imgs/tmnt.png new file mode 100644 index 0000000..941c82e Binary files /dev/null and b/JWilson/Flask/ninjas/static/imgs/tmnt.png differ diff --git a/JWilson/Flask/ninjas/templates/index.html b/JWilson/Flask/ninjas/templates/index.html new file mode 100644 index 0000000..540dd3b --- /dev/null +++ b/JWilson/Flask/ninjas/templates/index.html @@ -0,0 +1,30 @@ + + + + Dojo Survey + + + + + + + + +
+

NO NINJAS HERE!

+ +
+ + + + + + + + + + +
+
+ + diff --git a/JWilson/Flask/ninjas/templates/ninja.html b/JWilson/Flask/ninjas/templates/ninja.html new file mode 100644 index 0000000..a9d9c7e --- /dev/null +++ b/JWilson/Flask/ninjas/templates/ninja.html @@ -0,0 +1,31 @@ + + + + Dojo Survey + + + + + + + + +
+

Teh Turtles:

+ +
+ + + + + + + + + + + +
+
+ + \ No newline at end of file diff --git a/JWilson/Flask/templates/index.html b/JWilson/Flask/templates/index.html new file mode 100644 index 0000000..792e7ef --- /dev/null +++ b/JWilson/Flask/templates/index.html @@ -0,0 +1,5 @@ + + +

Hello World!

+ + \ No newline at end of file diff --git a/JWilson/Flask/templates/success.html b/JWilson/Flask/templates/success.html new file mode 100644 index 0000000..372b307 --- /dev/null +++ b/JWilson/Flask/templates/success.html @@ -0,0 +1,5 @@ + + +

Yay you successfully created another GET route that serves a page!

+ + diff --git a/JWilson/Flask/test_templates/server.py b/JWilson/Flask/test_templates/server.py new file mode 100644 index 0000000..7ee0d1b --- /dev/null +++ b/JWilson/Flask/test_templates/server.py @@ -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) \ No newline at end of file diff --git a/JWilson/Flask/test_templates/templates/index.html b/JWilson/Flask/test_templates/templates/index.html new file mode 100644 index 0000000..b0f63e3 --- /dev/null +++ b/JWilson/Flask/test_templates/templates/index.html @@ -0,0 +1,16 @@ + + + My First Template + + +

My flask template with embedded Python-like code

+

Phrase {{ phrase }}

+

Times: {{ times }}

+ {% for x in range (0,times): %} +

{{ x }}

+ {% endfor %} + {% if phrase == "hello" %} +

The phrase says hello

+ {% endif %} + + \ No newline at end of file diff --git a/JWilson/mySQL/Books b/JWilson/mySQL/Books new file mode 160000 index 0000000..c705b4e --- /dev/null +++ b/JWilson/mySQL/Books @@ -0,0 +1 @@ +Subproject commit c705b4e66a3b5d42f2d0dddbc86a8057e6a2fc5c