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

PyCon US 2014 Summary

Seb
May 07, 2014

PyCon US 2014 Summary

Seb

May 07, 2014
Tweet

More Decks by Seb

Other Decks in Technology

Transcript

  1. A Peek At PyCon US 2014 Interesting Things I Picked

    Up MelbDjango 1.0 Sebastian Vetter @elbaschid github.com/elbaschid
  2. django-configurations • Nice handling of django settings. • Maintained by

    awesome Jannis Leidel (@jezdez) • Github: jezdez/django-configurations
  3. Leverage class inheritance from configurations import Configuration class Base(Configuration): TIMEZONE

    = 'Australia/Melbourne' class Dev(Configuration): DEBUG = True TEMPLATE_DEBUG = True class Production(Base): TIMEZONE = 'Europe/Berlin' @property def LANGUAGES(self): return Configuration.LANGUAGES + (('tlh', 'Klingon'),) python manage.py runserver --settings=mysite.settings --configuration=Dev
  4. Use environment variable from configurations import Configuration, values class Stage(Configuration):

    # .. ROOT_URLCONF = values.Value('mysite.urls') And then run: DJANGO_ROOT_URLCONF=mysite.debugging_urls gunicorn mysite.wsgi:application
  5. structlog • Nice handling of django settings. • Maintained by

    the equally awesome Hynek Schlawak (@hynek) • Github: hynek/stuctlog
  6. Setting it up with standard logging import logging logging.basicConfig() from

    structlog import get_logger, configure from structlog.stdlib import LoggerFactory configure(logger_factory=LoggerFactory()) log = get_logger()
  7. Add context to your logs, DRY and easy def function_that_breaks(self,

    shitty_data): log = get_logger().new(raw_data=shitty_data) ... log = log.bind(computed_value=random_int) ... if error: log.error('something went wrong') ERROR:structlog...: computed_value=42 raw_data=None event='something went wrong'
  8. Brython - Down With JS • Run Python 3 code

    in the browser • No need for writing JavaScript • Just add a script tag like this: <script type="text/python3"> print("Did somebody say brackets?") </script>
  9. PDB - Probing Python • Post-Mortem debugging after exceptions. •

    Defining alias es in .pdbrc. • Talk by Nathan Yergler
  10. Translations • Talk by Ruchi Varshney • Follow up to

    her talk at PyCon US 2013 • Managing translations with Smartling
  11. Cleaning Up Your Logs • Open-Source Alternative to Splunk •

    Collect your logs with logstash • Organise them in ElasticSearch • Put a nice UI on it using Kibana • And a helpful slide deck
  12. Django Migrations • New and shiny in Django 1.7 •

    It's too awesome to do it justice...try it! • South2 will be backporting to Django 1.4 to 1.6. • Check out Andrew's talk • ...and the beginning of South2
  13. Python Packaging • PyPI 2.0 is coming • It's called

    Warehouse • http://warehouse.python.org • The talk with more