from Hacker News

Ask HN: Django templates are a tad bit annoying to set up. Right?

by pX0r on 11/30/17, 6:38 AM with 1 comments

So, I like django templates, a lot, and I have used them quite a bit. The sheer variety of built-in tags and filters and the ability to define custom ones is great...

Here's what I don't like: the effort that goes into setting up a fresh template starting from a raw HTML page.

Every time I start a new project I need to lookup-up django docs for these info nuggets:

  - Where and how to place the template in the project folder

  - How to deal with "static assets" such as JS, CSS and images  

  - Painstakingly inserting static tags and wrapping the 'href's and the 'src's in it ...

Besides, the above is just the necessary first step and the real work of wiring-up the context variables is still ahead of us...

When I had freshly started with django I did find this a tad bit overwhelming. Today, if you are a fresher to django - do you feel this way?

After working on several django projects I find this "template deal" to be somewhat of an annoyance. If you are a django veteran - do you too feel this way?

Would love to know your thoughts and opinions on this.

  • by federicobond on 11/30/17, 7:49 AM

    I have quite a few years of experience with Django and in general, I have found it to be quite easy to set up. I don't think you can avoid much of what you describe with any other template engine, in Python or any other platform.