The 10 year old django-todo project has been updated to version 2.0, with its first running test suite, live demo site, and full support for Django 2 / Python 3. Please see http://django-todo.org/.
Category Archives: Django
Django-Taggit
Alex Gaynor’s Django-Taggit is a great piece of software, but was missing two features essential for Bucketlist:
1) Users could create tags “Music” and “music” which would create two logically different taxonomies on the site, which was confusing and messy. I’ve added a settings option to force lowercase. When this is enabled, all tags will be lowercased as they’re submitted, preventing duplication.
2) Many users don’t read instructions, and enter multi-word tags without quotes, which results in the system being polluted with lots of tags “the”, “of”, “an” etc. You can now define a set of “stopwords” in settings. Any detected stop words will be removed from the submitted tag set.
I forked Gaynor’s taggit to add these features. See shacker/django-taggit.
I also wrote a script to fix all of the duplicate tags that had gone into the system after installing the original django-taggit but before doing my forked version. You’ll find that script on the repo’s Wiki page.
django-treedata: A web app for municipal tree tracking
Recently I was invited to participate in the California Data Camp and DataSF App Contest hosted by California Watch and spot.us. The unconference would feature lots of discussion about making use of publicly available data sets to improve quality of life. The App Contest challenged developers to choose one of the many data sets available at DataSF.org and build something cool with it in a relatively short period of time. Here’s a showcase of existing apps built on those data sets.
The Knight Digital Media Center (where I work) invited me to take part, and I chose a database of 64,000 San Francisco trees and plants. The goal of the project was to:
- Make it easy for citizens to explore and discover the huge number of plant species and individual trees maintained by the city
- Make it easy for citizens to “flag” a tree as needing maintenance, water, food, etc.
- Make it easy for citizens to request a tree at a particular location
- Provide data visualization tools to let citizens explore and understand the plant variety visually
- Make it easy to see what a given species will look like in 5,10,15,20 years when requesting a tree
- Ideally, a future version of the app would include ecology data on all species, listing the water consumption and carbon offset of each
I decided to build the project on Django, of course. Put a total of around 15 hours into the project, about half of which was spent massaging and cleaning the provided data, which had multiple pieces of information stuffed into single fields, non-standard date formats, and was completely non-relational. Cities implementing django-treedata “fresh,” without having to be compatible with an existing data entry system, won’t have to worry about data conversion/format issues.
Once the data was clean, the rest was pretty straightforward Django stuff. The one non-standard aspect is the external “lastcount” script, which counts the number of instances of each species and stores the result on a field in the Species model. Doing this in real time for such a large number of trees turned out to be very computationally expensive, so the script needs to be run from a crontab periodically.
Because dev time was so limited, all of it went into data cleaning and building out the models and views. We’ve put ZERO work into design considerations, so please don’t crucify us for that. The CSS is built on top of the excellent 960 Grid framework, so layout will be easy. Some of the data visualization is done via the excellent Google Charts API.
Much to our surprise, the django-treedata app won the competition!
Please note that the project has only been run in a development environment and has never been publicly deployed – the project as it stands should be considred a starting point for cities to built on. The readme explains more. The project is completely open source and is released under the very liberal BSD license – do with it as you will.
Thanks also to J-School webmaster for Chuck Harris for his contributions to the project
Populate Mailman Lists from Django Projects
Django projects can end up with complex sets of Users, Groups, and multiple profile types representing different types of people. For example a school site might have Students, Parents, Teachers, Staff, and Alumni. The mailing lists for that school will live completely outside of the Django project, but there’s a good chance you’d like to be able to populate list membership from your membership database rather than maintaining lists by hand. And you’d like to be able to use any combination of criteria to populate your lists (Group membership, profile types, join date, privileges, etc.)
Since Mailman is installed on so many web hosts by default, there’s a good chance you’re using it, and have lots of overlapping and non-overlapping groups subscribed to various lists. I recently went through the process of integrating a bunch of Mailman lists with the membership representing a school intranet built in Django and thought I’d document it for anyone going through a similar process.
Once everything is set up, you’ll never need to use the Mailman interface to manage lists again – everything will be automated and self-maintaining.
Read More →
Django-Todo
Update, April 2018: django-todo has been updated to version 2.0, with its first running test suite, live demo site, and full support for Django 2 / Python 3. Please see http://django-todo.org/.
django-todo is a multi-user, multi-group task management and assignment system for the Django web application framework.
Designed as a “pluggable” application ready to import into existing Django projects.
You must already have a login/authorization system installed and working in your project before installing django-todo.
django-todo supports drag and drop task prioritization, email notification to task assignees, search, and lots more. Feedback welcome.
The code is hosted on GitHub and can be downloaded or checked out via git. The package also includes a setup.py, and can be installed with pip.