0

I'm on this page: Filling the details

The link to the orange image is https://upload.wikimedia.org/wikipedia/commons/c/cb/Oranges_white_background.jpg

When I'm pressing 'save' it gives me this: Error message

Couldn't understand the issues I tried various ways to solve them like take another picture and re-run the server. From Mosh Hamedi tutorial: https://www.youtube.com/watch?v=_uQrJ0TkZlc&t=20225s at 05:42:20

I do not know what this double space between 'user' and 'old' means and I really need help with this, I'm stuck on this from Sunday:

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=2083)


class Offer(models.Model):
    code = models.CharField(max_length=10)
    description = models.CharField(max_length=255)
    discount = models.FloatField()

views.py

from django.shortcuts import render
from django.http import HttpResponse

def index(request):
    return HttpResponse('Hello World')


def new(request):
    return HttpResponse('New Products')

admin.py

from django.contrib import admin
from .models import Product

admin.site.register(Product)

pyshop - urls.py

from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path("products/", include('products.urls'))
]

products - urls.py

from django.urls import path
from . import views

urlpatterns = [
    path('', views.index),
    path('new', views.new)
]
Richard Wilson
  • 297
  • 4
  • 17
LidorTubul
  • 75
  • 10
  • Does this answer your question? [Django - No such table: main.auth\_user\_\_old](https://stackoverflow.com/questions/53637182/django-no-such-table-main-auth-user-old) – gdef_ Aug 10 '21 at 18:55

1 Answers1

0

Hey dont use Charfield with specific length in image field. Use either UrlField or an ImageField in models.

Then try to add from admin panel.

And also run makemigrations and migrate command.