【发布时间】:2018-02-21 15:41:47
【问题描述】:
我刚刚在 pythonanywhere 上托管的 django 站点上安装了 django-filebrowser,并使用了 python 3.5 和 django 1.11.7。我按照文档中的说明进行设置。这些应用程序安装在 settings.py 中,我使用 manage.py collectstatic 将这些文件收集到当前位置(我使用 whitenoise 通过 Amazon CDN 提供静态文件)。
我的 urls.py 声明如下:
url(r'^filebrowser/', include('filebrowser.urls')),
url(r'^grappelli/', include('grappelli.urls')),
url(r'^admin/', admin.site.urls),
我也使用了 site.urls,但被告知“站点”未定义。
我收到的当前设置错误是:
ImportError: No module named 'filebrowser.urls'
编辑:
我还应该注意,如果我将网址更改为“app.urls”而不是“filebrowser.urls”,则该网站通常会加载,但我尝试加载文件浏览器的页面(用于提交博客文章的表单),出现此错误:
NoReverseMatch: 'filebrowser' is not a registered namespace
【问题讨论】:
-
你是如何安装 django-filebrowser 模块的?
-
您是否激活了正确的虚拟环境?
-
是的,我激活了虚拟环境,我用pip install安装了。
-
你的电脑上是否安装了其他版本的python?
-
不,我在这台机器上只使用python 3.5。
标签: python django django-filebrowser