learning django recently and ran into a problem with Django. This is my models.py:
# -*- coding:utf-8 -*-
#/usr/bin/env python
from django.db import models
# Create your models here.
class Article(models.Model):
title = models.CharField(max_length = 100)
category = models.CharField(max_length=50,blank=True)
date_time = models.DateTimeField(auto_now_add=True)
content = models.TextField(blank=True,null=True)
def __unicode__(self):
return self.title
class Meta:
ordering = ['date_time']
first I input these in cmd:
- python manage.py migrate
- python manage.py makemigrations
- python manage.py migrate
but when, in the Django shell, I input this code:
from article.models import Article
Article.objects.create(title = 'Hello World', category = 'Python', content = 'what')
I received this error message:
OperationalErrors:no such table:article_ article
what's wrong? thanks for your help