38👍
You might be interested in SHPAML:
I am actively maintaining it. It is a simple preprocessor, so it is not tied to any other tools like Genshi. I happen to use it with Django, so there is a little bit of Django support, but it should not interfere with most other use cases.
21👍
I’d check out GHRML, Haml for Genshi. The author admits that it’s basically Haml for Python and that most of the syntax is the same (and that it works in Django). Here’s some GHRML just to show you how close they are:
%html
%head
%title Hello World
%style{'type': 'text/css'}
body { font-family: sans-serif; }
%script{'type': 'text/javascript', 'src': 'foo.js'}
%body
#header
%h1 Hello World
%ul.navigation
%li[for item in navigation]
%a{'href': item.href} $item.caption
#contents
Hello World!
- [Django]-How to escape {{ or }} in django template?
- [Django]-TransactionManagementError "You can't execute queries until the end of the 'atomic' block" while using signals, but only during Unit Testing
- [Django]-How to run this code in django template
21👍
i’m looking for the same. I haven’t tried it, but found this:
- [Django]-Determine variable type within django template
- [Django]-Aggregate (and other annotated) fields in Django Rest Framework serializers
- [Django]-How to get the current url namespace using Django?
- [Django]-Django filter the model on ManyToMany count?
- [Django]-How to get getting base_url in django template
- [Django]-Pass extra arguments to Serializer Class in Django Rest Framework
4👍
This doesn’t actually answer your question, but the CSS component of HAML, SASS, can be used freely with any framework. I’m using it right now with Django.
- [Django]-Pulling data to the template from an external database with django
- [Django]-Django models: Only permit one entry in a model?
- [Django]-What is an efficient way of inserting thousands of records into an SQLite table using Django?
3👍
I’m not sure what the status is of the GHRML bit as I only recently was looking into it. Can’t find a repo for it, original developer doesn’t have time for it anymore and maintenance was picked up by someone else with an interest in the project. Any extra info on this would be helpful.
Unfortunately, as these things go, I started writing my own HAML style processor 😉
http://dasacc22.wordpress.com/2010/05/03/python-implementation-of-haml/
It’s in no way fit for production use at the moment (its literally a 4 day old infant now but like 60+hours crammed in those 4 days) but anyone interested may check it out here. It has a range of features already implemented that make it useful as a toy, and as I clean up the codebase over the next week, I hope to see it replace all my custom XSLT/xpath extensions and templates I have.
- [Django]-Django: remove a filter condition from a queryset
- [Django]-Altering one query parameter in a url (Django)
- [Django]-SocketException: OS Error: Connection refused, errno = 111 in flutter using django backend
3👍
My project, PyHAML, is a Mako preprocessor that gives you very HAML-like syntax. Some of the Ruby doesn’t translate very well to Python, so there are some differences, but the spirit is the same.
- [Django]-Constructing Django filter queries dynamically with args and kwargs
- [Django]-Is there a way to filter a queryset in the django admin?
- [Django]-Django-taggit – how do I display the tags related to each record
3👍
I ran across jade doing some node.js work and when returning to Django was looking for something similar. I found Pyjade and while it’s nearly exactly what I’m looking for it handles errors and debugging rather poorly within Django.
- [Django]-Remove Labels in a Django Crispy Forms
- [Django]-Django – Overriding the Model.create() method?
- [Django]-How to combine multiple QuerySets in Django?
2👍
I just made this http://github.com/fitoria/django-haml it’s still in very early stage but it works.
- [Django]-How do I make many-to-many field optional in Django?
- [Django]-Update only specific fields in a models.Model
- [Django]-Why don't my south migrations work?
2👍
Daniel Skinner’s project (mentioned above) seems to have been renamed to DMSL. It seems very powerful, emulates HAML but allows you to use python functions, lambdas, comprehensions etc in it’s syntax: https://github.com/dasacc22/dmsl
- [Django]-.filter() vs .get() for single object? (Django)
- [Django]-Which Model Field to use in Django to store longitude and latitude values?
- [Django]-How to paginate Django with other get variables?
2👍
I would use this one, it seems to be the most standard one: https://pypi.org/project/HamlPy3/0.83.0/
Assuming you’re using Python3, you shouldn’t haver any issues using it with Django, Flask or even standalone.
- [Django]-DateTimeField doesn't show in admin system
- [Django]-Django URL Redirect
- [Django]-__init__() got an unexpected keyword argument 'mimetype'
1👍
You may want to try Hypertag: a new indentation-based language for HTML templating, strongly inspired by HAML. Hypertag has very clean syntax, provides full Django integration and a number of advanced features: native custom tags, DOM manipulation, Python-like imports, complex expressions, filters, control blocks (for, if, try…) and more. See here:
Disclaimer: I’m the author, glad to help if any issues or questions arise.
- [Django]-Django: Calculate the Sum of the column values through query
- [Django]-How can I avoid "Using selector: EpollSelector" log message in Django?
- [Django]-How to disable admin-style browsable interface of django-rest-framework?