i think you are a little confused. i'll try to clear things up.

first, the url.py does not depend on the apache configuration in the
sense you imply.
but apache does have to know when to call the django/python handler,
and that can be host based, directory based, virtualhost based (if the
apache instance is hosting more than domain)

django also doesn't require knowledge of apache or another webserver,
just as php doesn't: in theory!

because both php, django, or serving html files depend on the apache
configuration. "somebody" has to configure it. most hosting out there
already have everything configured for you to serve php and html
files, with django, unless you are working with a django friendly
hosting company, you might have to do some tweaking yourself, but it
isnt that hard. in most hosting configurations you can configure
apache to use either modpython or fastcgi, and in both you can tell
apache where to load django. it doesnt have to be a subfolder polls,
you can map any django app to the root webfolder.

if you do something like this at the end of url.py (r'^',
'grasshoppr.apps.main.views.login'), then everything that hasnt been
filtered before will be mapped. (not recommended, not 404 errors will
be generated)

if you "want" to be able to have apache handle the root domain by
itself and serve a index.html file, that can be done.
but normally you will want apache to call the python handler from the
domain root.

part of a apache config can look like this:


<VirtualHost *>
    ServerName beta.example.com
    ServerAdmin [EMAIL PROTECTED]

    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE example.settings
    PythonDebug On
    Alias /media "/var/django/example/media/"
    <Location "/media/">
    SetHandler None
    </Location>
 </VirtualHost>


so when the root is called, and any other location under root, the
python-django handler is called, and all the url mappings are handled
by django.
except a "subfolder" called media, apache serves the media directly.
if you put .html files in beta.example.com/media, they will be served
normally by apache. you don't want django serving media.

you can call your urls _ANYTHING_ you want. if you want to conserve an
old link, you _can_ map www.example.com/index.html if you wish.
but there isn't really a good reason to do so, except for "backwards"
compability with an existing site. http://www.w3.org/Provider/Style/URI
so called shorturls or pretty uri are a lot better and django is
really great at it.

even though you probably would get by without installing apache
locally, it will make your life easier if you do.  it isn't that hard.
you will probably only have to add one or two directives like i did
above to get it working. be careful with python path (thats where i
always mess up :)

cheers, ashley




On Feb 18, 9:51 am, "kbochert" <[EMAIL PROTECTED]> wrote:
> On Feb 18, 12:29 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > On Sun, 2007-02-18 at 00:20 -0800, kbochert wrote:
> > No it doesn't *require* Apache, although that is one popular option.
> > Please read the installation documentation, which contains pointers to
> > setup instructions for other environments.
>
> I looked at the installation docs and saw
> "Install python"  -- ok no problem
> "install Apache and mod_python"  -- oops, I'm not about to do that!
> I have installed on my system with no problems. The problem is
> deployment.
>
> So perhaps "install apache and mod_python" really means "insure that
> your host has apache and mod_python installed".
>
> OK, my misunderstanding
>
>
>
> > Maybe you should have a look 
> > athttp://blog.webfaction.com/django-screencast, which gives very concrete
> > details about setting up Django on webfaction.
>
> I saw that screencast offer but don't have quicktime, and anyway, I
> assumed that I would only need that when I actually moved my site to
> webfaction. I now understand that the details of that installation
> affect the details of urls.py, and I'll just have to accept that
> urls.py just can't be (fully) tested locally.
>
> Disappointed, but thanks for your help
> Karl


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to