Jonnie Grieve Digital Media: Blog

Home
by on 14th May, 2021 - 5:10pm (0)

Blog: R7D19: #100DaysOfCode (More Posts)

Today has been less about sitting and coding at my computer and more about tying up some loose ends. I devoted my time to upgrading my coding infrastructure. This is pretty time-consuming which is why I don’t often do it, but it is worth doing so I’m glad I took the time to do it.

It must have taken me around 3 or 4 hours to…

  • Updating PHP, PHPMyAdmin and Xammp to upgrade PHP
  • Upgrade Python
  • Backup up SQL Databases for my WordPress websites both on localhost and my web host to reintegrate my work as it was before

I had multiple versions of Python installed including the latest (3.9.5) but despite tinkering around with the environment variables only the outdated 2.7 version was showing up.

Finally managed to get PHP, Python and my local server environment sorted out on PC and Laptop by uninstalling every instance and automatically adding the environment path in an installation of 3.9.

I did the same check on my laptop and it was already showing up as 3.9 on the git bash command line.  I can’t even remember when and how I managed that but it with all of this my behind-the-scenes infrastructure is now finally up to date.

Which meant I was able to have a quick play with Flask.

# import flask class
from flask import Flask



app = Flask (__name__)  # use whatever the current namespace is


@app.route("/")
def index():
    return "Hello, World!"

app.run(debug=True, port=8000, host='0.0.0.0')

The first thing I notice with this right away is that flask in its most basic form seems to be nothing more than Python’s answer to express.  It imports methods from a built-in module, takes in routes/controllers, and outputs information to a view.  I’m new to Flask so I am wondering if it is going to be easier than full stack JavaScript frameworks to upload my work to a server.

This post has been assigned to the following categories

    Leave a Reply

    Your email address will not be published. Required fields are marked *