Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8848499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:26:13+00:00 2026-06-14T12:26:13+00:00

Like this question: Best way to make Django's login_required the default I’m using Flask-Login

  • 0

Like this question: Best way to make Django's login_required the default

I’m using Flask-Login‘s login_required decorator now. Is there anyway to make it the default behavior in Flask?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:26:14+00:00Added an answer on June 14, 2026 at 12:26 pm

    I did this in my instruments project. I use the before_request decorator:

    @app.before_request
    def check_valid_login():
        login_valid = 'user' in session # or whatever you use to check valid login
    
        if (request.endpoint and 
            'static' not in request.endpoint and 
            not login_valid and 
            not getattr(app.view_functions[request.endpoint], 'is_public', False) ) :
            return render_template('login.html', next=request.endpoint)
    

    and I then created an is_public() decorator for the few places that would need to be accessible without login:

    def public_endpoint(function):
        function.is_public = True
        return function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay guess this question looks a lot like: What is the best way to
This is a best practices question Let say, I have a class object, like
This may seem like an absurd question, however thought I best double check beforehand.
(This question is about the best way to temporarily and programatically keep new records
I have asked this question What is the best way to dynamically load connection
I hope it's ok to make a posting like this. I have been using
As an alternative to this question what is the best way to manage custom
I know this question has been asked, how to make a site like facebook/gmail
Like this question , except T-SQL instead of php. 206275947 = 2062759.47 etc. The
Looks like this question has been asked thousand times already, but each person's configuration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.