models - importError: No module named django.db -
from django.db import models # create models here. def article(models.model): title=models.charfield(max_length=200) body=models.textfield() pub_date=models.datetimefield('date published') likes=models.integerfield() def __unicode__(self): return self.title
this code using django 1.8.2 within virtual environment
are sure create simple project?
django-admin.py startproject nameofyourproject
mkdir apps
cd apps
django-admin.py startapp nameofyourapp
add in settings in variable "installed apps" new app
nothing should fail...
Comments
Post a Comment