在这里,我没有使用任何管理模板。我正在使用默认的管理模板。我怎样才能扭转这个网址?
我得到的错误:
NoReverseMatch at /admin/machine/module/add/
Reverse for 'machine_module_change' with arguments '('',)' not found. 1 pattern(s) tried: ['admin/machine/module/(?P<object_id>.+)/change/$']
Request Method: POST
Request URL: http://localhost:8080/admin/machine/module/add/
Django Version: 3.0.8
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'machine_module_change' with arguments '('',)' not found. 1 pattern(s) tried: ['admin/machine/module/(?P<object_id>.+)/change/$']
Python Version: 3.7.7
Python Path:
['C:\\Users\\Administrator\\Documents\\CheckMeOut\\checkmeout',
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip',
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\lib',
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37',
'C:\\Users\\Administrator\\AppData\\Roaming\\Python\\Python37\\site-packages',
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages',
'C:/Users/Administrator/Documents/CheckMeOut/checkmeout',
'C:/Users/Administrator/Documents/CheckMeOut/checkmeout/checkmeout']
Server time: Tue, 2 Mar 2021 15:21:42 +0530
网址.py
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from django.urls import reverse
urlpatterns = [
path('', include('main.urls')),
path('equipment/', include('equipment.urls')),
path('machine/', include('machine.urls')),
path('admin/',admin.site.urls),
] + static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)