Ok so i am getting an operational error where the request method is POST when I try to add a product through the admin panel. This is the view of the error
Here is some relevant code I used
models.py
from django.db import models
class Product(models.Model):
name = models.CharField(max_length=255)
price = models.FloatField()
stock = models.IntegerField()
image_url = models.CharField(max_length=2100)
class Offer(models.Model):
code = models.CharField(max_length=8)
description = models.CharField(max_length=255)
discount = models.FloatField()
code in admin.py
from django.contrib import admin
from .models import Product
admin.site.register(Product)
If you need some other code, please tell me
What do I do?
Aucun commentaire:
Enregistrer un commentaire