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

The year ahead (DjangoCon 2012)

The year ahead (DjangoCon 2012)

BDFL keynote from DjangoCon US (Washington, DC), Sept. 5, 2012.

adrianholovaty

September 05, 2012
Tweet

More Decks by adrianholovaty

Other Decks in Programming

Transcript

  1. • Alpha: Oct. 1 (feature freeze, branch created) • Beta:

    Nov. 1-ish • Release candidate 1: end of November • Release candidate 2: early December • Final: Christmas! Django 1.5 timeline
  2. • Django 1.5: Deprecation warning • Django 1.6: Separate (bundled)

    packages, shim in repo • Django 1.7: HTTP 410 (GONE) Deprecation policy
  3. >>> from django.contrib import comments Traceback (most recent call last):

    File "<stdin>", line 1, in <module> ImportError: What, you actually USE this monstrosity?!
  4. >>> from django.contrib import databrowse Traceback (most recent call last):

    File "<stdin>", line 1, in <module> ImportError: Sorry, it was a cool concept, but we never got around to finishing it.
  5. >>> from django.conf import settings >>> settings.PROFANITIES_LIST Traceback (most recent

    call last): File "<stdin>", line 1, in <module> FrameworkPlea: Oh, God, please just let this setting die already.
  6. >>> from django.conf import settings >>> settings.SEND_BROKEN_LINK_EMAILS = True Traceback

    (most recent call last): File "<stdin>", line 1, in <module> StupidSettingsError: C’mon.
  7. >>> from django.conf import settings >>> settings.SEND_BROKEN_LINK_EMAILS = True Traceback

    (most recent call last): File "<stdin>", line 1, in <module> StupidSettingsError:
  8. >>> from django.conf import settings >>> settings.AUTH_PROFILE_MODULE Traceback (most recent

    call last): File "<stdin>", line 1, in <module> ThatStinks: Code smell detected
  9. class User(models.Model): username = models.CharField(max_length=30, unique=True) first_name = models.CharField(max_length=30, blank=True)

    last_name = models.CharField(max_length=30, blank=True) email = models.EmailField(blank=True) password = models.CharField(max_length=128) is_staff = models.BooleanField(default=False) is_active = models.BooleanField(default=True) is_superuser = models.BooleanField(default=False) last_login = models.DateTimeField(default=timezone.now) date_joined = models.DateTimeField(default=timezone.now) groups = models.ManyToManyField(Group) user_permissions = models.ManyToManyField(Permission)
  10. In myapp/models.py from django.contrib.auth.models import User class UserProfile(models.Model): user =

    models.OneToOneField(User) # required # Other fields here favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20)
  11. In myapp/models.py from django.contrib.auth.models import User class UserProfile(models.Model): user =

    models.OneToOneField(User) # required # Other fields here favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20) In settings.py AUTH_PROFILE_MODULE = 'myapp.UserProfile'
  12. In myapp/models.py from django.contrib.auth.models import User class UserProfile(models.Model): user =

    models.OneToOneField(User) # required # Other fields here favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20) In settings.py AUTH_PROFILE_MODULE = 'myapp.UserProfile' In views.py request.user.get_profile()
  13. In myapp/models.py class User(models.Model): username = models.CharField(max_length=100) password = models.CharField(max_length=128)

    favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20)
  14. In myapp/models.py class User(models.Model): username = models.CharField(max_length=100) password = models.CharField(max_length=128)

    favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20) In settings.py USER_MODEL = 'myapp.User'
  15. In myapp/models.py class User(models.Model): username = models.CharField(max_length=100) password = models.CharField(max_length=128)

    favorite_animal = models.CharField(max_length=20) favorite_beatle = models.CharField(max_length=20) In settings.py USER_MODEL = 'myapp.User' In views.py request.user
  16. • Backwards compatible: fall back to old auth.User model •

    Any User model can work with the admin, using a clearly defined interface Design goals
  17. def mypage(request, slug): obj = request.app.query(MyModel).get(slug=slug) return request.app.render('mypage.html', {'obj': obj})

    from django import YetAnotherAppClass app = YetAnotherAppClass(settings={ 'DATABASES': '...', 'TEMPLATE_DIRS': ['/path/to/templates'], }, rootview=my_urls) app.runserver()
  18. >>> from django import javascript_stuff Traceback (most recent call last):

    File "<stdin>", line 1, in <module> NotImplementedYet: But it’s about time.
  19. Overview Click link Trigger Ajax request Server says: “These bits

    changed” JavaScript changes the page in place
  20. Overview Click link Trigger Ajax request Server says: “These bits

    changed” JavaScript changes the page in place URL gets updated with pushstate