webcomm wrote: [yet again at the top of the message, so I have yet again moved the response down to where it reads logically ...] > On Nov 16, 2:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> webcomm wrote: >> >> [Please don't top-post ... I've moved your answer down] >> >>> On Nov 16, 1:01 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >>>> webcomm wrote: >>>>> Maybe I'm starting to get the idea... can apps be installed anywhere, >>>>> as long as they are on the python path? Are there any restrictions at >>>>> all with respect to where apps are installed? >>>> You've got it. There are no restriction (by Django) on where apps are >>>> installed, as long as their base directories end up on sys.path[]. >>>> Some apps have their own templates with them (typically extending some >>>> notional basic template called "base.html", some apps expect you to >>>> provide templates. >>>> In the former case you can pick them up by having >>>> 'django.template.loaders.app_directories.load_template_source' >>>> in your settings.TEMPLATE_LOADERS, in the latter case you can put the >>>> templates pretty much wherever you want. >>> Hmm. I've created several apps using the startapp command, but I >>> don't see any references to those apps when I print sys.path. >>> Does something happen behind the scenes when I use the startapp >>> command that isn't visible when I print sys.path? If so, why not run >>> the startapp command for all apps? For example, to install the >>> tagging app, I could create an app called "tagging" with startapp. >>> Then I could replace the contents of that directory with the tagging >>> app I download from code.google.com. Would that work? >> Well, startapp just creates a directory suitable for use a local app. >> >> You are running manage.py to start the test server. Python by default >> puts the directory containing the program you run at the start of >> sys.path. You will notice that all the apps you installed contain an >> __init__.py file, which means they are packages. and can be imported >> from the directory containing them (which is also the directory >> containing manage.py). So the mere act of running manage.py ensures that >> all your app packages can be loaded. >> >> But they can also be loaded from any other directory on sys.path ...
> Thanks Steve. That moves me forward. I'll read about module packages > in my python book. I think what I'm discovering is that I've gotten > somewhat deep into Django without really understanding some of the > underlying python concepts. > > What is the point of setup.py files, if they are not really necessary > for installing apps? I see that the tagging app gives me the option > to install using setup.py, but it's not required. > setup.py is just a standard way of taking advantage of Python's "distutils" distribution utilities package. A lot of times a "pure Python" module or package can be simply installed just by dropping it into a directory that's already on the installer's Python path, but if you have requirements for data files to land in a particular spot or of C code needs to be compiled to provide an extension module then setup.py can be invaluable. Most Django apps aren't that complicated. setup.py will traditionally put the packages it installs in <python-install-dir>/Lib/site-packages under Windows, or /usr/lib/pythonx.y/site-packages under Linux/UNIX. If you need help with Python the comp.lang.python newsgroup (also available as [EMAIL PROTECTED]) is a friendly place, but this list can also help out with the odd Python-related question. regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---