1👍
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:
-
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). -
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👍
For the record, I encountered the same issue with the last official release (installed with a simple pip install django-guardian)
This does not happen when you install the version from the lukaszb’s git repository, I double checked the source code
- [Answer]-Global variables don't works in Django shell
- [Answer]-Difficulty opening port 5432 for PostgreSQL on Ubuntu 12.04
- [Answer]-Filter the data from database using django filter
- [Answer]-How can I include sub-templates in a dynamically created template?