$30 off During Our Annual Pro Sale. View Details »

DjangoCon 2012 Talk

Julia Grace
September 05, 2012

DjangoCon 2012 Talk

Where the Tutorials End & the Wild West Begins: How to bring new developers up to speed on Python and Django

Julia Grace

September 05, 2012
Tweet

More Decks by Julia Grace

Other Decks in Programming

Transcript

  1. Julia Grace
    @jewelia

    View Slide

  2. –
    The Backstory
    Who, what, where, why
    @jewelia

    View Slide

  3. –
    @jewelia
    Hi, I’m Julia

    View Slide

  4. –
    @jewelia
    # engineering jobs
    >>
    # engineers

    View Slide

  5. –
    Not Everyone is a
    Djangonaut
    @jewelia

    View Slide

  6. –
    “…Experience is fungible
    with time. That's rarely the
    case with culture fit or
    passion.”
    http://www.hackruiter.com/advice
    @jewelia

    View Slide

  7. –
    A Few Disclaimers
    Just a few, I promise
    @jewelia

    View Slide

  8. –
    @jewelia

    View Slide

  9. –
    Y. M. M. V.
    (your miles may vary)
    @jewelia

    View Slide

  10. –
    Giddy up!
    @jewelia
    The Adventure Begins

    View Slide

  11. –
    I decide to join Tracy at
    @WeddingLovely
    @jewelia
    ™  She’s awesome, BTW.

    View Slide

  12. –
    We did what we had to in
    order to launch fast.
    @jewelia
    ™  Remember: many startups/ideas stay in beta
    or are just “un-launched side projects” for
    years.
    ™  Tracy iterated fast & quickly launched the first
    version of our 5 directories (she did this all as a
    designer who learned Python and Django to
    accomplish this !!)
    ™  It was(is) my job to ensure our infrastructure
    allows us to keep growing at such tremendous
    rate.

    View Slide

  13. –
    Our org structure
    @jewelia

    View Slide

  14. –
    I didn’t speak Python
    (circa 2/2012)
    @jewelia

    View Slide

  15. –
    Directories, oh my!

    View Slide

  16. –
    ™ We could launch new directories very fast by
    copying old directories and creating new CSS
    templates, changing names.
    ™ When you’re launching your MVP (minimum value
    product), you must “move fast, break things”!
    @jewelia |
    [email protected]
    This was good
    because…

    View Slide

  17. –
    ™ Significant code repetition
    ™ Inconsistencies in error handling and other
    functionality made debugging painful
    ™ 5 different Django Admin UIs
    ™ 5 Posgres DBs to query and join data across
    ™ Positive business growth meant making the
    fragmentation problem worse.
    This was bad because…
    @jewelia

    View Slide

  18. –
    Launch fast, but
    remember:
    technical debt always
    comes due.
    @jewelia

    View Slide

  19. –
    Full of LOLz!
    @jewelia
    How I Learned Django

    View Slide

  20. –
    Step 1: Google (?)
    @jewelia

    View Slide

  21. –
    https://twitter.com/i/#!/kennethlove/django-python/members
    Step 0: Ask Community
    @jewelia

    View Slide

  22. –
    Step 1: Django Tutorial*
    @jewelia
    https://docs.djangoproject.com/en/dev/intro/tutorial01/
    https://docs.djangoproject.com/en/1.4/intro/tutorial01/
    version
    There are also videos: http://gettingstartedwithdjango.com/resources/gigantuan.html
    *At the time http://gettingstartedwithdjango.com/ didn’t exist

    View Slide

  23. –
    Step 2A:
    Enlightenment(?)
    @jewelia

    View Slide

  24. –
    “Yeah, Yeah, Yeah”
    Syndrome
    @jewelia

    View Slide

  25. –
    We’re not in polls anymore,
    Dorothy.
    @jewelia

    View Slide

  26. –
    “Look over the code”
    @jewelia

    View Slide

  27. –
    The best way to learn is to
    write production quality
    code that someone other
    than you can consume.
    @jewelia

    View Slide

  28. –
    Step 2B: Fix a bug
    @jewelia
    ™  Be upfront about your team’s debugging best
    practices.
    ™  Devs may know how to debug other languages
    and environments, but not necessarily Python/
    Django.
    ™ Django debug toolbar has saved me N times when
    I need to see SQL Django is executing:
    https://github.com/django-debug-toolbar/
    django-debug-toolbar

    View Slide

  29. –
    ™ Introduces notion that package might exist for
    features you want to build.
    Chose bugs that involve
    3rd party packages
    http://www.djangopackages.com/
    @jewelia

    View Slide

  30. –
    ™  I chose single sign-on with Etsy
    (http://www.etsy.com/developers)
    ™  A lot of fun moving parts:
    –  OAuth2
    –  3rd Party API
    –  Parsing Data
    –  Needed good error handling
    Step 3: Build a Feature
    @jewelia

    View Slide

  31. –
    Step 3A: Build a
    Feature…as a project?
    ™  Best way to prevent “Django magic
    syndrome”
    ™  Votizen does this in their interview process:
    https://github.com/votizen/careers/blob/
    master/RemoteCodingProblem.rst
    @jewelia

    View Slide

  32. –
    Learning Django !=
    Learning Python
    Python
    Amount of Python I
    learned & understood
    while learning Django
    @jewelia

    View Slide

  33. –
    ™  Download IPython to practice
    writing Python: http://ipython.org/
    ™  Saved PDF version of Think Python for quick searching:
    http://www.greenteapress.com/thinkpython
    ™  Printed out this cheat sheet & hung it over my desk:
    http://hairysun.com/downloads/
    BegPythonHandout.pdf
    Step 4: Learn a Little
    Python
    @jewelia

    View Slide

  34. –
    Step 5: Build Something
    that Breaks Something Else
    django-hosts + + django +
    DB
    routing
    1 Django Project 5 Postgres DBs
    5 Django Applications
    ™ …or build something that breaks almost
    everything else.

    View Slide

  35. –
    ™  All 5 Django applications used:
    –  auth-user
    –  taggit
    –  django-comments
    –  admin (*this actually worked great!)
    …but I had 5 different auth-user, taggit,
    django-comments tables in 5 different DBs.
    Why the Fail
    @jewelia

    View Slide

  36. –
    Rise from the FAIL ashes
    django-hosts + +
    1 Postgres DB
    1 Django Project
    1 Django Application
    @jewelia
    ™  There is a time and place when code must be
    completely rewritten…into something
    simpler.

    View Slide

  37. –
    ™ That is a whole other talk.
    ™ Solution: python script + SQLAlchemy +
    namespaced all the data
    ™ …but come up with tests beforehand to check the
    migration was successful!
    ™ Tests could be as simple as just counting to ensure
    *all* the data migrated.
    Data Migration
    @jewelia

    View Slide

  38. –
    @jewelia
    Thanks!
    Slides:
    http://speakerdeck.com/u/jewelia

    View Slide