Friday, June 3, 2011

Opinion on static files and approaching hardcoding in a Django-like manner

Sorry if this might have been addressed before in a similar manner,
but I was curious as to what some others' thoughts were or what their
practices might be in this situation.

I have some bookmarklets and other javascript files in a /static/
directory. This are then linked in a view so that a user could drag
and drop into their toolbar.

Now, in other scenarios where I might be generating links, I simply
pipe in the domain (if needed) via Sites. However, in a static JS file
I obviously do not use a templating setup and thus cannot pipe in a
domain.

For now, in testing and personal use, I've just hardcoded in my domain
for these types of scenarios. However, what are some options for doing
this when I am pushing this code out for others to use.

[Example: bookmarklet use for a Django URL shortener - https://github.com/mutaku/Stumpy
]

Thanks in advance for any comments/suggestions. I had some ideas in
mind, but thought it might be interesting to see what other people
were doing for these types of situations.

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment