简体   繁体   English

ImportError:没有名为“ filebrowser”的模块

[英]ImportError: No module named 'filebrowser'

I have just installed django-filebrowser on my django site hosted on pythonanywhere and using python 3.5 and django 1.11.7. 我刚刚在pythonanywhere托管的django站点上使用python 3.5和django 1.11.7安装了django-filebrowser。 I followed the instructions in the docs to set it up. 我按照文档中的说明进行了设置。 The apps are installed in settings.py, and I have used manage.py collecstatic to collect those files in the currect location (I am using whitenoise to serve static files through an Amazon CDN). 这些应用程序安装在settings.py中,并且我使用了manage.py collecstatic在当前位置收集这些文件(我正在使用whitenoise通过Amazon CDN提供静态文件)。

My urls.py declarations are as follows: 我的urls.py声明如下:

url(r'^filebrowser/', include('filebrowser.urls')),
url(r'^grappelli/', include('grappelli.urls')),
url(r'^admin/', admin.site.urls),

I also used site.urls, but was informed that 'site' is undefined. 我还使用了site.urls,但被告知“ site”是未定义的。

The error I receive on the present settings is: 我在当前设置下收到的错误是:

ImportError: No module named 'filebrowser.urls'

Edit: 编辑:

I should also note that if I change the urls to 'app.urls' instead of 'filebrowser.urls' that site loads generally, but the page on which I attempt to load filebrowser (a form for submitting blog posts), presents this error: 我还应注意,如果我将网址更改为“ app.urls”而不是通常通常会加载的“ filebrowser.urls”,但是我尝试加载Filebrowser的页面(提交博客帖子的表单)会出现此错误:

NoReverseMatch: 'filebrowser' is not a registered namespace

Your urls look different than in the docs : 您的网址看起来与docs中的网址不同:

from filebrowser.sites import site

urlpatterns = [
   url(r'^admin/filebrowser/', include(site.urls)),
   url(r'^grappelli/', include('grappelli.urls')),
   url(r'^admin/', include(admin.site.urls)),
]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM