Create a model field within models.py file
class Contact(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField(max_length=100)
subject = models.CharField(max_length=100)
message = models.TextField()
mobile = models.IntegerField(max_length=180)
created_on = models.DateTimeField(auto_now_add=True)
Associate with settings.py
INSTALLED_APPS = [
'contact.apps.ContactConfig',
]
Run migrations command
python manage.py makemigrations
Check Migration
python manage.py showmigrations
python manage.py migrate
Top comments (1)
We encourage the entire article to be published on DEV.to (if you have proper rights), with a linkback if appropriate. Otherwise, we recommend original material, such as an original commentary on the article. From the Terms of Use:
Posts that are simply intended to encourage readers to view an external resource are discouraged.
Thank you.