Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Bill Freeman
Assuming that you're talking about runserver, then use the python
that you want when you invoke manage:

   /home/me/bin/my_special_python manage.py runserver

You could also edit the first line of manage.py to specify the path
to that python, make sure that manage.py has it's execute bit(s)
set (*nix), and you can then use:

   ./manage runserver

or, to do testing or whatnot using that python:

   ./manage shell
   ./manage syncdb

etc.

The above all assume that the current director is that containing
manage.py at the time that you type the command.


If you're talking about mod_wsgi (or probably mod_python) then you
are stuck with the python executable that mod_wsgi is built for.  You
can, however, set the PYTHONPATH used (at least for mod_wsgi),
which may be all that you need, so long as mod_wsgi was built for
the same version of python (that is, you can't make a 2.5 use the
pyc files of a 2.6 installation).  See the docs for the apache configuration
that tells mod_wsgi where to find your xxx.wsgi file (WSGIScriptAlias,
I think).

Bill

On Thu, Mar 11, 2010 at 8:53 AM, bx2  wrote:
> The best option is to use buildout (there is no need for creating
> virtualenv - much more simple and much more flexible solution). Also
> it will be easier to further deploy your projects.
>
> The second option is to modify your manage.py script by adding custom
> path to it ie.
>
> import sys
> sys.path[0:0] = [ ...]
>
> regards,
> bx2
>
> On 11 Mar, 05:41, Abhinov  wrote:
>> Hi All,
>>
>> How to make my django use a different python interpreter located at
>> some random location ?
>> Any help will be of great help.
>>
>> Regards,
>> Abhinov
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread bx2
The best option is to use buildout (there is no need for creating
virtualenv - much more simple and much more flexible solution). Also
it will be easier to further deploy your projects.

The second option is to modify your manage.py script by adding custom
path to it ie.

import sys
sys.path[0:0] = [ ...]

regards,
bx2

On 11 Mar, 05:41, Abhinov  wrote:
> Hi All,
>
> How to make my django use a different python interpreter located at
> some random location ?
> Any help will be of great help.
>
> Regards,
> Abhinov

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread felix

also checkout buildout which does a similar thing to virtualenv but
also allows you to specify the exact interpreter and all
dependencies / eggs / apps and installs those.

it makes development very portable since you can quickly set up the
exact same environment (including a specific python interpreter)

http://jacobian.org/writing/django-apps-with-buildout/


On Mar 11, 2:42 pm, Jeremy Sandell  wrote:
> On Mar 10, 11:41 pm, Abhinov  wrote:
>
> > Hi All,
>
> > How to make my django use a different python interpreter located at
> > some random location ?
> > Any help will be of great help.
>
> > Regards,
> > Abhinov
>
> I'll second Bjunix's recommendation of checking out virtualenv. It
> will probably do what you need, and it's a far cleaner solution than
> manually putting the path to your random interpreter in manage.py. The
> latter works for FastCGI, but it's quite ugly.
>
> Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Jeremy Sandell
On Mar 10, 11:41 pm, Abhinov  wrote:
> Hi All,
>
> How to make my django use a different python interpreter located at
> some random location ?
> Any help will be of great help.
>
> Regards,
> Abhinov

I'll second Bjunix's recommendation of checking out virtualenv. It
will probably do what you need, and it's a far cleaner solution than
manually putting the path to your random interpreter in manage.py. The
latter works for FastCGI, but it's quite ugly.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Bjunix
You may want to take a look at virtualenv[1].

[1] http://pypi.python.org/pypi/virtualenv

On Mar 11, 5:41 am, Abhinov  wrote:
> Hi All,
>
> How to make my django use a different python interpreter located at
> some random location ?
> Any help will be of great help.
>
> Regards,
> Abhinov

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to make django use a different python interpreter located at some random location.

2010-03-11 Thread Graham Dumpleton


On Mar 11, 3:41 pm, Abhinov  wrote:
> Hi All,
>
> How to make my django use a different python interpreter located at
> some random location ?
> Any help will be of great help.

How are you hosting it?

Are you talking about Django runserver or some other hosting mechanism
such as mod_python, mod_wsgi, FASTCGI etc?

One cant answer the question without knowing how you are running it.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.