Djangocon: tuesday lightning talks

Tags: djangocon, django

(One of the summaries of a talk at 2014 djangocon.eu)

Migrate an existing web application to django - Samuel Goldszmidt

What to do when you have a PHP/mysql app and want to turn it into a django site?

  • Set up a django site with the latest version (1.7) with migrations included.

  • Add your database settings.

  • Create an app and use manage.py inspectdb > yourapp/models.py to inspect your database and generate models.

  • Then create the default core django tables (just run manage.py migrate).

  • Start the initial migration manage.py makemigrations yourapp.

  • Start renaming tables and fixing things up and turn those steps into migrations.

At the end you have a nice clean set of models including automatic migrations.

You could use the “squashmigrations” command to get a new clean baseline migration after you’re ready.

Harness the speed of the wheel - Xavier Fernandez

Wheel is python’s new (binary) package format. It is a zip format archive, you can basically extract it and it is ready.

It has a specially formatted file name that includes information for the target architecture (as it can contained compiled code).

Installing from wheels is 4 or 5 times faster for Django. For something that is heavy in compilation like lxml or numpy it is 100x or so.

You can start distributing your own pure python libraries by doing a pip install wheel and using the wheel command. After that you can try to make nice binary wheels for packages that need it.

You can also use a so-called “wheel house” (something you have to configure) which caches your compiled wheels so that you can share them between virtualenvs.

Work in progress: add an option to pip to do the wheel house optimization automatically. See also http://pip2014.com/

Introducing wagtail - Matt Westcott

Wagtail is a new django-based CMS. It attracted quite some interest, especially as it doesn’t look like your typical django admin interface.

“Why another django CMS?” Well, the main diffentiator is that they’re against flexibility.

  • You can give the editor the possibility to customize everything. This also means they can mess absolutely everything up.

  • The other way is to have structured content. This level of control still gives a lot of flexibility when configuring the site, but it does make sure your site remains clean. This is the style that wagtail uses.

Django software foundation - Russell Keith Magee

The Django software foundation is the legal and funding arm of django. They’re not responsible for the actual development and also not for the conferences.

Legal: if you contribute something to django’s code base, you must fill in a django contributor agreement. The django foundation must be able to prove it owns the copyright when challenged.

Django also owns the trademark “django”. So please first look at the rules for using the “django” name before you do it. Especially when using it in a company name!

Funding:

  • You can sponsor the django software foundation as a company.

  • They recently organized a tshirt sale that brought in 7000 dollar.

Reverse funding: the foundation can fund your user group or sprint. Go and talk to them.

Responsive and adaptive design

Responsive and adaptive design is all about getting your site to work on multiple screen sizes and about limiting the amount of data you send to mobile devices.

They work for usatoday, one of the biggest sites in the USA. It is a django site. They use quite detailed device recognition. They don’t just make a mobile site and a regular site, but they even differentiate between low-end and high-end smartphones.

All for optimizing the performance on every device.

They try to do a lot on the server. CSS media queries themselves already cost quite some power on phones. Better to do the differentiation in the django templates!

Sketching - Idan Gazit

You all should be using sketching.

Sketching is not drawing. Sketching is a tool, it serves a purpose. Drawing is an art. So “I cannot draw” is no problem.

Sketching is for your visual ideas what drafts are for your writing. If you don’t get your visual ideas out of one half of your brain and onto paper and back into your other brain half via your eyes, you’re only using half your brain for this kind of task!

You need something that is cheap, fast and ugly. If it isn’t ugly, it doesn’t communicate that it isn’t ready yet.

Sketch first, prototype later. Sketch first, later on you can spend more time on usability. Start out with low resolution sketches.

You need:

  • Paper. Not some electronic device.

  • Pen. Especially a big fat one.

  • A wall. Put it on the wall and you can discuss it and make connections to other sketches you already put there. It helps your brain!

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):