I
I
idin2017-01-11 11:40:17
Flask
idin, 2017-01-11 11:40:17

I am a teapot. Where can I read about Python Flask module imports, and how can I understand this code structure??

from flask import Flask

app = Flask(__name__)
from app import views

from app import app

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


I interpret it like this
- the module is
connected - the app object is created, __name__ is passed to it, which in this case equals __main__
- and then the modules are imported from the object (but the module is not imported when files are connected, why the object is accessed), and in general the question is how can I understand this where to read about it, I read one book fluently, but I didn’t find it there, now I downloaded the lutz, but I would like to slowly pull up flask)) help )) I will be grateful))

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Shubin, 2017-01-11
@Izy

Read a series of articles on Flask.

T
Tremo, 2017-01-11
@tremo0880

I started from here
https://youtu.be/Lv1fv-HmkQo?list=PLQVvvaa0QuDc_ow...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question