Skip to content

Repository files navigation

Python Django - Build Complex MultiVendor Ecommerce System

This is a multivendor Ecommerce project that uses django, geodjango and some integrations with Google APIs.

Project Flowchart

Project Flowchart

Section 6: Custom User Model, Media Files & Django Signals

23. Custom User Model

To create a Custom User Model in Django we can do the following:

  • Create a new User model that inherits from either AbstractBaseUser or AbstractUser class, which are imported from django.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

24. Make Password Noneditable

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.py
    1. from django.contrib.auth.admin import UserAdmin
    2. Create a class CustomUserAdmin(UserAdmin)
    3. For more information and detail click here: CustomUserAdmin

27. Media Files Configuration

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

28. Django Signals to Create User Profile

To learn more about Django Signals click here: Django Signals

About

This is a repository for all django projects

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages