RuntimeError at /
Model class msv.models.Post doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
APP core запущена и прописана
models.py
# -*- coding: utf-8 -*- from django.db import models from django.contrib import admin # Create your models here. class Post(models.Model): title = models.CharField(max_length=128, verbose_name = u"Заголовок") desc = models.TextField(verbose_name = u"Текст новости") datetimestamp = models.DateTimeField(auto_now=True, verbose_name = u"Дата\Время") url = models.URLField('Ссылка', max_length=255) def __unicode__(self): return unicode(self.title) admin.site.register(Post)
часть вьюхи:
def main_post(request): Zag = "Заголовок" posts=Post.objects.all() #print post.url #return render_to_response('html/right.html', {"posts": posts}) return render_to_response( 'right.html', locals() )
settings.py
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', # Uncomment the next line to enable the admin: 'django.contrib.admin', 'core', #' msv.core.models.Post' # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', )
Django version 1.9