D
D
Damn2019-02-26 23:08:20
Django
Damn, 2019-02-26 23:08:20

What is the model error on Heroku?

I uploaded the site to heroku and for some reason he swears at the model, so the bootstrap hooked
5c759c7ef13d6671391990.png
MODELS.PY

from django.db import models
class Post(models.Model):

    class Meta():
        db_table = "post"
        verbose_name = "Новость"
        verbose_name_plural = "Новости"
        ordering = ["create"]

    title = models.CharField("Заголовок", max_length=100)
    text = models.TextField("Текст", max_length=1000)
    image = models.ImageField("Изображение", upload_to="news/", blank=True)
    create = models.DateTimeField("Опубликована", auto_now_add=True)
    update = models.DateTimeField("Изменена", auto_now_add=True)
    moder = models.BooleanField("Модерация")

    def __str__(self):
        return self.title

VIEWS.PY
def post_list(request):
    post = Post.objects.filter()
    return render(request, '../templates/home/home.html', {'posts': post}, locals())


def post_single(request, pk):
    post = get_object_or_404(Post, pk=pk)
    return render(request, '../templates/home/single_news.html', {'post': post})

What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-02-27
@afilmofog

Add a release phase to the Procfile.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question