سؤال

I want to extend my User by creating a UserProfile object. I'm following this example:

Creating a extended user profile

Silly question, but ...errr... where is this file supposed to reside / be called so every time the user is created, this function will fire. Is the settings.py file a good location? I'm assuming the user is called in "createsuperuser" and on the register page of my site.

Thanks for your time.

هل كانت مفيدة؟

المحلول

It doesn't matter where it is located, though it is typically found in the same location as models.py. To ensure that it is called just do import signals after your models are defined in models.py.

نصائح أخرى

I think, you want to have a custom user model.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top