Category Archives: Django

Reverse Proxy in Apache

Scenario: I have an apache server running on (localhost) that i want to use to access a python/django project that is being served on a private server on localhost:8000 (specifically at /museus). On my browser, i want to type: and it magically shows me what’s on localhost:8000/museus, without letting me know that there are… Read More »

Django template to respect plain text field linebreaks

If you have a text field with linebreaks in your nice django admin and your cool template refuses to respect them, use this in your template: this replaces newlines with HTML and newlines with blank lines with Learn tons of great stuff from your trusty Django docs: – Built-in template tags and filters

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

Warning: count(): Parameter must be an array or an object that implements Countable in /home/wwwmani/public_html/42/wp-content/plugins/wp-shkshell/wp-shkshell.php on line 59

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 »