(no title)
c6401 | 1 year ago
from django.db import models
from django.db import connection
class MyModel(models.Model):
name = models.CharField(max_length=255)
class Meta:
app_label = 'myapp'
with connection.schema_editor() as schema_editor:
schema_editor.create_model(MyModel)
# from django.core.management import call_command
# call_command('makemigrations', 'myapp')
# call_command('migrate', 'myapp')
No comments yet.