In the address bar of the web browser, type the URL of our web application, in our case, https://giazax.pythonanywhere.com/. The site shows a simple welcome phrase:
giazax.pythonanywhere.com site page
The source code for this application can be seen by selecting Go to directory in correspondence with the Source code label:
PythonAnywhere: Configuration page
Here, it is possible to analyze the files that make up the web application:
PythonAnywhere: Project site repository
It is also possible to upload new files and possibly modify the contents. Here, we select the flask_app.py file of our first web application. The content looks like a minimal Flask application:
# A very simple Flask Hello World app for you to get started with...
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello from Flask!'
The route() decorator is used by Flask to define the URL that should trigger the hello_world function. This simple function returns the message displayed in the web browser.