35👍
✅
While looking into the settings documentation for a project of my own I stumbled upon a setting that reminded me of your question.
Since Django 1.7 there is a setting to silence certain warnings. If you are using Django 1.7 or later you can add the error code to the SILENCED_SYSTEM_CHECKS
setting:
# settings.py
SILENCED_SYSTEM_CHECKS = ["auth.W004"]
Source: https://docs.djangoproject.com/en/1.7/ref/settings/#silenced-system-checks
-2👍
Warnings are there to help you, so mostly it is best to improve your code to avoid them.
In this case you really do not want to turn of that warning. If you read the warning, you see that currently there can be two different users with the same username!
To solve this, you should make the email
field unique by adding unique=True
to the field definition:
email = models.EmailField(unique=True)
- Django raises MultiValueDictKeyError in File Upload
- Can't git-push to heroku due to "Build stream timed out"
- "Returning to that page might cause any action you took to be repeated" – Django
- Django global variable
- 'TemplateDoesNotExist' error with creating Sitemap for Django app
Source:stackexchange.com