Skip to main content

Posts

Showing posts with the label migration

Django 1.5 migrating to new url tag syntax

Django 1.5 changed. The url tag syntax from {% url  my_page %} into {% url "my_page" %} . Now all my templates should be changed accordingly to migrate to 1.5. You could do it with executing this command in your bash shell. Assuming you are in the project folder. Assuming you have version control, or do know how to backup your work ;). Some people claim it is unsafe. But you may want to make it safer with adding '{%' to the beginning of the string. To make sure only templates arre changed. Or either execute this only in your templates folder to be sure. $ find . - type f - print0 | xargs - 0 sed - i 's/ url \([^" >][^ >]*\)/ url "\1"/g' And one person did a django snippet for this operation. You may also find it useful.  http://djangosnippets.org/snippets/2905/

Migration from HDD to SSD with Mac OS X Lion

Today I'll try to cover my migration experience. I have bought myself an OCZ Technology 128GB Vertex 4 SSD from Amazon. And I also have an external 1 Tb HDD. I'm using it for migration purposes as a backup Time Mashine. So to migrate yourself without reinstalling operating system and so on you need: 1. Compact your data. Usually HDD's, installed in Mac's, are much bigger then SSD's you buying. And to tell you the truth, you probably do not need a 512 Gigabytes SSD at all. Most of data are accessed rarely and do not require speedy storage. So COMPACT them. Move to an external HDD and/or delete. Time to cleanup one word. There are also several places that can be easily deleted without much troubles. They are iTunes backup caches for your iOS devices, like iPhones and iPads. they are usually sotred on your user library path. You can delete them without sorry from either: ~/Library/Application Support/MobileSync/Backup  folder or in your iTunes => Preferen...

Django: upgrading django from 1.1 to 1.2.5 and CSRF protection modifications

Greetings! Yesterday I completed a quick upgrade from django version 1.1 to oldest supported 1.2.5. I had a lot of background for doing so: - Fist my hosting has django 1.2.5 already installed. - Second I had some thoughts on using old stuff. It's better to evolve in Djngo version too :) - Third and the main: Newly found on Google social authentication plugin was the final dot in my decision... So I'll try to provide My experiences on migrating (updating) my project's Django from version 1.1 (developed on it) to oldest now supported 1.2.5. Let's get started. 1. Read the release 1.2 docs.  I needed a quick solution. In general I had some issues with site giving me errors with {csrf_token} not present in a form's POST request. To handle this and IMHO main issue upon upgrading you have to handle Cross Site Request Forgery protection backwards incompatible upgrade.  You can read official django docs about new CSRF protection and/or use this quick manual. ...