diff --git a/README.md b/README.md index cae435a09..d671ec17a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Flask Portfolio App for The Profitable Programmer Students... Flask Portfolio App for students @ Clever Programmer deployed from Cloud 9 - +test [![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) ## LIVE PORTFOLIO APP... -https://my-portfolio-with-flask.herokuapp.com/ +https://cp-sam-flask-portfolio.herokuapp.com/ diff --git a/app.py b/app.py index c36e031f2..5142a00a1 100644 --- a/app.py +++ b/app.py @@ -15,7 +15,8 @@ def home_page(): @app.route('/') def profile(name): - return render_template('index.html', name=name) + greets = 'Cool to see you ' + name + return render_template('index.html', name=greets) @app.route('/add_numbers', methods=['GET','POST']) @@ -35,6 +36,23 @@ def add_numbers_post(): return "Easy now! Let's keep it simple! 2 numbers with a space between them please" +@app.route('/multiply_numbers', methods=['GET','POST']) +def multiply_numbers_post(): + # --> ['5', '6', '8'] + # print(type(request.form['text'])) + if request.method == 'GET': + return render_template('multiply_numbers.html') + elif request.method == 'POST': + print(request.form['text'].split()) + total = 1 + try: + for str_num in request.form['text'].split(): + total *= int(str_num) + return render_template('multiply_numbers.html', result=str(total)) + except ValueError: + return "Easy now! Let's keep it simple! 2 numbers with a space between them please" + + @app.route('/shopping_list', methods=['GET','POST']) def shopping_list_post(): # --> ['5', '6', '8'] diff --git a/static/img/multiply_preview.png b/static/img/multiply_preview.png new file mode 100644 index 000000000..07a888e7e Binary files /dev/null and b/static/img/multiply_preview.png differ diff --git a/templates/blog.html b/templates/blog.html new file mode 100644 index 000000000..897bb395d --- /dev/null +++ b/templates/blog.html @@ -0,0 +1,211 @@ + + + + +{% block head %} + + + + + + + + {% block title %}About{% endblock %} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Skip to main content
+ + + + +{% endblock %} + +
+ {% block content%} +
+
+
+ +
+

Hey there {{name}}!

+
+ Blog +
+
+
+
+
+ + + +
+
+
+
+

Portfolio

+
+
+
+ +
+
+ + +
+
+
+
+

About

+
+
+
+
+
+

I love the Flask Framework. I can make so many things simply by leveraging code that other people have made for me to use

+
+
+

The languages that you see on this app are HTML, CSS, Python and some JavaScript. By using this BootStrap template I saved myself a lot of time. Instead of creating the HTML and CSS from scratch I was able to edit the template to the way I wanted it to look like.

+
+
+
+
+ +{% endblock %} + + {% block footer %} + + + + + + + + diff --git a/templates/index.html b/templates/index.html index 1474e542d..1b5f05158 100755 --- a/templates/index.html +++ b/templates/index.html @@ -80,9 +80,9 @@
- +
-

Hey there {{name}}!

+

Hey Clever Programmer {{name}}!


Python Developer - Flask Framework
@@ -103,35 +103,48 @@

Portfolio

- +
- Slice of cake + Samuel Hartmann Logo
+
Webdesign
+
+
+
diff --git a/templates/multiply_numbers.html b/templates/multiply_numbers.html new file mode 100644 index 000000000..6d3f9125d --- /dev/null +++ b/templates/multiply_numbers.html @@ -0,0 +1,67 @@ +{% extends "index.html" %} + +{% block title %}Multiplication{% endblock %} + +{% block content %} + +
+
+
+ +
+

+
+ Let's multiply some numbers! +
+
+
+
+ + + + +
+
+
+
+

Multiply Numbers

+
+
+
+
+
+ + +
+
+
+ + +

+
+
+
+
+
+
+
+ +

+
+
+
+
+

Answer = {{result}}

+
+
+
+ +
+
+
+{% endblock %} + +{% block footer%} +{% endblock %} + + diff --git a/templates/python_apps.html b/templates/python_apps.html index cf743d352..8bfc71b13 100644 --- a/templates/python_apps.html +++ b/templates/python_apps.html @@ -64,6 +64,17 @@

Current Time

Circus tent + +
+

Multiplication

+ +
+
+ +
+
+ preview image +