DjangoCon Europe 2015: Day 1

I’m lucky enough to be attending DjangoCon Europe this week.  See the schedule of talks for a teaser.  Talks are all being videoed and transcribed and will be shared online soon.

My thoughts and fairly rough notes to self can be found below:

Baptiste Mispelon: Baptiste’s adventures in Djangoland

This speacker was very encouraging of welcoming new members to the community

Look up PyCON INC?? Pixy dust workshops? Must have misheard this but there is another group akin to django girls

Hanna Kollo: Avoiding monoliths

Uses some Erlang – load sensitive

Dealing with fluid requirements

Over engineering upfront to be very modular can lead to issues with referencing other apps

Instead incrementally creating new apps from the initial app.

Grow in a tree like structure, app at a time.

Aim – when you add new feature only need to touch one app

They use a services layer – found idea on stackoverflow article – look up seemed to work for them.

Sounds like their project could be on the scale of BOS codebase.

She thinks services and unit tests first, end user HTML later.

Q: A repo per app

A: Same repo for all the apps

Abdulrahman Alotaibi: Injecting Django into the work environment

Snakes and rubies convinced him to go down the Django vs Ruby path.

Use of clis

See slide that covers principals he brought into place in his team.

Cardiff University Wellbeing service

Daniele puts out a call to assist with sprint to develop something for the Cardiff Wellbeing centre. They are volunteering and offering free 25 minute counselling sessions slots to attendees.

Ola Sitarska: Pushing the pony’s boundaries

Lots of experience creating Django admin interfaces.  Jokes about leaving PHP behind.

Discusses how the admin site is wired together

Useful overrides for admin site:

  • site_title
  • index_title
  • site_header
  • save_as (save as new)
  • show_full_count – may wish to disable in certain circumstances

Ola’s favs:

  • actions_on_top boolean
  • actions_on_bottom

Don’t use list_editable as not currently multi user safe way of editing your database.

ChangeList – if overriding here, maybe you are in too deep

Tips & tricks:

Advanced permissions

method overrides used to achieve permissions for DjangoGirls websites

  • get_queryset
  • get_form
  • get_readonly_fields

Customising changelist

Additional annotations for attributes/properties that appear on changelist.

  • attribute. is_boolean
  • attribute.allow_tags
  • custom actions
  • django admin autocomplete – look up
  • Look up: rowid fields

She wants to see updates to django admin area

Supporting django-flat-theme – updated CSS mainly

Ola wishes admin components were more reusable

Dafydd Evans: CAMEL, the Cardiff Maths e-learning project

Lecturer

Font has held Mathematics back from exploding on the web.

Can we do something with Latex and eLearning

Will unicode come and save us in the end ;)

MathJax is a revolution.  Javascript, accessible browser rendering of Mathematical symbols

https://github.com/mathjax/

http://docs.mathjax.org/en/latest/glossary.html#term-mathml

Describes a very interesting start of a Maths VLE.

MathML – not human readable

#django live

Django core committers fielded IRC style questions from the audience

Lucie Daeye: Reaching out – Django in the social sciences

Spoke about the importance of bringing humanities students along with digital/programming movement.

Made an interesting point about the lack of non mathematical examples when demonstrating coding constructs.  e.g frequent citations of coding the Fibonacci sequence.

Mentioned a good resource aimed at non programmers, Hello web app.

Yann Malet: Salt for Django developers

Introduced Salt terminology and showed some basic Salt commands.

Presentation tip: Use Ctrl + L to move cursor to be shown at the top of the terminal window

Salt allows you to add breakpoints

salt-cloud – provision AWS etc

mines are data stores

He co-wrote the book High Performance Django

There is talk of hpd-states

Mathieu Agopian: Switching from nose to py.test at Mozilla

Tips:

a much better write up

pytest-cache --lf run the last test that failed

You can decorate with parameters to re-run the test with different variables

When even Google cannot help you.  Mishearing jungle parler will not help you search for the django parler internationalisation egg ;)  Context helped me decode viable to mean variable a lot sooner ;)

why use py.test?

  • More pythonic – eg use clean asserts
  • well supported
  • Claims current tests are compatible – diff counts beg to differ
  • Look up autouse – node related egg for fixtures
  • Better output

Look out for slide notes – he was very keen on py.test and was using it at Mozilla.

Look into the cricket test tool

Erik Romijn: A sincere tale of Django, developers and security

Walked through an example of a PHP script that he found online that had huge security issues.

He developed an online tool to check security configuration of a django site

All related to prefixed SECURITY_ settings.

Recommends book: Bulletproof SSL and TLS

Remember to test for unexpected cases.  e.g not just test for logged in user, test when not logged in too.

Check out requires.io – tracks the releases of your dependencies

@erikpub

Maik Hoepfel: On privilege and moral duty

An almost poetic call to embrace life and do more with our ability to change many lives.

Micro Python – shrinking Python down to run on a micro controller (Damien George)

Damien George, a researcher at the University of Cambridge, has rewritten Python to be optimised for running on a micro controller.  For example, the small computers that you might find in your washing machine, sometimes only have 64kb of RAM, so are generally controlled by programs written in C.

MicroPython is implemented on Python 3 and includes the usual Python features, such as:

  • floating point
  • complex numbers
  • bignum
  • math apps
  • generators
  • classes

Uses 528 bytes of RAM at standing and MicroPython will run on various operating systems as well as bare metal.

There are some differences, like not redefining built-ins functions and Micro Python uses garbage collection.  For more information https://github.com/micropython/micropython/wiki/Differences

The open source project at: http://github.com/micropython has been well received with over 1200 stars and 170 forks.

The Pyboard

  • is Python on bare metal, USB port, SD card port, accelerometer, 192k RAM or can can run stand alone from a battery.
  • made by Geltech
  • £28 per board
  • Light version is coming that is a lot cheaper, expected to be around £20

More information: http://micropython.org/

How does a spreadsheet work? A tour of the codebase of Dirigible, the Pythonic spreadsheet by Harry Percival

As always an entertaining speaker.  Harry gave us a world wind tour of the code related to a end of life, open source, project https://github.com/pythonanywhere/dirigible-spreadsheet

He also encouraged any self respecting Pythonista to sign up and register for an account at  www.pythonanywhere.com.

Tip: Did you know you could add a name space to eval commands, to limit their scope.

Plot.ly

Talk entitled: Collaborative, streaming, 3D, and interactive matplotlib, ggplot2, and MATLAB plots in an IPython Notebook with Plotly by Chris Parmer & Carole Griffiths

The idea behind plot.ly was to bring web standards to graphing and data analysis.

Reason for being: Experiencing teams making graphs in various tools and trying to share it them.  This could literally be a case of working with a dedicated graphing tool and then creating and emailing screen shots, as their colleagues all used different tools.

The team wrote a wrapper for iPython to translate graphs into a plot.ly based graphs.

Graphing news feed- https://plot.ly/feed/#sob

Overview

  • creates shareable d3.js graphs links that are interactive
  • includes plotting streaming data
  • limited by the browser – 50,000 points before browser slows – can get to 200,000 points in some cases using optimisation of rendering overlapping points
  • like github for graphs
  • aimed at small to medium data at present
  • currently around 20 developers – doubling ever few months over the last 6 months
  • 18 month old project
  • can have it installed locally on a private network – paid for model. Free tool, can create a limited number of private graphs, say 20.

Wrappers/APIs

Various wrappers exists – https://plot.ly/api/

  • ggplotly for R
  • matplotlib
  • MATLAB
  • plot.ly – has a spreadsheet like interface online too.
  • any graph can be edited via code or through online GUI

User base

  • data journalists
  • engineers
  • etc

Various output formats, such as svg, png, available as RESTful calla.

Open source library – cached request model – to handle connectivity breaks.

Can pull graphs back into Python. Also can extract JSON output of the data used in the graph.

No limit on the data storage at this stage.  1/2 million rows have been uploaded say

Technology

  • d3.js for the graphs
  • Uses map.js – for adding notations/formulas to graphs
  • Plot.ly is  a layer written on top of d3.js

JavaScript makes this graphing tool available to more people, as the technology is already in their browser.

Roadmap

  • Better data API
  • Adding datasets directly to plot.ly – several graphs referencing a single dataset.
  • Symbolic formulas, to plot transformations say in Physics
  • To keep a trace of the transformations, all the steps to transformation.
  • Improve 3D maps