2 ms·
Anyone have any pointers on upgrading a decent sized project from 1.3? I'm looking to do it shortly and hoping for some premptive expertise with the inevitible
by mixmastamyk 15y ago
Anyone have any pointers on upgrading a decent sized project from 1.3? I'm looking to do it shortly and hoping for some premptive expertise with the inevitible gotchas... e.g. using a lot of local datetimes and sha2 passwords.
- huxley 15y agoThe password updating is pretty seamless (so long as you don't need to share the database with an older Django project). PASSWORD_HASHERS = ( 'django.contrib.auth.hashers.PBKDF2PasswordHasher', 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', 'django.contrib.auth.hashers.BCryptPasswordHasher', 'django.contrib.auth.hashers.SHA1PasswordHasher', 'django.contrib.auth.hashers.MD5PasswordHasher', 'django.contrib.auth.hashers.CryptPasswordHasher', ) You get a tuple of password algorithms that are supported. The higher on the list the greater priority it has, so if you have SHA1 passwords in your database, they will get converted to PBKDF2 when the user logs in the first time. If you decided to switch to BCrypt, you would first install py-bcrypt and change the tuple to put BCrypt at the top: PASSWORD_HASHERS = ( 'django.contrib.auth.hashers.BCryptPasswordHasher', 'django.contrib.auth.hashers.PBKDF2PasswordHasher', 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', 'django.contrib.auth.hashers.BCryptPasswordHasher', 'django.contrib.auth.hashers.SHA1PasswordHasher', 'django.contrib.auth.hashers.MD5PasswordHasher', 'django.contrib.auth.hashers.CryptPasswordHasher', ) and you're done. HOWEVER, if you are sharing the database with an older project that is still using Django 1.3 or less, make sure that 'django.contrib.auth.hashers.SHA1PasswordHasher' is on the top of the list (until all your projects are Django 1.4 or higher) otherwise your other installations won't be able to read the passwords since they won't support any of the newer password hashes.
- mixmastamyk 15y agoThanks for the detailed replies.
- huxley 15y agoNot aware of any major timezone issues (it worked fine on my projects but I was already using django-timezones and pytz), but if you have any concerns you can hold off using them by adding: USE_TZ = False in settings.py until you get a chance to test things to make sure.