Search code examples
pythondjangodjango-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. 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).

My urls.py declarations are as follows:

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.

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:

NoReverseMatch: 'filebrowser' is not a registered namespace

Solution

  • Your urls look different than in the 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)),
    ]