Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Touch up formatting#3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
brettcannon wants to merge4 commits intomicrosoft:masterfrombrettcannon:master
Closed
Show file tree
Hide file tree
Changes fromall 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
7 changes: 5 additions & 2 deletionshello_app/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
from flask import Flask
app = Flask(__name__)
import flask


# Defined here to prevent circular imports.
app = flask.Flask(__name__)
5 changes: 3 additions & 2 deletionshello_app/app.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
from hello_app import app
from hello_app import views
"""Entry point for the application."""
from hello_app import app # For application discovery by the 'flask' command.
from hello_app import views # For import side-effects of setting up routes.

# Time-saver: output a URL to the VS Code terminal so you can easily Ctrl+click to open a browser
# print('http://127.0.0.1:5000/hello/VSCode')
36 changes: 20 additions & 16 deletionshello_app/views.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
from datetime import datetime
from flask import Flask, render_template
import datetime

import flask

from hello_app import app

@app.route('/')

@app.route("/")
def home():
return render_template("home.html")
return flask.render_template("home.html")


@app.route('/about')
@app.route("/about")
def about():
return render_template("about.html")
returnflask.render_template("about.html")

@app.route('/contact')

@app.route("/contact")
def contact():
return render_template("contact.html")
return flask.render_template("contact.html")


@app.route('/hello/<name>')
@app.route("/hello/<name>")
def hello_there(name):
return render_template(
"hello_there.html",
name=name,
date=datetime.now()
)
date = datetime.datetime.now()
return flask.render_template("hello_there.html", name=name, date=date)


@app.route('/api/data')
@app.route("/api/data")
def get_data():
return app.send_static_file('data.json')
return app.send_static_file("data.json")
1 change: 1 addition & 0 deletionsrequirements.in
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
Flask~=1.0.2

[8]ページ先頭

©2009-2025 Movatter.jp