Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's new in Django 1.9

Marc Tamlyn
October 20, 2015

What's new in Django 1.9

Marc Tamlyn

October 20, 2015
Tweet

More Decks by Marc Tamlyn

Other Decks in Technology

Transcript

  1. What's new in
    Django 1.9
    Parallel permission passwords?

    View Slide

  2. Django 1.9
    • Beta 20th October
    • RC mid Nov
    • Final early December
    • PLEASE TEST

    View Slide

  3. Password validation
    • Opt-in AUTH_PASSWORD_VALIDATORS
    • Min length, common passwords, user
    similarity, non-numeric
    • Framework for your own password
    validation logic

    View Slide

  4. Password validation
    class PasswordValidator(object):
    def __init__(self, **kwargs): pass
    def validate(self, password, user=None):
    if condition(password):
    raise ValidationError(…)
    def get_help_text(self):
    return "Your password must be…"
    def password_changed(password, user=None):
    # check not the previous password

    View Slide

  5. Permission Mixins
    • Similar django-braces and decorators
    • AccessMixin, LoginRequiredMixin,
    PermissionRequiredMixin, and
    UserPassesTestMixin

    View Slide

  6. Parallel tests
    • ./manage.py test --parallel
    • Separate process and database for each
    core
    • Requires tblib
    • Does not work with Windows or Oracle

    View Slide

  7. On commit hook
    • transaction.on_commit(func)
    • Executes func when the current transaction
    commits
    • Good for queueing tasks or email
    notifications

    View Slide

  8. New admin theme

    View Slide

  9. ORM
    • JSONField
    • GDALRasters
    • Expressions in save()
    • Greatest, Least, Now
    • Transform and Func unified

    View Slide

  10. Forms
    • CharField now strips whitespace by default
    • Unicode slug support
    • Field ordering

    View Slide

  11. CLI
    • python -m django
    • --noinput has --no-input alias

    View Slide

  12. Testing
    • response.json()
    • client.force_login(user)

    View Slide

  13. Deprecations and backwards
    incompatible changes
    • Python 3.2 and 3.3 dropped
    • ForeignKey(model, on_delete)
    • Global timezone adaption
    • Relative Location header
    • Implicit __in removed

    View Slide

  14. Final removals
    • SortedDict
    • utils.unittest
    • syncdb
    • initial_data
    • old model loading
    • manage.py validate
    • .util modules
    • request.REQUEST
    • IPAddressField
    • import_by_path
    • FastCGI support
    • {% url %} in future

    View Slide

  15. Django 1.10 ideas
    • Improved MSSQL support
    • Full text search
    • Custom indexes
    • Even more improved expressions
    • Async worker/communication layer
    • August 2016

    View Slide

  16. Marc Tamlyn
    @mjtamlyn
    photocrowd.com

    View Slide