This is a multivendor Ecommerce project that uses django, geodjango and some integrations with Google APIs.
To create a Custom User Model in Django we can do the following:
- Create a new User model that inherits from either
AbstractBaseUserorAbstractUserclass, which are imported fromdjango.contrib.auth.models, depending on what you want to do, here's an explanation on the difference between both inherited classes. Creating Custom User Models - When creating a Custom User Model you too need to use a Custom User Manager
When creating a custom user model we will have to add certain rules to avoid the password being editable from the Django Admin Panel.
- In our
admin.pyfrom django.contrib.auth.admin import UserAdmin- Create a class
CustomUserAdmin(UserAdmin) - For more information and detail click here: CustomUserAdmin
The configurations of media files and static files are independent from one another, to check the difference and more info about both click here: Media VS Static
To learn more about Django Signals click here: Django Signals