Django performance
I’ve been working on I’ve been working on and still having the love hate with python and django. Areas that I would like see improved:
Template Variables : I’m currently doing strange things like:
1<body id="{% block tmpl_id %}{% endblock %}" class="{% block tmpl_class %}{% endblock %}">
and then the included template is setting those variables. Which when you think about it is a bit off..
Footer Scripts: I would like to be able to stuff all the scripts in the footer, but there’s no easy way to faciliate “block append” where any included template could include a short snippet to be appended to the footerscript block.
Template Performance: Ok, it’s good. It really helped when I found a script to cache the parsed version of a template for rendering. My page render time for most pages is < 100ms, which when you consider it’s running on a 5 year old machine.
Models: The models are a slippery slope, I’m finding that 90% of my functionality is drifting into the model layer, which is good… but, I don’t feel like there’s good seperation.
File Layouts: This really is django’s strongest and weakest point, it wants everything to be modular, but almost takes it too far for an application. What’s an app whats a webapp?
Auth: django.contrib.auth sucks! It forces two paradimes that should be abolished… SESSIONS and USER=AUTHENTICATION. Long ago I learned that to use a SESSION object is a flawed approach, you should cache the database objects and reconstruct state as necessary, not depend on having things like a shoppping cart in memory. The second bit is that if I want to provide multiple authentications system email+password, user+password, OAuth, Facebook having your user object tied to authentication is a bad practice. The biggest problem is that I don’t want to re-write all of auth yet…
_That’s it today…more ranting later when… Check out my [I’ve been working on I’ve been working on and still having the love hate with python and django. Areas that I would like see improved:
Template Variables : I’m currently doing strange things like:
1<body id="{% block tmpl_id %}{% endblock %}" class="{% block tmpl_class %}{% endblock %}">
and then the included template is setting those variables. Which when you think about it is a bit off..
Footer Scripts: I would like to be able to stuff all the scripts in the footer, but there’s no easy way to faciliate “block append” where any included template could include a short snippet to be appended to the footerscript block.
Template Performance: Ok, it’s good. It really helped when I found a script to cache the parsed version of a template for rendering. My page render time for most pages is < 100ms, which when you consider it’s running on a 5 year old machine.
Models: The models are a slippery slope, I’m finding that 90% of my functionality is drifting into the model layer, which is good… but, I don’t feel like there’s good seperation.
File Layouts: This really is django’s strongest and weakest point, it wants everything to be modular, but almost takes it too far for an application. What’s an app whats a webapp?
Auth: django.contrib.auth sucks! It forces two paradimes that should be abolished… SESSIONS and USER=AUTHENTICATION. Long ago I learned that to use a SESSION object is a flawed approach, you should cache the database objects and reconstruct state as necessary, not depend on having things like a shoppping cart in memory. The second bit is that if I want to provide multiple authentications system email+password, user+password, OAuth, Facebook having your user object tied to authentication is a bad practice. The biggest problem is that I don’t want to re-write all of auth yet…
That’s it today…more ranting later when… Check out my]1 site and send me feedback… I just need one solid day of love and I think it’ll be done…