add project directory path to python path permanently

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

add project directory path to python path permanently

Nikhil Verma-2

Hi all,

I want to add my django project directory path to PYTHONPATH. I am a newbie in ubuntu 11.10
Please tell me step by step. When i do
>>>import sys
>>>sys.path.append(''project_directory path")
It does append but not permanently. I want it like whenever i do sys.path it should show me Project Directory path in PYTHONPATH
--
Regards
Nikhil Verma
+91-958-273-3156

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: add project directory path to python path permanently

Daniel Roseman-2
On Thursday, 1 December 2011 10:59:15 UTC, Nikhil Verma wrote:

Hi all,

I want to add my django project directory path to PYTHONPATH. I am a newbie in ubuntu 11.10
Please tell me step by step. When i do
>>>import sys
>>>sys.path.append(''project_directory path")
It does append but not permanently. I want it like whenever i do sys.path it should show me Project Directory path in PYTHONPATH
--
Regards
Nikhil Verma
+91-958-273-3156


Why? If you start your shell with `./manage.py shell` you will always have this.
--
DR. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/A7eRoKBzDpAJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: add project directory path to python path permanently

Nan-8
In reply to this post by Nikhil Verma-2

Do you have pip installed?  If so, you can just create a setup.py
script [1] and from inside your project directory run:

pip install -e ./

I assume setuptools (easy_install) can do the same, but I'm not 100%
clear on the command.

[1] http://docs.python.org/distutils/setupscript.html


On Dec 1, 5:59 am, Nikhil Verma <[hidden email]> wrote:

> Hi all,
>
> I want to add my django project directory path to PYTHONPATH. I am a newbie
> in ubuntu 11.10
> Please tell me step by step. When i do>>>import sys
> >>>sys.path.append(''project_directory path")
>
> It does append but not permanently. I want it like whenever i do sys.path
> it should show me Project Directory path in PYTHONPATH
> --
> Regards
> Nikhil Verma
> +91-958-273-3156

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

Reply | Threaded
Open this post in threaded view
|

Re: add project directory path to python path permanently

DrBloodmoney
In reply to this post by Nikhil Verma-2
On Thu, Dec 1, 2011 at 5:59 AM, Nikhil Verma <[hidden email]> wrote:

>
> Hi all,
>
> I want to add my django project directory path to PYTHONPATH. I am a newbie
> in ubuntu 11.10
> Please tell me step by step. When i do
>>>>import sys
>>>>sys.path.append(''project_directory path")
> It does append but not permanently. I want it like whenever i do sys.path it
> should show me Project Directory path in PYTHONPATH

The easiest way is to find out where your site-packages is on your
python installation. Then just symlink your django project directory
there.

Or just use a separate virtualenv for every django project (hint: this
is what you should be doing anyways). Then just symlink into your
virtualenv site-packages

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