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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:09:10+00:00 2026-06-13T23:09:10+00:00

I am using django-guardian to handle object permissions. In my settings.py: ANONYMOUS_USER_ID = -1

  • 0

I am using django-guardian to handle object permissions. In my settings.py:

ANONYMOUS_USER_ID = -1

However, when I try to run the server, I get an improperly configured error:

django.core.exceptions.ImproperlyConfigured: In order to use django-guardian's ObjectPermissionBackend authorization backend you have to configure ANONYMOUS_USER_ID at your settings module

I suspect this may be due to the fact that I do from guardian.shortcuts import assign at the top of my settings.py, but I am not sure. Commenting out the import results in a successful server start, but trying to access any page gives me AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF' which suggests that something is wrong with settings altogether (perhaps they are not being found correctly?).

  • 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-13T23:09:11+00:00Added an answer on June 13, 2026 at 11:09 pm

    I’ve just made myself sure that after following configuration instructions from http://packages.python.org/django-guardian/configuration.html project runs smoothly with guardian (using Django 1.4).

    … and to answer your question:

    1. Try to avoid importing stuff inside settings module. If you do, make absolutely sure there are no circular imports issue. Actually, you have exactly that issue. If you need to, you can i.e. use *post_syncdb* signal: (https://docs.djangoproject.com/en/dev/ref/signals/#post-syncdb). In your case it shouldn’t be needed, though, as you’ve already stated that removing that import fixed problem with running command (so settings module hasn’t used assign shortcut anyway).

    2. ROOT_URLCONF attribute should definitely be set (it is if you generate project with Django’s build-in command (i.e. django-admin.py startproject myproject). If it’s missing, then yep, your configuration is broken. Try settings that attribute to something like 'myproject.urls' (or wherever your main urls are) and check if that fixes the problem.

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

Sidebar

Related Questions

Trying to edit object permissions using django-guardian in the admin site I get this
Projects such as Django-guardian and django-permissions enables you to have object level permissions. However,
I'm currently writing a site which uses django-guardian to assign object-level permissions which are
i'm using Django to develop a web application. When i try and run it
Using django, I'm trying to get a QuerySet of FK relationships from another QuerySet.
using django 1.4 im getting a 403 error when i try to do a
I've been using django-auth-ldap for a while to auth against a single server (AUTH_LDAP_SERVER_URI
When using django with apache which is the best server config? Should I use
Using django, I am authenticating the user through Google. I get the initial request
Using Django 1.2, I'm running the django-registration application, and creating a User Profile object

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.