Re: Is it essential to run setup.py?
On May 23, 9:47 pm, Daniel Ellison <[EMAIL PROTECTED]> wrote: > Remember that the paths have to point to the directory in which each Python > module lives. So inside the "django" directory there is another "django" > directory which is the actual module that gets imported. > > Dan On May 23, 4:17 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > So it should have a "django/" directory inside it and you would need to > adjust the Pythonpath to point to /what/ever/dir/Django-0.96/ (you are > putting Django-0.96/ on the path, too, right? Not stopping one directory > too soon?) You have given me a 'doh' moment. I should have figured that out for myself, but all this has given me a much better understanding of how Python path works - it was always one of those things I sort-of got but never really paid enough attention to. Thanks for your help. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is it essential to run setup.py?
On Wednesday 23 May 2007 01:07:13 Thomas Ashelford wrote: > Is there any kind soul who could explain what I can do to install 0.96 > without root access? If you're using Apache, you can include the path to Django in your .htaccess file. For example, I have a directory "software" which lives alongside "public_html" (aliased to "www") in my account's home directory. In there I've svn co'd the latest Django. You could actually have as many Django versions in there as you want. In the .htaccess file for a particular project, include the path to the Django you want to use for that project: PythonPath "['/home/[your_home]/software/django', '/home/[your_home]/www'] + sys.path Remember that the paths have to point to the directory in which each Python module lives. So inside the "django" directory there is another "django" directory which is the actual module that gets imported. Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is it essential to run setup.py?
Hi Thomas, On Tue, 2007-05-22 at 22:58 -0700, Thomas Ashelford wrote: > > > On May 23, 3:16 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > In order for Python to be able to use some bit of code -- in this > > case, Django -- that bit of code has to be in a directory that's on > > the "Python path"; that's a list of directories Python looks into > > whenever you have an 'import' statement. The job of setup.py is to > > automatically place a new Python-based application on the Python path > > so that Python can import code from it, though this is really provided > > as a convenience. > James, thanks for the succinct explanation. That confirms what I > thought (in a slightly uncertain way) was happening. > > > The "manual" option is to either copy the "django" directory > > containing all of Django's code into a directory that's on the Python > > path, or to edit the Python path to include the directory Django is > > in. Editing the Python path varies across operating systems, so you > > may want to simply copy Django over to somewhere on the path. > I have actually edited my Python path already - that's how I got the > development version working - so perhaps there's something else not > right? In any case, moving 0.96 onto the Python path is not really an > option for me, as I already have a working copy of 0.95 sitting there. > I was actually trying to set up an alternate instance of Django so I > could test its compatibility with my code, before upgrading the copy > of Django that runs behind my main server. This should be possible (and I would have said trivial, except that this is apparently not so). It will be a matter of adjusting the Python path to point to you "alternate" version in your (fastcgi?) setup file. What will not work is having *both* Django versions on the Python path at the same time. > I don't want the > embarrassment of upgrading and ending up with a broken site. The fact > that I can get the dev version working in the alternate directory, but > not the 0.96 version makes me worry that it's something more than just > the Python path. This I don't understand. The 0.96 release is basically just a tarball of an "svn export"-ed version of the source whenever the release was made. So it should have a "django/" directory inside it and you would need to adjust the Pythonpath to point to /what/ever/dir/Django-0.96/ (you are putting Django-0.96/ on the path, too, right? Not stopping one directory too soon?) One other thing I just thought of: check the permissions on the tarball. Can the web server read the Django-0.96 directory? It should at least have the execute bit set in the "other" set of permissions (the permission sets reading user/group/other from left to right). > By the way, my site *does* break under the dev version - I have a > couple of FloatFields in there - but as soon as I changed them it > worked fine. So what started as a cautious test of my code's > compatibility with the latest version of Django, has now made me worry > about my ability to install an official Django release! Previously > I've worked with either dev releases (using svn), or pre-installed > official releases (on WebFaction), so I haven't had to face this > before. If you don't have a "doh!" moment anytime soon, how about posting how you have set things up to make the development version work. This might be easier if we knew some details of how you are trying to make it work. Since you mention you don't have root, it sounds like you're using a hosting environment. So what did you do to make the subversion version work? And where have you untarred Django-0.96? Given that information, we should be able to work out the necessary changes. Regards, Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is it essential to run setup.py?
On May 23, 3:16 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > In order for Python to be able to use some bit of code -- in this > case, Django -- that bit of code has to be in a directory that's on > the "Python path"; that's a list of directories Python looks into > whenever you have an 'import' statement. The job of setup.py is to > automatically place a new Python-based application on the Python path > so that Python can import code from it, though this is really provided > as a convenience. James, thanks for the succinct explanation. That confirms what I thought (in a slightly uncertain way) was happening. > The "manual" option is to either copy the "django" directory > containing all of Django's code into a directory that's on the Python > path, or to edit the Python path to include the directory Django is > in. Editing the Python path varies across operating systems, so you > may want to simply copy Django over to somewhere on the path. I have actually edited my Python path already - that's how I got the development version working - so perhaps there's something else not right? In any case, moving 0.96 onto the Python path is not really an option for me, as I already have a working copy of 0.95 sitting there. I was actually trying to set up an alternate instance of Django so I could test its compatibility with my code, before upgrading the copy of Django that runs behind my main server. I don't want the embarrassment of upgrading and ending up with a broken site. The fact that I can get the dev version working in the alternate directory, but not the 0.96 version makes me worry that it's something more than just the Python path. By the way, my site *does* break under the dev version - I have a couple of FloatFields in there - but as soon as I changed them it worked fine. So what started as a cautious test of my code's compatibility with the latest version of Django, has now made me worry about my ability to install an official Django release! Previously I've worked with either dev releases (using svn), or pre-installed official releases (on WebFaction), so I haven't had to face this before. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is it essential to run setup.py?
On 5/23/07, Thomas Ashelford <[EMAIL PROTECTED]> wrote: > I'm hoping that setup.py is just a convenience file that does > something I can do manually (I'm a python newbie, so when I took a > look inside I was a bit bamboozled. I could probably figure it out > given a spare hour or two!) In order for Python to be able to use some bit of code -- in this case, Django -- that bit of code has to be in a directory that's on the "Python path"; that's a list of directories Python looks into whenever you have an 'import' statement. The job of setup.py is to automatically place a new Python-based application on the Python path so that Python can import code from it, though this is really provided as a convenience. The "manual" option is to either copy the "django" directory containing all of Django's code into a directory that's on the Python path, or to edit the Python path to include the directory Django is in. Editing the Python path varies across operating systems, so you may want to simply copy Django over to somewhere on the path. To find out which directories are on your Python path (and, therefore, where you could put Django so Python can find it), do the following in a Python interpreter: >>> import sys >>> print sys.path This will list all the locations currently on your Python path. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Is it essential to run setup.py?
I'm trying to install an instance of Django version 0.96 on a server where I don't have root access. I'm unable run setup.py using sudo as described in the documentation, and when I leave out that step I get "ImportError: No module named django". The development version works fine, so I'm assuming that setup.py must do something essential. I'm hoping that setup.py is just a convenience file that does something I can do manually (I'm a python newbie, so when I took a look inside I was a bit bamboozled. I could probably figure it out given a spare hour or two!) Is there any kind soul who could explain what I can do to install 0.96 without root access? Cheers Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---