1. Rails people are big on not writing HTML.
<%= link_to 'Apple', :url => 'http://apple.com' %>
<a href="http://apple.com";>Apple</a>

The shortcuts just aren't shorter.  And, as anyone with a large Rails
app will tell you, once you get users, you frantically go around
removing all of those template helpers.  They take FOREVER to parse
and aren't shorter or more readable.  It just isn't hard to make HTML
tags so there's no sense in not doing it.

2. This still does bug me - not much though.  In one sense, it's good
because it means you have to explicitly pass variables to the template
- much more secure than simply having everything that's an instance
variable get passed.

3a. I wish Django would simply assume that my templates are under
app_name/templates.  That way, I would have my models and views in the
app_name folder and all their corresponding templates under that.  I'm
guessing the decision was made for loose coupling reasons.  this way,
you aren't tied to Django's system.  There's also an argument for
templates that might be used in multiple apps and you wouldn't want to
copy it to multiple places.

Really, it just isn't that hard to deal with 2 and 3.  And it probably
makes the apps more maintainable in the future.  I used to complain
about the manual URLs, but they're amazing.  It just isn't that much
code and it takes 15 seconds to write.  If you have 100 views (quite
the large site), you've wasted less than half an hour in total.

4. I'm not sure about this, but could you put the loads in base.html
and then have everything extend that base?  If you aren't able to call
template tags loaded in the base file, you should be able to.  This
might be a bug/feature request.

Django won't be for everyone.  Some people won't like the explicit
calls.  I find that the more I use Django, the more I see the value in
(most) of its explicitness.

On Jul 2, 12:54 am, rtconner <[EMAIL PROTECTED]> wrote:
> Hello Djangoes (Djangoers?),
>
> I've spent a good amount of time familiarizing myself with Django,
> writing my own blog and plugging in the Polls tutorial. I'm very close
> to really liking (almost loving) Django. I've just got a few small
> annoyances I want to ask about. They all, oddly enough, have to do
> with templating.
>
> 1. First, I've not seen much on webhelpers (aka auto generate an
> anchor or other html). Is this the standard way to go, or is there
> another way to go about getting 
> helpers..http://code.google.com/p/django-helpers/
>
> 2. Do I really have to put "return render_to_response('...')" in all
> of my views? I know this is just one line of code, but hear me out.
> Django is all about making project dev go as fast as possible. It
> seems likely that it is an easy thing to have views automatically
> render a template in an assumed location. Yes its just one line of
> code, but its one line I see no reason I have to write. If I don't
> want a template loaded I should explicitly have to say so.
>
> 3. Going along with the last item .. please please tell me I do not
> really have to put absolute paths in the TEMPLATE _DIRS tuple. 100% of
> my projects get deployed to multiple servers, generally a development
> server, a QA server and a production server. I can in no way ensure
> paths will be the same in all three. How have others handled this?
> Does this mean I have to have my deploy scripts edit the path?
>
> 3a. Note: This is two items where I've wanted a well defined template
> location. Just out of curiosity, why does Django give the freedom to
> put templates anywhere? I can't see this being a tremendously useful
> thing. Always any good project should have the templates nearby the
> views/controllers/models. For quick access from text editor, but
> really, both should be in SVN right next to each other.
>
> 4. Do I really have to always load template tags in the template Is
> there no way to auto load them? It's my guess I'll always have 3-4
> template tags I use regularly. Thats 3-4 extra lines of code per
> template. Is there a way to just force a certain (group of) template
> tags to be loaded for every template in my system?
>
> Well like I said, none of these items are huge problems, just little
> annoyances I was curious about. Thanks.
>
> -Rob


--~--~---------~--~----~------------~-------~--~----~
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