Three simple Django apps to make your clients happy
During the last Django projects I've done for my clients and for myself I found a few features useful, which I now include in most of the projects I build with Django. What I'm going to introduce now are three simple - and I mean simple - apps:
- django-export: An app to export a database dump and/or a tar-file with the contents of the MEDIA_ROOT. Think of it as a simple backup solution.
- django-memcachedstatus: Based on a snippet on effbot.org I've build a small app, which presents the status of a configured memcache-daemon nicely integrated into the contrib.admin interface.
- django-webalizer: An app, which you can use to let your clients view generated webalizer statistics right from the django admin interface. This way you don't have to add an extra configuration to your webserver to publish the stats (and secure them with HTTP Basic Auth).
If you think these apps are useful you can go straight to github and download them:
Please keep in mind that these apps are pretty simple and there is definately some work which could be done, but they work for me in the current state and contributions and feedback are very welcome.
AFAIK django-memcachedstatus does not work with cmemcached library, so it's not usable.
Geschrieben von Julian 1 Stunde, 53 Minuten nach Veröffentlichung des Blog-Eintrags am 7. Okt. 2008, 20:22. Antworten
Julian: I will try to investigate this, thanks for pointing out.
Geschrieben von Arne 2 Stunden, 7 Minuten nach Veröffentlichung des Blog-Eintrags am 7. Okt. 2008, 20:36. Antworten
can django-export handle such kind of situation like the changes of model?
Geschrieben von omtv 7 Stunden, 58 Minuten nach Veröffentlichung des Blog-Eintrags am 8. Okt. 2008, 02:27. Antworten
django-export looks like it can be really useful, but looking at the code, it looks like it currently only supports MySQL and Sqlite.
What about using JSON as an alternative export option to SQL? I have never had any problems using the following method:
Backup:
./manage.py dumpdata --indent=4 > backup.json
Restore:
./manage.py sqlclear
(copy sql statements from terminal)
./manage.py dbshell
(run sql statements copied earlier)
./manage.py loaddata backup.json
Infact, I regularly use this to even transfer a database from my production Postgres server, back to my Sqlite database for development purposes.
Geschrieben von Rob van der Linde 11 Stunden, 11 Minuten nach Veröffentlichung des Blog-Eintrags am 8. Okt. 2008, 05:40. Antworten
These look great. I'll definitely look at including the statistics and backup apps in any of my future freelance projects. If I find they work well, I could see myself adding them to my personal Django project skeleton.
Geschrieben von Jeff Anderson 13 Stunden, 7 Minuten nach Veröffentlichung des Blog-Eintrags am 8. Okt. 2008, 07:36. Antworten
omtv: no, django-export will only dump the contents of your database at a point in time. in fact there isn't a mechanism for restoring the data yet, it's just a (sort of) full backup for desaster recovery.
rob: sounds like a good idea. I haven't thought about a json export yet, because manage.py already handles it, but it may be a good extension to django-export.
Geschrieben von Arne 15 Stunden, 54 Minuten nach Veröffentlichung des Blog-Eintrags am 8. Okt. 2008, 10:23. Antworten