Проблема с формами в Django

Не получается решить проблему с формами в Django, пытался сначала через обычную функцию в views.py, потом и через класс CreateView, но прогресса нет.

А также, я заметил, что объект, отправляемый из views.py, не доходит до шаблона (newcars.html)

models.py :

from django.urls import reverse
from django.db import models

# Create your models here.

class Cars(models.Model):
    title = models.CharField(max_length=255, verbose_name="Название")
    slug = models.SlugField(verbose_name="URL", unique=True, db_index=True, max_length=255)
    content = models.TextField(verbose_name="Характеристика", null=True)
    time_create = models.DateField(verbose_name='Дата публикации', auto_now_add=True)
    is_published = models.BooleanField(default=True )
    brand = models.ForeignKey('Brands', on_delete=models.PROTECT)

    def __str__(self):
        return self.title

    def get_absolute_url(self):
        return reverse('car_slug', kwargs={'car_slug': self.slug})

    class Meta:
        verbose_name = 'Машины'
        verbose_name_plural = 'Машины'


class Brands(models.Model):
    name = models.CharField(verbose_name="Бренды", max_length=250)
    slug = models.SlugField(verbose_name="URL", unique=True, db_index=True, max_length=255)


    def __str__(self):
        return self.name

    class Meta:
        verbose_name = "Бренды"
        verbose_name_plural = 'Бренды'

forms.py :

from django.core.exceptions import ValidationError
from django import forms

from .models import *

class AddPostForm(forms.Form):
    class Meta:
        model = Cars
        fields = ['title', 'slug', 'content', 'is_published', 'brand']

views.py:

from django.views.generic import ListView, DetailView, CreateView
from django.shortcuts import render, redirect
from .models import *
from .forms import *




class index(ListView):
    model = Cars
    template_name = 'hello/index.html'
    context_object_name = 'cars'

    def get_context_data(self, *, object_list=None, **kwargs):
        context =  super().get_context_data(**kwargs)

        context['title'] = 'HI W'
        return context

    


class car_slug(DetailView):
    model = Cars
    template_name = 'hello/car_slug.html'
    slug_url_kwarg = 'car_slug'
    context_object_name = 'car'

    def get_context_data(self, *, object_list=None, **kwargs):
        context = super().get_context_data(**kwargs)
        return context




class newcars(CreateView):
    form_class = AddPostForm
    template_name = 'hello/newcars.html'

newcars.html :

{% extends 'hello/base.html' %}
{% load static %}

{% block content %}
<form action="{% url 'newcars' %}" method="post">
    {% csrf_token %}
    
    
    <div>{{ form.non_field_errors }}</div>

    {% for f in form %}
        <p><label for="{{ f.id_for_label }}">{{ f.label }}: </label>{{ f }}</p>
        <div>{{ f.errors }}</div>
    {% endfor %}

    <button type="submit">Добавить</button>
</form>

{% endblock %}
Вернуться на верх