E:\pythonPrj\CICD-TEST\venv\Scripts\python.exe E:/pythonPrj/CICD-TEST/flask_test.py
* Serving Flask app 'app'(lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 338-955-284
* Running on all addresses.
WARNING: This is a development server. Do not use it in a production deployment.
* Running on http://192.168.3.8:8084/ (Press CTRL+C to quit)
Access denied:error=The session is unavailable because no secret key was set. Set the secret_key on the application to something unique and secret.
3. The root cause of the error:
Session background: In flask, after the user logs in, the logged-in user information is stored through the session method, which is convenient for identifying the logged-in user's information in the web page, or carrying the user's information to complete some data persistence operations.
Source of error: using session in flask requires configuring keys, and in flask requires manually configuring keys. django will automatically generate secret_key.
4. Solutions:
Add SECRET_KEY = 'zidingyisecretkey' in the configuration file, just copy mine and add it to the config file.