python - When is django.conf.global_settings loaded? -
I created a custom user model using the "AbstractUser" model. and I have set When I executed the So, I have two questions. and I Since you override it in your settings, you should import it instead. But as the documentation says, the method of importing an existing setting is always, instead of importing the settings file into your project, there is Also note that instead of using everyone's settings here - which may be due to some dependency issue at startup - you can get from AUTH_USER_MODEL to
settings / base.py (I file Ex: settings / base.py, settings / develop.py) in the settings of each environment.
AUTH_USER_MODEL = 'myapp.MyCustomUser'
python manage.py syncdb , my console window is deegen Has been flared by!
myapp.MyObject: The 'owner' model defines a relationship with 'auth.User', which has been swapped out. Update the relationship to point to the setting AUTH_USER_MODEL
myproject.settings ?
myproject.settings.base import from AUTH_USER_MODEL at this time.
global_settings , as the name implies, The default settings are definitely the default 'auth.user'.
.
get_user_model () to
django .contrib.auth should be used, as explained in.
Comments
Post a Comment