On 6 July 2010 12:34, Graham Dumpleton <[email protected]> wrote: > On 6 July 2010 12:21, Bradley Hintze <[email protected]> wrote: >> Thanks Graham, >> >> I just installed Django and it failed to import. I'm sure it has >> something to do with 'not being in my PATH,' whatever that means. I >> wish Django had installation instructions rather than going strait to >> the tutorial. > > Being able to import a module is a completely different issue and > relates to Python module search path. > > If you are getting that when using mod_wsgi, it will be due to one of > three reasons. > > 1. Your mod_wsgi is compiled against/using a different Python > version/installation than what you installed Django into. > > 2. You are using a virtual environment, or have installed Django into > your home directory and you have told Python under mod_wsgi where it > is.
Meant 'and have not told Python'. Graham > 3. The Django when installed doesn't have permissions such that user > Apache runs as can read it. > > Personally I would suggest you not use > bitnami-djangostack-1.1.1-2-osx-x86-installer as you seem to be based > on post on Django list. These installers and other packaging systems > such as MacPorts and fink just cause more problems that they are > worth. Just use the standard Python installation on MacOS X. > > Easiest thing to do is run: > > easy_install virtualenv > > virtualenv myenv > source myenv/bin/activate > > easy_install Django > > django-admin.py mysite > > python mysite/manage.py > > Each time you want to work with it under Django builtin server, > remember to do that 'source' line where the argument is activate > script in that virtual environment. > > When running under mod_wsgi you will need to do a bit of extra setup > to tell it where stuff installed. For that, see my talk slides and > video as mentioned at: > > http://groups.google.com/group/modwsgi/browse_frm/thread/119ca215ee86888 > > Will save me a lot of trouble explaining it. > > Graham > >> The problem I've seen with readings on UNIX shells and the like is >> that they are filled with jargon rather than english that a beginner >> can understand. >> >> Thanks again, >> >> Bradley >> >> >> On Mon, Jul 5, 2010 at 10:08 PM, Graham Dumpleton >> <[email protected]> wrote: >>> On 6 July 2010 11:51, Bradley Hintze <[email protected]> wrote: >>>> Carl, >>>> >>>> What do you mean by >>>> >>>> 'It needs to be put in your path. This is usually done by sourcing a >>>> shell script before you start working.' >>> >>> On a UNIX system, it means that the directory containing any >>> executable programs you want to be able to run must appear in the PATH >>> environment variable. >>> >>> The PATH environment variable is consulted by your shell to find >>> executables without you needing to give an absolute path name. >>> >>> For example, on my system I have: >>> >>> $ echo $PATH >>> /Users/grahamd/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin >>> >>> As is, django-admin.py isn't in my default path. Ie., >>> >>> $ which django-admin.py >>> >>> returns nothing. >>> >>> Now, if for example django-admin.py was in: >>> >>> /Library/Python/2.6/site-packages/Django-1.2/django/bin >>> >>> then this directory would need to be added into the PATH environment >>> variable. For example: >>> >>> PATH=/Library/Python/2.6/site-packages/Django-1.2/django/bin:$PATH >>> >>> You could do this by hand, by having it in a special script which you >>> source, or be part of your account login scripts (.bashrc for bash >>> shell). >>> >>> In the case of a virtual environment, the 'django-admin.py' command is >>> actually likely to be in the 'bin' directory of the virtual >>> environment. Further, the virtual environment supplies an 'activate' >>> script which will extend the PATH variable, as well as doing other >>> stuff, to list that bin directory in your PATH. To use that activate >>> script you 'source' it. Eg for modern shells one can say: >>> >>> source myenv/bin/activate >>> >>> This should give you a bit of an idea. I suggest you now do some >>> reading on UNIX shells, the role of the PATH environment variable and >>> the 'source' command in the shell. >>> >>> If instead you are on Windows, then sorry, but someone else will need >>> to explain that one. >>> >>> Graham >>> >>>> ???? >>>> >>>> Thanks, >>>> Bradley >>>> >>>> On Fri, Jun 25, 2010 at 5:33 PM, Carl Nobile <[email protected]> wrote: >>>>> django-admin.py is in Django-x.x.x/django/bin after expanding the >>>>> zip/tarball, etc. >>>>> >>>>> It needs to be put in your path. This is usually done by sourcing a >>>>> shell script before you start working. If you are using windows you >>>>> will need to put it permanently in your path. >>>>> >>>>> ~Carl >>>>> >>>>> On Fri, Jun 25, 2010 at 4:37 PM, Bradley Hintze >>>>> <[email protected]> wrote: >>>>>> Your right in avoiding Django. I installed it and can't follow their >>>>>> tutorial because django-admin.py is no where on my machine. haha >>>>>> Pylons it is I guess. >>>>>> >>>>>> On Fri, Jun 25, 2010 at 3:38 PM, Raoul Snyman <[email protected]> >>>>>> wrote: >>>>>>> On 25 June 2010 20:59, Bradley Hintze <[email protected]> >>>>>>> wrote: >>>>>>>> I just talked to him. He just doesn't know about python frameworks. >>>>>>>> What frame work would you (and all reading this) recommend? Preferably >>>>>>>> one with a startup tutorial that doesn't requie a degree in CS. >>>>>>> >>>>>>> Personally, I use Pylons[0]. It's not one of those "do everything >>>>>>> under the sun" frameworks, it is more geared towards providing you >>>>>>> with a smaller, more flexible platform to work on, but it does mean >>>>>>> that you might need to write a bit more boilerplate code. If you would >>>>>>> prefer a system that comes with the kitchen sink included, you can >>>>>>> look at Django[1] or TurboGears 2.x[2]. Another, even simpler and less >>>>>>> structured than Pylons WSGI framework is Werkzeug[3]. >>>>>>> >>>>>>> Personally I steer clear of Django because it's inflexible, TurboGears >>>>>>> because I have to write too much in places where I would expect it to >>>>>>> just work, and Werkzeug because it is not structured enough for me. >>>>>>> Each framework has it's own pro's and cons. >>>>>>> >>>>>>> [0] http://pylonshq.com/ >>>>>>> [1] http://www.djangoproject.com/ >>>>>>> [2] http://turbogears.org/ >>>>>>> [3] http://dev.pocoo.org/projects/werkzeug/ >>>>>>> >>>>>>> -- >>>>>>> Raoul Snyman >>>>>>> B.Tech Information Technology (Software Engineering) >>>>>>> E-Mail: [email protected] >>>>>>> Web: http://www.saturnlaboratories.co.za/ >>>>>>> Blog: http://blog.saturnlaboratories.co.za/ >>>>>>> Mobile: 082 550 3754 >>>>>>> Registered Linux User #333298 (http://counter.li.org) >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "modwsgi" group. >>>>>>> To post to this group, send email to [email protected]. >>>>>>> To unsubscribe from this group, send email to >>>>>>> [email protected]. >>>>>>> For more options, visit this group at >>>>>>> http://groups.google.com/group/modwsgi?hl=en. >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Bradley J. Hintze >>>>>> Graduate Student >>>>>> Duke University >>>>>> School of Medicine >>>>>> 801-712-8799 >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "modwsgi" group. >>>>>> To post to this group, send email to [email protected]. >>>>>> To unsubscribe from this group, send email to >>>>>> [email protected]. >>>>>> For more options, visit this group at >>>>>> http://groups.google.com/group/modwsgi?hl=en. >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ------------------------------------------------------------------------------- >>>>> Carl J. Nobile (Software Engineer) >>>>> [email protected] >>>>> ------------------------------------------------------------------------------- >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google Groups >>>>> "modwsgi" group. >>>>> To post to this group, send email to [email protected]. >>>>> To unsubscribe from this group, send email to >>>>> [email protected]. >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/modwsgi?hl=en. >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Bradley J. Hintze >>>> Graduate Student >>>> Duke University >>>> School of Medicine >>>> 801-712-8799 >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "modwsgi" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]. >>>> For more options, visit this group at >>>> http://groups.google.com/group/modwsgi?hl=en. >>>> >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "modwsgi" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]. >>> For more options, visit this group at >>> http://groups.google.com/group/modwsgi?hl=en. >>> >>> >> >> >> >> -- >> Bradley J. Hintze >> Graduate Student >> Duke University >> School of Medicine >> 801-712-8799 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/modwsgi?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
