Hi DrHaver,

what's confusing you is the incorrect idea of a “development version” or
“production version” of Django — there really is just Django. (When people
say “development version” they just mean unreleased versions still under
development, but that's not what you are talking about).

But Django includes an internal webserver (launched using python manage.py
runserver) which should never be used in a production deployment. That
server is single-threaded (handles only one request at a time) and intended
only for testing during development. This bare-bones server is called “the
development server”, and that name is confusing you.

So in a production deployment, Django should be accessed through a proper
webserver setup. For this, mod_wsgi is one option (and a good one).

As for your PDF question, to serve a static file outside of Django but only
to authenticated users, Apache needs to know the results of authentication.
To do that, you can either:

1) handle authentication outside of Django/mod_wsgi (i.e. in the Apache
server config or another Apache module) so that the webserver knows the
authentication information and can use it to control access to the PDF file,
or

2) handle authentication in Django (as you seem to want) but share the
authentication information with the webserver, using e.g. mod_auth_tkt.

The third option, serving the PDF file inside of Django, is indeed
undesirable if you expect a lot of traffic — but if you don't, then making a
view to serve it from within Django (making sure to send correct
Content-Type response header and perhaps caching response headers) may be a
fully acceptable solution. It's just that Apache handles static files
faster, which starts to matter when things heat up.

Hope that helps you along, best regards,

    - Gulli



On Mon, Mar 8, 2010 at 12:31 PM, DrHaver <[email protected]> wrote:

> I am confused.
>
> If the Development version of DJANGO (internal Web server and all)
> does NOT need "mod_wsgi", then why does the production version of
> DJNAGO need it ?
>
>  I understand that "mod_python" is out-of-date, but I think I need
> "mod_wsgi" to deliver a PDF after I authentciate a user with a posted
> cookie value that has  session ID - which I lookup in MySQL.
>
> I will NOT be using DJANGO to deliver these PDFS (Frameworks are not
> appropriate for Static file delivery - I get that).  I just want to an
> Apache Web Server with "mod_wsgi" to do PDF delivery along with the
> basic authentiation I mentioned.
>
> Anyone have sample "Pyhton / mod_wsgi" code that can shed a light on
> this?  I'm still confused about how to use "mod_wsgi"
>
> I'm the type of person who understands things properly only when I see
> examples.
>
> Tx much
>
> --
> 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]<modwsgi%[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.

Reply via email to