DjangoCon Europe 2019. Is your pony dead?


    From April 9-14, the DjangoCon Europe 2019 Conference was held in Copenhagen . Full of hope and aspirations, I arrived at this event, and left in deep turmoil. In the article I will try to convey my impressions of the conference and comment on such a sharp change in attitude towards Django.
    Disclaimer: the article contains intolerance, categorical judgments and unjustified criticism.

    Hello everyone, I’m Maxim, I live in Austria, in Tyrol. I am a teacher at GeekBrains and co-owner of the winePad project, a collector and seller of technical data on alcoholic beverages. This is usually the data on the wines.

    About the winePad project
    We have the most accurate database in Europe. This is because all the wines in the database are personally verified by our experts. Briefly about our work: thump. And sometimes it happens harsh: when 40 approbations a day, the next morning I’m not always sure how I got home. Well, or I don’t remember where the car is parked.

    The project started in 2012 with Django 1.4 / Python 2.7 on the server, and with Jquery on the client + JsonRPC server. Now the set of technologies has increased. Anyway, we literally ran into Django.

    I joined the project in 2015, taking over the baton from Tyrolean developers. From poor quality hair was moving everywhere.

    The story of the Tyrolean shepherds, sharply re-qualified as programmers, I will leave behind the scenes. If you see their solutions, I’m sure you will suddenly want to kill everyone who calls himself a “Tyrolean programmer”.

    By February 2019, it became clear: the development of the project is impossible with the current set of technologies. In search of answers, I decided to go to DjangoCon 2019, which was held in Copenhagen very on time. What I wanted from the conference:

    1. Learn from professionals, see what I can improve in my work.
    2. Plunge into the world of new solutions for my platform.
    3. Hang out with the same Django-nerds like me. Enter, so to speak, in a party.
    4. Understand what's wrong with Django. Since 2016, thoughts regularly come that I am missing something. I just can’t understand what.

    What came of all this:

    Day zero

    On Tuesday afternoon, before the start of the conference, a Django Girls meeting was held - this is the DjangoFoundation initiative to promote Django into the female masses. From 5 p.m. registration began. 3-inch floppy disks acted as badges, anyone could write everything they wanted (ha ha) onto a floppy disk, USB drives were present.

    On all days of the conference, there was an unlimited amount of craft beer labeled “pink Django-pony,” from a local small brewery. On the one hand it’s cool, on the other ... so-so beer. The halls were decorated with pink flying horses of all sizes.

    From unobtrusive symbolism and a sense of involvement in the community of horse herders there was a special, joyful aftertaste. I met Russell Keith-Magee, the longtime developer of Django. All who came to this conference depend on its software solutions.

    When buying a ticket, I had to agree to comply with the rules of the conference on openness, tolerance, constructive criticism and respect for the sexual preferences of participants. By agreeing to this, I did not suspect what this could lead to ...

    Here I first learned about the rule of Pacman: if another person approaches the circle of conversation, the participants in the conversation MUST step aside and make room for a new interlocutor. In general, it was possible to thump and eat chips (in any quantity), get acquainted with arriving specialists, join absolutely any conversation, pull the organizers.

    Subjectivity and lack of tolerance
    Many participants were in untidy clothes, torn shoes, smelled strange, and looked swimming. This vision has not changed much in the following days. It was strange for me to see.

    In the evening I walked around Copenhagen.

    A nice town on the shores of the cold sea, Peter recalled a little. They overdo it with bicycles, but you can forgive everything for fish restaurants. This is delicious.

    In the first three days of the conference, reports were delivered in the hall for 500 people (there were 377 participants). In parallel, there were workshops in separate halls . Most of the reports are recorded on video, you can watch them on YouTube . There are no broadcasts of workshops. List and description of reports and workshops here . ALL workshops, without exception, were very poorly prepared, as other participants noted.

    During the breaks a lot of food and coffee was offered. In this regard, the conference was well prepared. Sponsor stands, mostly HR, unobtrusively stood in the lobby. I was interested in chatting with the Scandinavian headhunters.

    The first day

    Opening lecture on the situation with DjangoProject

    Briefly: help who than can.

    Workshop GraphQL

    JSON for the lazy. Life will not get better if everyone starts using a different query notation.

    Life is hAPIer

    Django REST Wrapper, start writing 4 lines of code instead of 6.

    Workshop about moving to a new version of the code without stopping the server

    The story of a ten-month heart operation with a code of 100 models. The project was created three times:

    1. With old models.
    2. With old and new models and the possibility of online-switching.
    3. Without old models and switches.

    Long and expensive.

    Because of this workshop, I missed three lectures, two spoke well, I will look in the notes:

    • 750,000 pull pull request.
    • Django web-security-headers.

    After a break with the next coffee tank there was a lecture about DJANGO-ORM . Speaker - Sigurd Ljodal. This is the developer of the current ORM, his activities can be viewed on the Django repository.

    The report is useful, but it upset me. On the one hand, the new ORM-Django has matured a lot. Sigurd, on the other hand, used undocumented features in the examples queryset.query. In a subsequent conversation with Sigurd, it struck me that he, like most Django developers, doesn’t really know the methods queryset.query.

    “Why are you using them in examples!” I asked. “Well ... like that ...” Sigurd replied.

    After all the reports, there were lightning talks. Five-minute reports for those who spontaneously wanted to speak. “Lightning” was mostly interesting, but five minutes is not enough. The purpose of the speaker is to interest, and then people can ask.

    A few beer trucks and long conversations after the lightning talks ... The first day is over.

    Second day

    Workshop: Bootstrap Django

    It didn’t work out.

    Image recognition, machine learning with Django

    No training, the use of external resources, jambs in recognition, funny pictures in the examples. Nothing but fun.

    Image Recognition Workshop

    Everything worked, and a picture of it was found among 10 others. But the speed of work crossed out everything. 20 seconds to prepare, 30-40 seconds to search. I thought: a one-time search in our project for pictures will take years. And we have tens of thousands of such requests per day. The proposed solution does not suit me.

    Visual change testing

    Front-end workers may be helpful.

    SQL-Alchemy vs Django-ORM

    Speaker Gleb from DjangoStars. I agree with the idea, but I would still implement some things through DJANGO-ORM methods. The main thing that I saw where it is possible to apply alchemy in my project.

    Workshop: full request / response path through the Django food pipeline

    It was useful to refresh knowledge. Django developer, remember: all you do is configure a WSGI application.

    Then I got the idea to speak on the “lightning”. I made a presentation and skipped some reports.

    Divine Project Documentation Report

    From the head of the RedHat documentation team.

    I jumped to thank the speaker after. She clearly explained why I should quit and start documenting my project. At the moment of gratitude, I touched her forearm. What started here !!! This is a polar fox. I thought they would put me in prison. Everything cost a verbal penalty for inappropriate behavior in relation to another participant in the conference.

    Pentapesting with ZAP

    The application will try all the methods known to it to crack the specified site.

    I immediately wanted to try to hack my project.

    Lightning was more useful than on the first day.

    Alexander (DjangoStars) talked about storage options settings

    Wrapper Story for Model Fields

    Vrapper monitors the return type of value.

    Report on installing stubs instead of showing private client data

    Useful at the stage of development, testing and logging. In the era of the universal data protection law, it’s worth considering. Alas, the author never answered why he reinvented the decorator @sensitive_variables. It seems that he simply did not read the documentation.

    Report on the use of variables with a scope within a single thread

    I have been using this solution for a long time. I can only say that the use of global variables in Django is due to lack of skills and lack of knowledge of architecture.

    After two days of the conference, I was upset: a couple of useful reports in three days. Very little about Django, very much about extraneous and unnecessary solutions. WTF ??? And even Copenhagen did not reassure me.

    The water in the canals is clean. It is seen that at the bottom. Do you see something there too?

    Brilliant third day

    This day paid off all suffering, dispelled doubts and brought even more sadness. My advice is to study everything that you find about the reports of the third day. Such a cool injection of knowledge is rarely found.

    Victorian Murder Report

    The girl told on the fingers the reason for the law on the protection of user data. I understood the underlying reason for the appearance of such a law. The problem with data protection, as well as the problem with electrical insulation, can accidentally kill someone.

    Using GeoDjango with Examples

    From the author of the GeoDjango documentation. Beauty.

    I have it planned in the project. Now I know how to implement this.

    Elastic Group Architect about company software products

    This includes elasticsearch.

    I liked the example of how to embed a graph of user activity in the Django admin panel.

    Full cycle of creating your own model field

    I liked it: I have several of my fields, but I missed a lot in the process of creating them.

    Django Plugin System

    The plugin turns on and off on the fly, checking for inclusion through ... signals. Too exotic solution to use. Once a ride in the sauce "see how else you can."

    Then I got into a speech about elasticsearch and went to the workshop. Then I missed two reports and lost time.

    But what happened afterwards can be retold many times in colors. Each time a deeper understanding of the essence of what is heard comes.

    Redesigning Your Django Project

    Sooner or later, developers come across a recommendation: Fat Models, skinny Views, stupid Templates (stupid templates, thin views, thick models).

    From myself I’ll supplement: the selection of objects only in methods ObjectManagerand in methods QuerySetgenerated ObjectManager.

    Few people have left this redistribution of code. The report contained examples of the maximum elimination of dependencies and the complete abstraction of business logic.

    This is a solid lesson to followers of the canonical style of code separation. Resistance to changes. Independence of the decision ... All that should be in a quality product. At the end of the report, literature was provided that will help to realize this.

    Super helpful.

    Then there were speeches and the closing of the official part of DjangoCon.

    And then there was a report that answered all my questions and confirmed my feelings.

    Django Redesign Outline

    Speaker - Tom Christie, creator of the Django REST framework . In the slides, Tom told and showed in the code examples why Django (and, as a result, DRF) no longer has development opportunities. Yes, you can fix bugs, yes you can add flickers or improve ORM. The general form of Django still remains unchanged.

    When Tom said, “I don’t think at all that it is possible to build a highly loaded fast system in Python,” the people fell silent.

    Tom then showed code examples on how to solve asynchrony issues in Django projects and what problems would follow.

    For the asynchronous ORM, Ariadne and the unfinished asynchronous DB driver were mentioned. For Jinja templates and redoing template code.

    The report clearly outlined that in order to create a framework ready for modern technologies from Django, you need to rewrite everything that is in Django. And preferably in another language. It was clear that Django was at a dead end of development, beautiful, comfortable, and outdated by 10 years.

    I am very grateful to Tom that he did not leave me, and showed options for where to develop
    The option is how to further cut Django, if you are not ready yet to throw this dead horse. Libraries, how to integrate, how to test. Starlet, SQLAlchemy, Jinja-templates, etc., see the slides for more details.

    Option what to do next for those who want to get down. There is no solution “just like in Django”. There was a review of existing analogues, speed, complexity, prospects. I already tried the mentioned GO, I almost liked it.

    On lightnings, I ventured to make a call to cut Django further. Only after the speech of Tom Christie - the call sounded completely unconvincing.

    The next two days consisted of sprints . Those who stayed worked with Django: they opened error messages and corrected them.

    After a successful edit, you could run up and bang a gong to the entire hall. The frequency of booms was every 5-7 minutes.

    For fun, what happens on sprints
    I looked at one of the approved edits: fixing the error converting a number to a string. ( # 30363 - Do not use exponential notation for small decimal ) django / utils / file
    And I felt really sad:
    • The edit contains a return type error.
    • Two unnecessary recursions have been added to the code.
    • Автор, похоже, не понял, как работает Decimal.
    • Тесты не проверяют все граничные случаи и возвращаемый тип данных.

    Я переписал код и подошел к одобрившему предыдущую правку, и сказал: у вас тут ошибка! И выбрал неверную стратегию: программисты не очень любят, когда кто-то говорит про их ошибки, особенно про проверенные и одобренные.

    Лучше бы было показать баг-репорт. Мне конечно же ответили, что это так и должно быть. Проверкой типов в питоне никто не занимается и, вообще, питон — язык без строгой типизации. И потому, мальчик, иди-ка ты лесом, тут и без тебя дел много. Столь неграмотного отношения к редактуре кода, и невосприимчивости к указанию на ошибку я не ожидал.

    From here one more problem arises, why Django is what it is: often people correct errors who do not understand the algorithm or idea. That is why new errors appear, curve type methods that cannot be QuerySet.as_managerdisabled GROUP_BYin the request with base_sort=True(did not check, can be fixed), or illogical solutions, as with formets and inlines in AdminModelForm.

    In addition to sprints, there were a couple of workshops, I liked the replay about ZAP. We managed to grunt the site, and security holes were found.

    And in Copenhagen, meanwhile, it was cold and sunny.

    I visited Christiania, walked through the canals and looked at the little mermaid.

    I left home in thought. I wanted to see new features in Django ... but I found them somewhere else. I wanted to convey that there was a quick and correct solution ... and failed (I’ll inform you about the bug). I wanted to enter the professional world ... but something was wrong I imagined it. Knowledge brings sorrow. The main thing is that I know where to go next.

    PS The decision about my project is made while winePad stays on Django.
    PPS I am open to discuss both the conference and Django. Ask if it is not clear.
    PPPS From June 20th, 2019 at GeekBrains, my Django course starts at the Python Development Department , I will definitely mention the important points that I learned about at the conference.

    Also popular now: