Can I add gavtar (imagefield) in future
Closed this issue · 3 comments
- Django use Email as Username version:
$ pip install django-use-email-as-username
Collecting django-use-email-as-username
Downloading django_use_email_as_username-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: django>=1.11 in /home/simha/.local/share/virtualenvs/btgapp_django_email-kAyyVEt7/lib/python3.6/site-packages (from django-use-email-as-username)
Requirement already satisfied: pytz in /home/simha/.local/share/virtualenvs/btgapp_django_email-kAyyVEt7/lib/python3.6/site-packages (from django>=1.11->django-use-email-as-username)
Installing collected packages: django-use-email-as-username
Successfully installed django-use-email-as-username-1.0.0
- Django version:
$ python -m django --version
2.0.3
- Python version:
$ python --version
Python 3.6.0
- Operating System:
$ lsb_release -a
LSB Version: 1.4
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a
$ uname -a
Linux gauranga 4.10.2-1-ARCH #1 SMP PREEMPT Mon Mar 13 17:13:41 CET 2017 x86_64 GNU/Linux
Description
I want in future to add gavtar (imagefield) Is it possible
What I Did
I havent tried anything yet
Also if this is such an important thing to do, why django didnt made it compulsory. Because i was in the middle of a project and now i have to create again from scratch
Once you have a project running and you want to change the User model, your users table will change.
The table for your new model will be used to retrieve tbe data.
It can be done, but you have to migrate all the data from your current table to the new one.
Once that is done, you can modify your model as much as you want in the future, since your table will be the same.
All you will need to do is run migrations everytime you modify your model.
yes, thanks, great job.
The reason why Django does not make this step compulsory, is that if the default model satisfies you use case, you can later use a related model to add extra information, like a profile, to the User model.
Using a custom User model is an option, but not the only option.