You must create a migration, where you will specify default value for a new field, since you don’t want it to be null. If null is not required, simply add null=True
and create and run migration.
More Related Contents:
- Django dynamic model fields
- How do I filter query objects by date range in Django?
- Django set default form values
- How to create an object for a Django model with a many to many field?
- django abstract models versus regular inheritance
- Django post_save() signal implementation
- Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries
- Get all related Django model objects
- difference between filter with multiple arguments and chain filter in django
- LEFT JOIN Django ORM
- Django Rest Framework and JSONField
- django.db.migrations.exceptions.InconsistentMigrationHistory
- Django: OperationalError No Such Table
- Django Blob Model Field
- Django Many-to-Many (m2m) Relation to same model
- How to have a Python script for a Django app that accesses models without using the manage.py shell?
- How to display uploaded images in “Change List” page in Django Admin?
- How to change the file name of an uploaded file in Django?
- How to monkey patch Django?
- Easiest way to rename a model using Django/South?
- models.py getting huge, what is the best way to break it up?
- matching query does not exist Error in Django
- Django admin file upload with current model id
- one-to-many inline select with django admin
- Identify the changed fields in django post_save signal
- How can I set two primary key fields for my models in Django?
- Django 2.1.3 Error: __init__() takes 1 positional argument but 2 were given
- Django foreign key relation in template
- Django get_profile() method not working on extended User model
- How to delete a record in Django models?