【发布时间】:2021-10-14 07:56:19
【问题描述】:
我在这个页面上:Filling the details
橙色图片的链接是https://upload.wikimedia.org/wikipedia/commons/c/cb/Oranges_white_background.jpg
当我按下“保存”时,它给了我这个:Error message
无法理解问题我尝试了各种方法来解决它们,比如再拍一张照片并重新运行服务器。来自 Mosh Hamedi 教程:https://www.youtube.com/watch?v=_uQrJ0TkZlc&t=20225s at 05:42:20
我不知道“用户”和“旧”之间的双重空格是什么意思,我真的需要帮助,从周日开始我就被困在这个问题上:
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'))
]
产品 - urls.py
from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('new', views.new)
]
【问题讨论】:
-
这能回答你的问题吗? Django - No such table: main.auth_user__old
标签: python django web web-development-server