> Funny that css and js are considered "static media".  In the spirit
> of templating they should be dynamic.

I'm not quite sure what you mean.  Typically the contents of CSS,
Javascript, and image files don't change from request to request.
Hence - "static media".  In most cases requests for "static media" are
handled by the web server simply returning the contents of requested
media directly from a file on disk. I'm not saying there aren't valid
cases for dynamically generating CSS, Javascript or even images, but
this is far less common than the well-accepted paradigm of separating
these resources from the application source entirely.  You'd better
come up with some pretty hefty processing power and memory if you're
going to be handling each request for a page resource (of which there
may be dozens) with the interpreter rather than falling back on the
highly optimized web-server itself.

> Therein lies the problem.  I don't want to have one set of code for
> the development server and another for ?.  E.g., django code which
> works for sqlite works for MySQL.

You may have been confused by what I said or vice versa.  Django is
one of many cross-platform web frameworks out there.  (Well, Django
itself isn't inherently cross-platform.  It runs on Python which is
and the developers thankfully had the wisdom not to put any platform-
specific dependencies into their implementation).  Taking your example
- the Django ORM supports multiple databases.  What this means is that
you code your schema and application logic against the Django Models
and DB API, and you can run the same code against any of the databases
Django supports.  More generally, you can run the same Django code on
any platform that supports Python 2.3+.  I have a Windows development
box but I run my production sites on Linux - it's the exact same code
everywhere.  Development wouldn't be very fun if you had to keep track
of machine or OS specific bits for all the places your code might run.

> I think I will explore using the template loader more creatively and
> possibly recursively to produce inline css and js.

I don't know exactly what problem you are trying to tackle.  Again,
there may be perfectly valid reasons why you are trying to adopt this
type of strategy, but a strategy like this has serious implications
for the future scalability and maintenance of your application.  This
user group and community are very helpful.  If you can describe more
about what you are trying to architect you'll get a lot of great
pointers about best practices and the best manner in which to leverage
the strengths of the framework.

-Brian

On Mar 5, 4:53 pm, Phillip Watts <[EMAIL PROTECTED]> wrote:
> On Wednesday 05 March 2008 13:37:58 Brian Luft wrote:
>
> > Serving static media really has nothing to do with Django.
>
> Funny that css and js are considered "static media".  In the spirit
> of templating they should be dynamic.  I would characterize them as
> junk_patched_on_to_a_crappy_platform.  But, Oh well.
>
> > Presumably
> > your browser is reading the CSS file and making a request back to your
> > web server for the file.  You haven't told us anything about your web
> > server configuration.  What path is being requested to the server for
> > the image file?  How is your web server handling that request?
>
> > If you're using the development server, was there anything in the
> > serving static media FAQ that you did not understand?
>
> Therein lies the problem.  I don't want to have one set of code for
> the development server and another for ?.  E.g., django code which
> works for sqlite works for MySQL.
>
> I think I will explore using the template loader more creatively and
> possibly recursively to produce inline css and js.
>
> Thanks for all help.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to