←back to thread

Happy 20th Birthday, Django

(www.djangoproject.com)
578 points davepeck | 1 comments | | HN request time: 0s | source
Show context
mrcwinn ◴[] No.44559774[source]
Not to conflate a framework and a language, but there’s something about Django that makes me feel like I’m writing PHP. What is this effect?
replies(3): >>44559911 #>>44560628 #>>44561163 #
simonw ◴[] No.44561163[source]
When Adrian and I first designed Django we were PHP developers switching to Python, so quite a few Django pieces were inspired by PHP.

Django's request.GET and request.POST were directly influenced by $_GET and $_POST.

Django's template language included ideas from the Smarty PHP template language.

replies(1): >>44561771 #
nojs ◴[] No.44561771[source]
This is surprising because the template language in particular feels so anti-PHP, it’s highly opinionated about not mixing code in with the template. I often wish it supported arbitrary Python.

Anyway, thank you Simon :)

replies(2): >>44561838 #>>44567764 #
simonw ◴[] No.44561838[source]
Yeah, the template language was strongly influenced by NOT wanting to allow arbitrary logic like PHP does. I was already a fan of Smarty - https://www.smarty.net/ - which did a great job of separating out presentation logic in PHP.

I've been using Jinja for my own projects for a few years because I wanted more expressive Python code in my templates! I think we didn't quite get the balance right for that in Django.

replies(1): >>44570988 #
robertlagrant ◴[] No.44570988[source]
I think a great combo would've been Django's features, packaging and most importantly documentation, but with SQLAlchemy and Jinja2 technologies underneath.
replies(2): >>44572447 #>>44573724 #
frankwiles ◴[] No.44572447[source]
That would have been hard since both of those projects came out after Django, but just an FYI Jinja2 templates are supported and nothing stops you from using SQLAlchemy. Granted you lose a lot of the tight intergration that makes Django great to use.
replies(1): >>44572753 #
1. robertlagrant ◴[] No.44572753[source]
> That would have been hard since both of those projects came out after Django

Well, yes I didn't mean Django from the start! I mean now.