Code Monkey home page Code Monkey logo

Comments (5)

RealOrangeOne avatar RealOrangeOne commented on July 19, 2024

Interesting, i'm not seeing anything in that which looks specifically wrong.

Is there any more of a stack trace which tells you which line in the library is the issue? This will likely be in the django logs rather than being shown in the page.

from django-sri.

janieIradar avatar janieIradar commented on July 19, 2024

Sorry, here is the stack trace.

Traceback (most recent call last):
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\core\handlers\base.py", line 179, in _get_respo
nse
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\dashboard\views.py", line 93, in dashboard_page
return render(request, 'dashboard/dashboard.html', context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\shortcuts.py", line 19, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\loader.py", line 62, in render_to_stri
ng
return template.render(context, request)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\backends\django.py", line 61, in rende
r
return self.template.render(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\base.py", line 170, in render
return self._render(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\base.py", line 162, in _render
return self.nodelist.render(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\base.py", line 938, in render
bit = node.render_annotated(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\base.py", line 905, in render_annotate
d
return self.render(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\base.py", line 162, in _render
return self.nodelist.render(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\base.py", line 938, in render
bit = node.render_annotated(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\base.py", line 905, in render_annotate
d
return self.render(context)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\template\library.py", line 192, in render
output = self.func(*resolved_args, **resolved_kwargs)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\sri\templatetags\sri.py", line 39, in sri_static
"integrity": calculate_integrity(get_static_path(path), algorithm),
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\sri\utils.py", line 27, in get_static_path
return safe_join(settings.STATIC_ROOT, path)
File "C:\Users\janie\Documents\GoTani\dev_gotani\03_Software\02_Backend_Sourcecode\gotani_1.0.0\gotani_site\venv\lib\site-packages\django\utils_os.py", line 17, in safe_join
final_path = abspath(join(base, *paths))
File "C:\Users\janie\AppData\Local\Programs\Python\Python36\lib\ntpath.py", line 76, in join
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType

from django-sri.

RealOrangeOne avatar RealOrangeOne commented on July 19, 2024

hmm interesting. Looks like that's coming from https://github.com/RealOrangeOne/django-sri/blob/master/sri/utils.py#L27.

Do you have STATIC_ROOT defined in your settings?

from django-sri.

janieIradar avatar janieIradar commented on July 19, 2024

No actually, my project currently using STATICFILES_DIRS.

from django-sri.

RealOrangeOne avatar RealOrangeOne commented on July 19, 2024

ah, ok, I see the issue. It looks like it's incorrect to be reading files direct from STATIC_ROOT as I am. It should instead look at those dirs.

There's probably a helper in Django for getting the filesystem path of a static file somewhere, i'll give it a look over the weekend

from django-sri.

Related Issues (9)

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.