I'm building a CMS for my internal use... I own a web development & desing company... we have experience in ASP.NET but I'm looking for something more "ligth" and come to django... For people with deadlines: that are we!
Despite the fact I see how django is productive in a lot of areas, I get bloked in how somethings are done.. For example, the "feature" of not serve static files. The worst? I don't can relly in the available workarounds to this "feature" (yeah I put "feature" for be sarcasting... I understand the reason, the why, but be patiente: I have a deadline too and this experiment is taking more than expected!!) I have the fallback of the serve static documentation... but this is not working for me (0.95 + dev web server + win 2003) And anyway this is not good for real work. So: I have two desirable ideas: 1- Use a tag and inject the MEDIA_URL here: (I don't like the suggestion to mess with the template system... to much code) {% BaseUrl %}/css/sample.css I put a templetetag/jhonWebInjector.py dir under my project, then under my core app, then under my specific app. I do this: "Etiquetas estandar de jhonWeb." from django.template import Node, NodeList, Template, Context, resolve_variable from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END from django.template import get_library, Library, InvalidTemplateLibrary from django.conf import settings import sys register = template.Library() class BaseUrl(template.Node): def __init__(self): pass def render(self, context): context['BaseUrl'] = 'uno' return '' def do_get_BaseUrl(parser, token): """ {% BaseUrl %} """ return 'uno' register.tag('BaseUrl', do_get_BaseUrl) and in the template: {% load "jhonWebInjector" %} {{ BaseUrl }} But say: '"jhonWebInjector"' is not a valid tag library: Could not load template library from django.templatetags."jhonWebInjector", No module named "jhonWebInjector" However... this is a HACK. I don't like to say to my designers: Look dude, I chose a development framework, and have this beautifull template thing that break the use of any web desing editor like dreamweaver or topstylebecause is necesary put this little hack, so you not can see in realtime what is happening with your ... errr... desing 2- However, I'm thinking in the lines of the dotnetnuke people: This tool have a "install template" thing that convert a .html template in a .ascx module and put the rigth paths to the images and css and javascript. So, my ideas is do this way: The way is done under a local environment, like topstyle: <link rel="stylesheet" type="text/css" href="../css/shadow.css" /> And do some magic to the response (where, how? a middleware?) to look for paths with a regex, and auto-magically turn it in: <link rel="stylesheet" type="text/css" href="http://media.coolsite.com/files/css/shadow.css" /> The 1) is a nice hack by now but I like to know if is possible do in the fly the 2) I think this is the way if is expected that normal web designers build the front-end of the system... I talk with my designers and think is not that bad use a "template language" if that mean total freedom to desing (in contrast to *nuke CMS, I mean). But is a total requeriment to see what is happening with the css/images/etc.. in desing mode... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---