Giter Club home page Giter Club logo

Comments (9)

sehmaschine avatar sehmaschine commented on July 29, 2024

sorry, but I can´t follow. there is no backslash before filebrowser in line 28 and 29 in settings.py ...

let´s say STATIC_URL is /static/:

os.path.join("/static/","filebrowser/")
'/static/filebrowser/'

if STATIC_URL, for example, is http://static.mysite.com

os.path.join("http://static.mysite.com","filebrowser/")
'http://static.mysite.com/filebrowser/'

from django-filebrowser.

irlabs avatar irlabs commented on July 29, 2024

Sorry, I don't fully understand either. But I got an AttributeError when I tried the test with the vanilla filebrowser installation on my machine (OS X 10.6 with python 2.6).

    from filebrowser.fields import FileBrowseField
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django_filebrowser-3.3.0-py2.6.egg/filebrowser/fields.py", line 16, in <module>
    from filebrowser.settings import *
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django_filebrowser-3.3.0-py2.6.egg/filebrowser/settings.py", line 28, in <module>
    URL_FILEBROWSER_MEDIA = getattr(settings, "FILEBROWSER_URL_FILEBROWSER_MEDIA", os.path.join(settings.STATIC_URL, 'filebrowser/'))
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 67, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Following the stackoverflow link, I found out there should be a backslash before. And this fixed the issue for me.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

what´s your STATIC_URL?

from django-filebrowser.

irlabs avatar irlabs commented on July 29, 2024

Ah, that must be the root of this problem.
I don't have a STATIC_URL set my project settings.py. (I migrated the project from an older Django installation, which didn't use the STATIC_URL). According to the docs the default of STATIC_URL is None.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

alright, then I guess this issue is "invalid".

from django-filebrowser.

irlabs avatar irlabs commented on July 29, 2024

Mmm, not quite, I would say. If STATIC_URL's default value is None, then the AttributeError with filebrowser seems also default.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

yes, but if STATIC_URL is None, you need to change your setup anyway (see filebrowser-docs) – we don´t fix anything if we add that slash, do we?

from django-filebrowser.

irlabs avatar irlabs commented on July 29, 2024

Too bad that filebrowser is dependent on the new staticfiles app. And it's unfortunate that a migration strategy is not well documented. Another few hours lost.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

the staticfiles-app is the way to go for 3rd-party apps (not unfortunate at all, but a huge advantage instead). but you´re right that the migration strategy is not well documented and I´m sorry for that.

from django-filebrowser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.