how to create table from model

11 views
Skip to first unread message

atul anand

unread,
Aug 5, 2020, 7:46:31 AM8/5/20
to Django users
Hi All,

I am new to Django. I want to create tables by using models.

models.py
from django.db import models


# Create your models here.
class Person(models.Model):
id = models.AutoField(primary_key=True)
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
I have registered the app and provided connection details of the DB.

But when I tried to run makemigrations and migrate, it's not identifying the changes.
python manage.py makemigrations
No changes detected

python manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
  No migrations to apply.

any help would be appriciated.

Yemin Sajid

unread,
Aug 5, 2020, 9:04:56 AM8/5/20
to django...@googlegroups.com
Can you share your settings.py file? I think the app that you have created is not listed under the INSTALLED_APPS section there.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e8f15897-5729-4b51-9ab3-bec0c159dcfco%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages