Tag Archives: python

Remove repeated adjacent characters from string

Given a string like: “aabbdeeeef” or “bbbbbbb” we want to output: “abdef” and “b” respectively. here are a few ways to do it in Python:

Quickly change a Django user password

So you have this nice django site, you try to access the admin to change some minor thing and you completely forgot (and didnt save somewhere) the password of the only user in the system – so many dont’s in that sentence, but anyway… Since you are the developer, you can simply do this (assuming… Read More »

How to add robots.txt to a Django project

So we had this nice, unfinished project, publicly shared on a public server being indexed like a pig’s behind on google servers. Some searches on google had hits to full length urls to this unfinished project on the test server. Easily stopped using the robots.txt, except that its a Django site and its not as… Read More »

How to check Django version

Since we are in the version theme, here’s how to check what version of django is installed in your python: From your python prompt: >>> import django >>> django.VERSION you will get something like this: $ (1,2,7, ‘final’, 0) Versions depending on your installation. Or you can type this on your command prompt (windows): c:\whatever>… Read More »