I am creating an application according to the tutorial.
http://study-flask.readthedocs.io/ja/latest/02.html
While we are proceeding with the tutorial as shown in ,
import sqlite3
from flash import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
from contextlib import closing
DATABASE='/tmp/flaskr.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME='admin'
PASSWORD = 'default'
app = Flask(__name__)
app.config.from_object(__name__)
The code came out.This,
app.config.from_object(__name__)
I don't know what the role is.In the tutorial, it was written that capitalization variables are collected, but what should I do after collecting them?
python flask
capitalization variable group written on the module
DATABASE='/tmp/flaskr.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME='admin'
PASSWORD = 'default'
What did you mean by
Didn't you write it because you thought it was a Flask application configuration?
The line says, "This module is an object for configuring the Flask application, so please read the (uppercase-only variable) from this module as the configuration."
The configuration files themselves are actual Python files.Only
values in uppercase are actually stored in the config object later on.
Make sure to use uppercase letters for your config keys.
http://flask.pocoo.org/docs/1.0/config/ #configuring-from-files
581 PHP ssh2_scp_send fails to send files as intended
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.