On 15 oct, 17:42, Javi <[EMAIL PROTECTED]> wrote:
> I do tests using development server and everything is OK. But now, the
> app must be available to the users. If I musn't match the content
> static folder with a url, how must I rewrite the href to static file?
The way you should have done it right from the start (but this is not
heaviliy documented): using the media context processors:
http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#django-core-context-processors-media
> I mean, using the development server the href to a css file is as
> follow: <link rel="stylesheet" href="/static/css/style.css" type="text/
> css" media="screen" />. How must I change the href to get the static
> content be loaded?
Install the media context processor, make sure you always use
RequestContext instances in your views, and use 'href="{MEDIA_URL}css/
style.css"' in your templates.
This will also work in development using django.views.static.serve():
http://docs.djangoproject.com/en/dev/howto/static-files/#howto-static-files
HTH
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---