Django Cookiecutter: How to import AUTH_USER_MODEL in config/settings/base.py? -


as know, django-cookiecutter has different setup settings files. regular from django.conf import settings doesn't work here.

i want reference custom user model defined in base.py file in settings directory. ideas?

below project layout:

repository/     config/         settings/             __init__.py             base.py # auth_user_model variable defined             local.py             production.py             test.py     app_dir/         users/             __init__.py             models.py # custom user model stored 

i tried import custom user model directly users/models.py below:

from users.models import user 

but got following error:

runtimeerror: model class users.models.user doesn't declare  explicit app_label , isn't in application in installed_apps. 

tried following, , seems work far:

from config.settings.base import auth_user_model 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -