Customizing authentication in Django by creating a custom user model
-
Create virtualenv
pipenv install django <- install django using pipenv pipenv shell <- activate virtualenv
-
Start Django project
django-admin startproject custom python manage.py startapp accounts
Add
'accounts'
in settings.pyINSTALLED_APPS
-
Creating custom model in accounts/models.py and registering the model in accounts/admins.py. Checkout the code from the repo.
-
Running the
makemigrations
andmigrate
commandspython manage.py makemigrations python manage.py migrate
-
Creating super user
python manage.py createsuperuser