web-dev-qa-db-ja.com

Netlocはどういう意味ですか?

私はflask-loginでログイン関数を作成することを学んでいます、そして私のチュートリアルでこのコードに直面しています:

@app.route('/login', methods = ['GET', 'POST'])
def login():
    if current_user.is_authenticated:
        return redirect(url_for('index'))
    form = LoginForm()
    if form.validate_on_submit():
        user = User.query.filter_by(username=form.username.data).first()
        if user is None or not user.check_password(form.password.data):
            flash('Invalid username or password')
            return redirect(url_for('login'))
        login_user(user, remember=form.remember_me.data)
        next_page = request.args.get('next')
        if not next_page or url_parse(next_page).netloc != '': # what is it means in this line..?
            next_page = url_for('index')
        return redirect(next_page)
    return render_template('login.html', title='Sign In', form=form)
 _

しかし、私がコメントしたという上記のコードは何であるかわからない。特にNetLocの単語、それは何ですか?私は知っていますそれはネットワークの地域のためのものですが、その行の目的は何ですか?

16
Tri
import urllib.parse
url="https://google.com/something?a=1&b=1"
o = urllib.parse.urlsplit(url)
print(o.netloc)
 _

google COM

0
pymen