On Wed, Nov 09, 2016 at 01:54:57PM -0800, Gary Roach wrote: > Ludovic > > Thank you for the reply but I know how to use static files. The problem is > that I already have a jquery file under version control inside my virtual > environment wrapper and do not wish to use an external file . Use of a > normal static file will open my application up to uncontrolled version > shifts. I want to know how to use the pip installed version of the jquery > file if possible. > > Gary R.
Could you please elaborate on that a little bit? Virtualenvs are normally used to install Python packages, which jquery is not. Jquery really *is* a static asset, it's just a file that the browser downloads from your server as it is, without any server-side processing. That's the definition of a static asset. How do you install jquery? Are you using some kind of python-package wrapper that contains the jquery static file? What package exactly is it? Chances are that if you use some kind of django-jquery package, all you need to do is add that package to your ``INSTALLED_APPS``, and as long as your ``STATICFILES_FINDERS`` setting includes ``django.contrib.staticfiles.finders.AppDirectoriesFinder``, it might “just work” (as in, you'd reference it using ``{% static "js/jquery.js" %}`` or something). However, that's just a guess, because it's not very clear to me from your description what kind of setup you have there. Anyway, as far as Django is concerned, it really does not care where the static file is coming from, as long as you configure your static file finders to see the file. Cheers, Michal -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20161110083709.GP8307%40koniiiik.org. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Digital signature