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 574135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:47:56+00:00 2026-05-13T13:47:56+00:00

I run a Pinax-site for collaborative purposes. I added ‘account.middleware.AuthenticatedMiddleware’ to ‘MIDDLEWARE_CLASSES’ in order

  • 0

I run a Pinax-site for collaborative purposes. I added ‘account.middleware.AuthenticatedMiddleware’ to ‘MIDDLEWARE_CLASSES’ in order to not allow anonymous access to anything on the site.

But now I need public APIs to be enabled. Is there any solutions besides adding ‘login_required’-decorator at all the views that still need to be private?

edit
Gregor Müllegger answer doesn’t work. settings.AUTHENTICATED_EXEMPT_URLS seems to get overwritten somewhere in the code

class AuthenticatedMiddleware(object):
    def __init__(self, login_url=None, redirect_field_name=REDIRECT_FIELD_NAME):
        if login_url is None:
            login_url = settings.LOGIN_URL
        self.redirect_field_name = redirect_field_name
        self.login_url = login_url
        self.exemptions = [
            r"^%s" % settings.MEDIA_URL,
            r"^%s" % settings.STATIC_URL,
            r"^%s$" % login_url,
        ] 
        print "settings.AUTHENTICATED_EXEMPT_URLS ",settings.AUTHENTICATED_EXEMPT_URLS
        if ( settings.AUTHENTICATED_EXEMPT_URLS):
            self.exemptions += settings.AUTHENTICATED_EXEMPT_URLS


print "settings.AUTHENTICATED_EXEMPT_URLS ",settings.AUTHENTICATED_EXEMPT_URLS

doesn’t print my settings but this:

settings.AUTHENTICATED_EXEMPT_URLS  ['^/account/signup/$', '^/account/password_reset', '^/account/confirm_email', '^/openid']

I will try to fix it.

  • 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-05-13T13:47:56+00:00Added an answer on May 13, 2026 at 1:47 pm

    Have a look at the source code of AuthenticatedMiddleware.

    It reveals that there is a setting called AUTHENTICATED_EXEMPT_URLS. It can contain regular expressions that are left public. Set it to something like this in your settings.py:

    AUTHENTICATED_EXEMPT_URLS = (r"^api/",)
    

    This will make any URLs below /api/ available without being logged in.t

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I run a site where it is important to have good and simple URLs
Is there a way to run Pinax without virtualenv? I want to run it
I run into a small problem (Not surprisingly, 'cause I've just started with xcode).
I run the simple examples in the android dev site of tab widget: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
I run unsuccessfully in my .zshrc unalias rm rm() { mv $* /tmp/wastebasket }
I run several queries from mysql command line on my linux box (Fedora Os).
I run the following command in Emacs unsuccessfully C-u How can you clear the
I run MSIL inside Visual Studio or via Mdbg. Is there any way of
I run into follow problem. Did I miss anything? Association.all().count() 1 Association.all().fetch(1) [Association(**{'server_url': u'server-url',
Duplicate: Run .NET exe in linux Hello, Is it possible to make my existing

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.