我正在按照本教程安装django-tinymce4-lite。在教程的最后有安装django-filebrowser-no-grappelli 的指示。
我使用 Django 2.1.1,但即使我已遵循所有指示,在安装文件浏览器后仍显示此消息:
文件“/var/www/html/dev/miosito/django/beautifulsite_v0.1.1/djangosite/djangosite/urls.py”,第 25 行,在路径('admin/filebrowser/',include(site.urls))中,NameError :名称“站点”未定义
这里有 urls.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 filebrowser.sites import site #sorry I've forgot this
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('testapp.urls')), #app for my tests
path('tinymce/', include('tinymce.urls')),
path('admin/filebrowser/', include('site.urls')),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
我做错了什么?
Yeo校正后编辑:
我已经添加了我忘记的字符串并且我已经正确了
path('admin/filebrowser/', include(site.urls)),
和
path('admin/filebrowser/', include('site.urls')),
但现在我有这个新错误:
ModuleNotFoundError:没有名为“site.urls”的模块;“网站”不是一个包