Re: Setting up jQuery in debian with virtualenv (SOLVED)

2016-11-12 Thread Gary Roach

Thanks all,

I installed libjs-jquery into my active venv directory. It turns out 
that libjs-jquery actually has 3 different virsions in it . I copied the 
jquery.js  file over to my /static/ file in Eclipse. It works fine.


Gary R.

On 11/10/2016 10:22 AM, Luis Zárate wrote:
Mmm why not just download Jquery and create a folder called static 
inside one controlled app, maybe pone inside the project.


If you want, you can use django admin jquery but $ is not available 
because django use django.JQuery for prevent conflict with custom user 
jquery


El jueves, 10 de noviembre de 2016, Gary Roach 
mailto:gary719_li...@verizon.net>> escribió:

> Hi,
>
> Sorry about the confusion. I misspoke. I was trying to imply that 
there was a jquery.min.js file in the venv (djenv)  file. As you 
implied, it was installed with pip django. A very bad choice of words.

>
> I am trying to set up my project so that I am not using a system 
version of jquery since the system version is subject to change every 
time I update my debian system (whiich I do about once a week). I 
suppose what I really want to know is how do I get a "sequestered" 
version of jquery.min.js installed.  I have tried to use a pointer to 
the copy in the djenv directory (Eclipse allows this).  After doing 
this there is a file jquery.min.sj  shows up in 
my static file directory. Unfortunately, when I do a runserver I still 
get a - "GET /static/jquery.min.js HTTP/1.1" 404 1652 - error. What's 
next?

>
> Gary R.
>
> On 11/09/2016 11:56 PM, Antonis Christofides wrote:
>>
>> Hi,
>>
>> If, as you say, you "have a jquery file under version control 
inside [your]
>> virtual environment wrapper", I believe you are doing something 
wrong. We
>> normally don't put jquery files in virtualenv (although `pip 
install django`

>> will do so), and we normally do not version control the virtualenv.
>>
>> If virtualenv is not clear to you, I'd propose to take a look at
>> http://djangodeployment.com/2016/11/01/virtualenv-demystified/ and 
then re-ask

>> your question.
>>
>> Regards,
>>
>> Antonis Christofides
>> http://djangodeployment.com
>>
>> On 2016-11-09 23:54, 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.
>>>
>>> On 11/09/2016 01:41 PM, ludovic coues wrote:

 Hello,

 Django provide tools to deals with static files like javascript or
 css. The documentation is at [1].

 [1] https://docs.djangoproject.com/en/1.10/howto/static-files/

 2016-11-09 21:26 GMT+01:00 Gary Roach >:

>
> Hi all,
>
> I am just starting to use jQuery and Ajax in my project and am 
having

> trouble setting things up.
>
> I am using Eclipse + pyDev as an IDE. This setup stores 
everything in a
> workspace directory in my home directory. Instead of putting the 
whole
> project inside a virtualenv wrapper, things work better if the 
venv is
> external to the actual project files and the venv contents 
referenced in the

> Eclipse setup. In that venv file (djenv) there is the following:
>
>> 
/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js

>>
>
> Now to the setup of my main html page. According to 
W3schools.com I should

> include one of the following in the html head section:
>
>>
>> 
>> 
>
>or
>
>>
>> >> 
src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js";>

>>
>> 
>
> Neither of these fit my situation. I don't have a separate
> jquery-3.1.1.min.js file and don't want to use the google source.
>
> What I wish to know is can I use something like:
>>
>> 
>> >> 
"djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js"

>>
>> 
>
> or can I use just 

Re: Setting up jQuery in debian with virtualenv

 {% static 'admin/js/vendor/jquery/jquery.min.js' %}

Assuming you have django.contrib.admin in your INSTALLED_APP, this will do
what you want.

2016-11-10 19:22 GMT+01:00 Luis Zárate :

> Mmm why not just download Jquery and create a folder called static inside
> one controlled app, maybe pone inside the project.
>
> If you want, you can use django admin jquery but $ is not available
> because django use django.JQuery for prevent conflict with custom user
> jquery
>
>
> El jueves, 10 de noviembre de 2016, Gary Roach 
> escribió:
> > Hi,
> >
> > Sorry about the confusion. I misspoke. I was trying to imply that there
> was a jquery.min.js file in the venv (djenv)  file. As you implied, it was
> installed with pip django. A very bad choice of words.
> >
> > I am trying to set up my project so that I am not using a system version
> of jquery since the system version is subject to change every time I update
> my debian system (whiich I do about once a week). I suppose what I really
> want to know is how do I get a "sequestered" version of jquery.min.js
> installed.  I have tried to use a pointer to the copy in the djenv
> directory (Eclipse allows this).  After doing this there is a file
> jquery.min.sj shows up in my static file directory. Unfortunately, when I
> do a runserver I still get a - "GET /static/jquery.min.js HTTP/1.1" 404
> 1652 - error. What's next?
> >
> > Gary R.
> >
> > On 11/09/2016 11:56 PM, Antonis Christofides wrote:
> >>
> >> Hi,
> >>
> >> If, as you say, you "have a jquery file under version control inside
> [your]
> >> virtual environment wrapper", I believe you are doing something wrong.
> We
> >> normally don't put jquery files in virtualenv (although `pip install
> django`
> >> will do so), and we normally do not version control the virtualenv.
> >>
> >> If virtualenv is not clear to you, I'd propose to take a look at
> >> http://djangodeployment.com/2016/11/01/virtualenv-demystified/ and
> then re-ask
> >> your question.
> >>
> >> Regards,
> >>
> >> Antonis Christofides
> >> http://djangodeployment.com
> >>
> >> On 2016-11-09 23:54, 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.
> >>>
> >>> On 11/09/2016 01:41 PM, ludovic coues wrote:
> 
>  Hello,
> 
>  Django provide tools to deals with static files like javascript or
>  css. The documentation is at [1].
> 
>  [1] https://docs.djangoproject.com/en/1.10/howto/static-files/
> 
>  2016-11-09 21:26 GMT+01:00 Gary Roach :
> >
> > Hi all,
> >
> > I am just starting to use jQuery and Ajax in my project and am having
> > trouble setting things up.
> >
> > I am using Eclipse + pyDev as an IDE. This setup stores everything
> in a
> > workspace directory in my home directory. Instead of putting the
> whole
> > project inside a virtualenv wrapper, things work better if the venv
> is
> > external to the actual project files and the venv contents
> referenced in the
> > Eclipse setup. In that venv file (djenv) there is the following:
> >
> >> /home/gary/workspace/djenv/lib/python3.5/site-packages/
> django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js
> >>
> >
> > Now to the setup of my main html page. According to W3schools.com I
> should
> > include one of the following in the html head section:
> >
> >>
> >> 
> >> 
> >
> >or
> >
> >>
> >>  >> src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/
> jquery.min.js">
> >>
> >> 
> >
> > Neither of these fit my situation. I don't have a separate
> > jquery-3.1.1.min.js file and don't want to use the google source.
> >
> > What I wish to know is can I use something like:
> >>
> >> 
> >>  >> "djenv/lib/python3.5/site-packages/django/contrib/admin/
> static/admin/js/vendor/jquery/jquery.min.js"
> >>
> >> 
> >
> > or can I use just 

Re: Setting up jQuery in debian with virtualenv

Mmm why not just download Jquery and create a folder called static inside
one controlled app, maybe pone inside the project.

If you want, you can use django admin jquery but $ is not available because
django use django.JQuery for prevent conflict with custom user jquery

El jueves, 10 de noviembre de 2016, Gary Roach 
escribió:
> Hi,
>
> Sorry about the confusion. I misspoke. I was trying to imply that there
was a jquery.min.js file in the venv (djenv)  file. As you implied, it was
installed with pip django. A very bad choice of words.
>
> I am trying to set up my project so that I am not using a system version
of jquery since the system version is subject to change every time I update
my debian system (whiich I do about once a week). I suppose what I really
want to know is how do I get a "sequestered" version of jquery.min.js
installed.  I have tried to use a pointer to the copy in the djenv
directory (Eclipse allows this).  After doing this there is a file
jquery.min.sj shows up in my static file directory. Unfortunately, when I
do a runserver I still get a - "GET /static/jquery.min.js HTTP/1.1" 404
1652 - error. What's next?
>
> Gary R.
>
> On 11/09/2016 11:56 PM, Antonis Christofides wrote:
>>
>> Hi,
>>
>> If, as you say, you "have a jquery file under version control inside
[your]
>> virtual environment wrapper", I believe you are doing something wrong. We
>> normally don't put jquery files in virtualenv (although `pip install
django`
>> will do so), and we normally do not version control the virtualenv.
>>
>> If virtualenv is not clear to you, I'd propose to take a look at
>> http://djangodeployment.com/2016/11/01/virtualenv-demystified/ and then
re-ask
>> your question.
>>
>> Regards,
>>
>> Antonis Christofides
>> http://djangodeployment.com
>>
>> On 2016-11-09 23:54, 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.
>>>
>>> On 11/09/2016 01:41 PM, ludovic coues wrote:

 Hello,

 Django provide tools to deals with static files like javascript or
 css. The documentation is at [1].

 [1] https://docs.djangoproject.com/en/1.10/howto/static-files/

 2016-11-09 21:26 GMT+01:00 Gary Roach :
>
> Hi all,
>
> I am just starting to use jQuery and Ajax in my project and am having
> trouble setting things up.
>
> I am using Eclipse + pyDev as an IDE. This setup stores everything in
a
> workspace directory in my home directory. Instead of putting the whole
> project inside a virtualenv wrapper, things work better if the venv is
> external to the actual project files and the venv contents referenced
in the
> Eclipse setup. In that venv file (djenv) there is the following:
>
>>
/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js
>>
>
> Now to the setup of my main html page. According to W3schools.com I
should
> include one of the following in the html head section:
>
>>
>> 
>> 
>
>or
>
>>
>> > src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
">
>>
>> 
>
> Neither of these fit my situation. I don't have a separate
> jquery-3.1.1.min.js file and don't want to use the google source.
>
> What I wish to know is can I use something like:
>>
>> 
>> >
"djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js"
>>
>> 
>
> or can I use just 

Re: Setting up jQuery in debian with virtualenv


Hi,

Sorry about the confusion. I misspoke. I was trying to imply that there 
was a jquery.min.js file in the venv (djenv)  file. As you implied, it 
was installed with pip django. A very bad choice of words.


I am trying to set up my project so that I am not using a system version 
of jquery since the system version is subject to change every time I 
update my debian system (whiich I do about once a week). I suppose what 
I really want to know is how do I get a "sequestered" version of 
jquery.min.js installed.  I have tried to use a pointer to the copy in 
the djenv directory (Eclipse allows this).  After doing this there is a 
file jquery.min.sj shows up in my static file directory. Unfortunately, 
when I do a runserver I still get a - "GET /static/jquery.min.js 
HTTP/1.1" 404 1652 - error. What's next?


Gary R.

On 11/09/2016 11:56 PM, Antonis Christofides wrote:

Hi,

If, as you say, you "have a jquery file under version control inside [your]
virtual environment wrapper", I believe you are doing something wrong. We
normally don't put jquery files in virtualenv (although `pip install django`
will do so), and we normally do not version control the virtualenv.

If virtualenv is not clear to you, I'd propose to take a look at
http://djangodeployment.com/2016/11/01/virtualenv-demystified/ and then re-ask
your question.

Regards,

Antonis Christofides
http://djangodeployment.com

On 2016-11-09 23:54, 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.

On 11/09/2016 01:41 PM, ludovic coues wrote:

Hello,

Django provide tools to deals with static files like javascript or
css. The documentation is at [1].

[1] https://docs.djangoproject.com/en/1.10/howto/static-files/

2016-11-09 21:26 GMT+01:00 Gary Roach :

Hi all,

I am just starting to use jQuery and Ajax in my project and am having
trouble setting things up.

I am using Eclipse + pyDev as an IDE. This setup stores everything in a
workspace directory in my home directory. Instead of putting the whole
project inside a virtualenv wrapper, things work better if the venv is
external to the actual project files and the venv contents referenced in the
Eclipse setup. In that venv file (djenv) there is the following:


/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js



Now to the setup of my main html page. According to W3schools.com I should
include one of the following in the html head section:


   



   or


   
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js";>



Neither of these fit my situation. I don't have a separate
jquery-3.1.1.min.js file and don't want to use the google source.

What I wish to know is can I use something like:



Re: Setting up jQuery in debian with virtualenv

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%40konk.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


Re: Setting up jQuery in debian with virtualenv

Hi,

If, as you say, you "have a jquery file under version control inside [your]
virtual environment wrapper", I believe you are doing something wrong. We
normally don't put jquery files in virtualenv (although `pip install django`
will do so), and we normally do not version control the virtualenv.

If virtualenv is not clear to you, I'd propose to take a look at
http://djangodeployment.com/2016/11/01/virtualenv-demystified/ and then re-ask
your question.

Regards,

Antonis Christofides
http://djangodeployment.com

On 2016-11-09 23:54, 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.
>
> On 11/09/2016 01:41 PM, ludovic coues wrote:
>> Hello,
>>
>> Django provide tools to deals with static files like javascript or
>> css. The documentation is at [1].
>>
>> [1] https://docs.djangoproject.com/en/1.10/howto/static-files/
>>
>> 2016-11-09 21:26 GMT+01:00 Gary Roach :
>>> Hi all,
>>>
>>> I am just starting to use jQuery and Ajax in my project and am having
>>> trouble setting things up.
>>>
>>> I am using Eclipse + pyDev as an IDE. This setup stores everything in a
>>> workspace directory in my home directory. Instead of putting the whole
>>> project inside a virtualenv wrapper, things work better if the venv is
>>> external to the actual project files and the venv contents referenced in the
>>> Eclipse setup. In that venv file (djenv) there is the following:
>>>
 /home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js

>>>
>>>
>>> Now to the setup of my main html page. According to W3schools.com I should
>>> include one of the following in the html head section:
>>>
   
 
 
>>>
>>>   or
>>>
   
 >>> src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js";>

 
>>>
>>> Neither of these fit my situation. I don't have a separate
>>> jquery-3.1.1.min.js file and don't want to use the google source.
>>>
>>> What I wish to know is can I use something like:
 
 >>> "djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js"

 
>>> or can I use just 

Re: Setting up jQuery in debian with virtualenv

On 9 November 2016 at 13:54, Gary Roach  wrote:
> I want to know how to use the pip installed version of the jquery file if
> possible.


you can check what the admin templates do.   probably something like
{% url "admin/js/vendor/jquery/jquery.min.js" %}

-- 
Javier

-- 
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/CAFkDaoRCbDuYz83-9Y1Apj%2BWCAbB5Qp1a8EuHXa%2BFj0vHJ6N9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up jQuery in debian with virtualenv


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.

On 11/09/2016 01:41 PM, ludovic coues wrote:

Hello,

Django provide tools to deals with static files like javascript or
css. The documentation is at [1].

[1] https://docs.djangoproject.com/en/1.10/howto/static-files/

2016-11-09 21:26 GMT+01:00 Gary Roach :

Hi all,

I am just starting to use jQuery and Ajax in my project and am having
trouble setting things up.

I am using Eclipse + pyDev as an IDE. This setup stores everything in a
workspace directory in my home directory. Instead of putting the whole
project inside a virtualenv wrapper, things work better if the venv is
external to the actual project files and the venv contents referenced in the
Eclipse setup. In that venv file (djenv) there is the following:


/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js



Now to the setup of my main html page. According to W3schools.com I should
include one of the following in the html head section:


  




  or


  
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js";>



Neither of these fit my situation. I don't have a separate
jquery-3.1.1.min.js file and don't want to use the google source.

What I wish to know is can I use something like:



Re: Setting up jQuery in debian with virtualenv

Hello,

Django provide tools to deals with static files like javascript or
css. The documentation is at [1].

[1] https://docs.djangoproject.com/en/1.10/howto/static-files/

2016-11-09 21:26 GMT+01:00 Gary Roach :
> Hi all,
>
> I am just starting to use jQuery and Ajax in my project and am having
> trouble setting things up.
>
> I am using Eclipse + pyDev as an IDE. This setup stores everything in a
> workspace directory in my home directory. Instead of putting the whole
> project inside a virtualenv wrapper, things work better if the venv is
> external to the actual project files and the venv contents referenced in the
> Eclipse setup. In that venv file (djenv) there is the following:
>
>>
>> /home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js
>
>
>
> Now to the setup of my main html page. According to W3schools.com I should
> include one of the following in the html head section:
>
>>  
>> 
>> 
>
>
>  or
>
>>  
>> > src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js";>
>> 
>
>
> Neither of these fit my situation. I don't have a separate
> jquery-3.1.1.min.js file and don't want to use the google source.
>
> What I wish to know is can I use something like:
>> 
>> > "djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js"
>>
>
> or can I use just 

Setting up jQuery in debian with virtualenv


Hi all,

I am just starting to use jQuery and Ajax in my project and am having 
trouble setting things up.


I am using Eclipse + pyDev as an IDE. This setup stores everything in a 
workspace directory in my home directory. Instead of putting the whole 
project inside a virtualenv wrapper, things work better if the venv is 
external to the actual project files and the venv contents referenced in 
the Eclipse setup. In that venv file (djenv) there is the following:



/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js



Now to the setup of my main html page. According to W3schools.com I 
should include one of the following in the html head section:



 




 or


 
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js";>



Neither of these fit my situation. I don't have a separate 
jquery-3.1.1.min.js file and don't want to use the google source.


What I wish to know is can I use something like:
> 
> "djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js"

>

or can I use just