<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rafał Pitoń on Medium]]></title>
        <description><![CDATA[Stories by Rafał Pitoń on Medium]]></description>
        <link>https://medium.com/@rafalpiton?source=rss-e36a0c11a1a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*T2gLq_o6hs9akvEN.jpeg</url>
            <title>Stories by Rafał Pitoń on Medium</title>
            <link>https://medium.com/@rafalpiton?source=rss-e36a0c11a1a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 00:58:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rafalpiton/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ariadne 0.2.0 Released!]]></title>
            <link>https://medium.com/@rafalpiton/ariadne-0-2-0-released-891c9f6cc3d0?source=rss-e36a0c11a1a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/891c9f6cc3d0</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Rafał Pitoń]]></dc:creator>
            <pubDate>Fri, 11 Jan 2019 14:59:58 GMT</pubDate>
            <atom:updated>2019-01-11T15:44:41.768Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Making Python GraphQL better one release at a time…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_P00X_DxUao_yhhHqKTcKA.png" /></figure><p>Wait a minute, what’s Ariadne?</p><p>We didn’t properly introduce Ariadne on our blog when we launched it in November, so let’s fix that now.</p><h3>Mirumee Labs on Twitter</h3><p>Our motto: If you can&#39;t find it, you build it. We wondered if there was a better solution than Graphene for building #GraphQL APIs in #Python. We searched... we didn&#39;t find... so we built: https://t.co/pwBJVlBOGf Just released. We want your feedback.</p><p>Ariadne is a library we’ve created that enables Python developers to implement GraphQL servers using SDL for defining schema and keeping the amount of boilerplate minimal. It’s the new kid on the block, but it’s the only Python library that offers this approach to developing GraphQL APIs. If you’ve been envious of what Apollo Server can do, we are happy to let you know it’s the main source of inspiration for what we are doing.</p><p><strong>Version 0.2.0 of Aridane is now available</strong> for installation from <a href="https://pypi.org/project/ariadne/">pypi.org</a>, bringing plenty of goodies and improvements with it! We are doubling down for a better developer experience.</p><p>To find more about Ariadne, <a href="https://github.com/mirumee/ariadne">grab the code at GitHub</a>, or <a href="https://ariadne.readthedocs.io/">see the docs</a>. But for now, let’s dive into version 0.2.0:</p><h3>Feature parity with GraphQL.js version 14.0.2</h3><p>Ariadne now has feature parity with GraphQL.js 14.0.2 — the latest release of GraphQL reference implementation. This was achieved by updating the library’s codebase to use <a href="https://github.com/graphql-python/graphql-core-next">GraphQL-core-next</a> instead of GraphQL-core as its GraphQL implementation.</p><p>This GraphQL implementation was build using modern Python features and relies on asyncio for asynchronous query execution, meaning you can now use “async” with your resolvers.</p><p>Due to this change we’ve also dropped support for Python 3.5 in Ariadne 0.2.0, now requiring Python 3.6 or 3.7.</p><h3>New API</h3><p>We are strong believers that library design should be simple to learn, but strict enough to not leave much room for developer error. In Ariadne 0.1.0 We relied on dicts for mapping resolvers to schema — an idea we’ve took directly from the Apollo-Server:</p><pre>def resolve_users():<br>    # …</pre><pre>resolvers = {<br>    “Query”: {<br>        “users”: resolve_users<br>    }<br>}</pre><p>This looked like a good idea at first: the pattern is proven and widely adopted in software; it uses basic Python types and is easy to memorize.</p><p>However, as soon as we moved to larger APIs, we found an issue in this approach; because Python doesn’t allow functions to be declared inside dicts, developers quickly end up with a file containing a number of function definitions followed by one big dict mapping those resolvers to their schema. Because that dict was usually out of their focus, a pattern started to emerge in which a developer would declare resolvers but forget to update the dict, thus not adding those resolvers to schema and surprising/confusing the dev.</p><p>Ariadne 0.2.0 does away with this by introducing dedicated objects for mapping resolvers to GraphQL types:</p><pre>from ariadne import ResolverMap</pre><pre>query = ResolverMap(“Query”)</pre><pre>@query.field(“users”)<br>def resolve_users():<br>    # …</pre><p>In this new approach the resolver can be mapped to a declared sample field. This creates a more natural order of things: type -&gt; field -&gt; resolver.</p><p>As a bonus, ResolverMap also implements simple validation logic and will raise an error if a type or field doesn’t exist in the schema.</p><p>Make sure to check the <a href="https://ariadne.readthedocs.io/en/0.2.0/resolvers.html">docs</a> for more examples and information about API changes.</p><h3>Better interoperability with Apollo tools for developers</h3><p>Ariadne now supports loading schema from *.graphql files, enabling developers to use an <a href="https://marketplace.visualstudio.com/items?itemName=apollographql.vscode-apollo">Apollo GraphQL plugin for VS Code</a> when writing schema for their API.</p><p>We’ve also created a PR (already merged and released!) that supports marking strings in Python code as GraphQL using a simple gql() function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_udAS9JGgd6hUebJJyaxTA.gif" /></figure><p>It’s now not only an awesome GraphQL tooling and a first-class development experience for Python developers, it’s also a single set of tools that can now be shared by backend and frontend developers while working on the same project.</p><p>We consider this a game-changer for software projects where a Python backend is developed together with a GraphQL frontend.</p><h3>Setting the scene for 2019</h3><p>The latest Ariadne release already has all the features required by real-world GraphQL API implementations… but we are not stopping there.</p><p>It is our goal to make the Python GraphQL experience as great as Node.js GraphQL. To achieve this end, we will continue improving Ariadne to offer a better developer experience and solve the ever-greater problem of space:</p><ul><li>Iterate on our documentation to show you how to use Ariadne and how to develop GraphQL servers using good practices and patterns</li><li>Deliver better abstractions for integration with existing server and framework libraries</li><li>Implement solutions for patterns and problems not specific to the GraphQL core, like query cost validators or connection types</li></ul><p>We have some great things in the pipeline we can’t wait to show you!</p><h3>Thank you!</h3><p>Thanks so much for you response and engagement since the release; it has surprised and motivated us. Ariadne is open source and developed on <a href="https://github.com/mirumee/ariadne/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22">GitHub</a>; we invite folk to give it a look and check out the issues marked with “help wanted”. PRs are very welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=891c9f6cc3d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My short experience from setting up Django and Ember.js project]]></title>
            <link>https://medium.com/@rafalpiton/my-short-experience-from-setting-up-django-and-ember-js-project-84302ca4abaa?source=rss-e36a0c11a1a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/84302ca4abaa</guid>
            <dc:creator><![CDATA[Rafał Pitoń]]></dc:creator>
            <pubDate>Sun, 11 Jan 2015 22:48:41 GMT</pubDate>
            <atom:updated>2015-01-11T22:53:00.563Z</atom:updated>
            <content:encoded><![CDATA[<p>(If you don’t care about my story and are here exclusively for info about getting Django to work with Ember.JS, feel free to jump straight to third section.)</p><p>I have specific attitude to new technologies.</p><p>I dislike them for taking simple things and making them annoyingly complicated to get done. HTML &amp; CSS was simple and then those “other browsers” came and complicated it. PHP was simple and then frameworks complicated it. Uploading to public_html was simple and then Python complicated it. $.ajax was simple then client-side MVC complicated it… yet I eventually cave in and learn another tool for the job.</p><h3>The cave-in</h3><p>In free time I am doing open source. For few years now bulk of my energy goes into <a href="http://misago-project.org/">Misago</a>, internet forum app that started its life as Django practice and grew up into something more serious. If you go project site and click around, you will notice that minus tiny bity of jQuery here and there, it’s static application.</p><p>If you lurk deeper you’ll find mentions that next release will be far less shy about doing all those dynamic things JS lets us do. And so I’ve did, and if you haven’t forgot intro story yet, you propably guessed already how I’ve did it… and how I failed in result.</p><h3>Adding dependencies</h3><p>For starters I’ve looked up <a href="http://emberjs.com/">emberjs.com</a> where I’ve learned there is version of lib for development use (because it does extra debugging magic) and other version of lib for production use that sacrifices that for speed. I’ve theen looked up ember-data which didn’t follow this pattern and Handlebars which had dev version that contained template compiler and runtime, and stripped down version containing only runtime.</p><p>Knowing this I’ve added <em>MISAGO_JS_DEBUG</em> setting in my settings.py and I’ve created two lists of assets in my assets pipeline (Django-Pipeline 1.4): dev list that my app loaded in <em>DEBUG</em>, and prod list that was loaded in production. Through context processor this variable was inserted into template where this tiny snippet included valid version of libs:</p><pre>{% if MISAGO_JS_DEBUG %}<br>  {% javascript “misago_lib_debug” %}<br>{% else %}<br>  {% javascript “misago_lib” %}<br>{% endif %}</pre><p>After this I’ve created my own <em>application.js </em>and<em> router.js </em>and added them to another assets list, which will hold my application JS.</p><h3>Loading Handlebars templates in dev</h3><p>While both Ember guide and Handlebars docs presented way for including Handlebars templates within html, I knew this isn’t the way I should go. My app already has 150 Django templates, and assuming every Django view that has one will have at least one Ember counterpart, this meant way too many templates to keep in single file, and thats before you start thinking about precompiling and compressing them for production.</p><p>After bringing this issue to Google, I’ve learned plenty about different build tolls from Node.JS-land as well as plenty dead django-apps claiming to solve this for me, but I wasn’t satissfied. My gut was constantly telling me “I can’t do that, this is Django country!”.</p><p>Luckily Django-Pipeline come to the rescure. Turns out it has <a href="http://django-pipeline.readthedocs.org/en/latest/templates.html#ember-js-handlebars">support for Ember+Handlebars</a> combination and discovery feature too so you don’t have to maintain long list of templates yourself. So I’ve simply created application.hbs file, navigated to 127.0.0.1:8000 and…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*h8K9BRZhDG3Olx6vIRf6Ig.png" /></figure><p>…voila!</p><h3>What’s next?</h3><p>As much as I would love to setup Django Rest Framework and start writing routers, controllers and models for my Ember app, there are few more things ”todo” before that:</p><ol><li>making STATIC_URL and MEDIA_URL known to Handlebars templates</li><li>creating Handlebars counterpart of {% static “file.jpg” %}</li><li>making Handlebars use Django <a href="https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#internationalization-in-javascript-code">javascript_catalog</a></li><li>creating <em>trans</em> and <em>blocktrans</em> helpers for handlebars and making <em>makemessages</em> fish out strings from .hbs templates</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84302ca4abaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Searching Documents in Django Projects ]]></title>
            <link>https://medium.com/@rafalpiton/searching-documents-in-django-projects-bb4b89ad8244?source=rss-e36a0c11a1a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb4b89ad8244</guid>
            <dc:creator><![CDATA[Rafał Pitoń]]></dc:creator>
            <pubDate>Sun, 01 Sep 2013 01:34:58 GMT</pubDate>
            <atom:updated>2013-09-01T01:35:48.223Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*ObSFLXv6ePQYBGt6.png" /></figure><p>If you are Djangonaut with practical experience, chances are you have already used <a href="http://haystacksearch.org/">Haystack</a> to add search feature to your project.</p><p>Haystack can be best described as “ORM” for searching data. While you can use Django’s ORM for searching your data on RDBMS level, simply building custom querysets with combinations of filter(), exclude() and Q() objects, once you will want to search longer texts you will notice this approach is severely limited and, well, quite sucky when put against today users expectations.</p><p>Your only hope is to use Full Text search, but it’s quality varies greatly between RDBMS’s and Django’s ORM support for this feature is <a href="https://docs.djangoproject.com/en/1.5/ref/models/querysets/#search">symbolic</a>.</p><p>Luckily times have changed and need for quality search resulted in birth of new type of software: search engines. Search engines can be considered special “databases” designed and build to do exactly one job and do it well: index and search large amounts of data effectively.</p><p>There is one gotcha however: just like in you query your database to get rows, you query search engine for documents that match your criteria. And as you may have expected, each search engine has more or less different syntax for search queries which results in either engine-specific code or need for abstraction layer for search queries.</p><p>Luckily there is a project that can do this for you: <a href="http://haystacksearch.org/">Django Haystack</a></p><p>Haystack is de facto bridge and “ORM” that allows you to connect your models with one of many search engines Haystack supports. Depending on amount of data and available hardware, you can either use complete search server like <a href="http://lucene.apache.org/solr/">Apache Solr</a> or self-contained search library <a href="https://bitbucket.org/mchaput/whoosh/wiki/Home">Whoosh</a>.</p><p>Haystack operates by creating special models called “search indexes” that “wrap” models in your apps and describe how they should be indexed by search engine you are using. Each search index defines “fields” that are to be stored by your search engine and used by Haystack in searches.</p><p>After search indexes for your modes are done and your search data starts to grow nicely, there is time to perform some searches. For this Haystack provides special django-like querysets builders that allow you to filter your search index just like you filtered table. Only big difference here lies queryset’s origin. Unlike Django’s querysets that ultimately origin from models managers, Haystack’s queryset origins from search index, which means as long as search indexes for your models are more or less consistent with each other, you can be searching many different models at one time using one search queryset.</p><p>Its all great BUT there is one gotcha. If you are used to Django’s documentation, you will find Haystack’s one… lacking.</p><p>Here comes my biggest gripe with Haystack: documentation. Half of time using Haystack I was surprised by erratic behavior that was not mentioned anywhere in documentation or left groping because documentation for many things is one line of code and one paragraph of description with no examples of usage.</p><p>I didn’t found anywhere in documentation that search engine ignores non-alphanumeric characters or that strings shorter than three alphanumeric characters don’t get inserted into search query ran against engine, which means using .filter(username=”to###”) has same effect as not writing any filter at all. Also if you are spanning relations in indexes, you have to write custom index_queryset() and read_queryset() methods or else you’ll see hundreds of queries from Django resolving relations for every indexed or returned item.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb4b89ad8244" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Liftoff!]]></title>
            <link>https://medium.com/@rafalpiton/liftoff-6050e856c0dc?source=rss-e36a0c11a1a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6050e856c0dc</guid>
            <dc:creator><![CDATA[Rafał Pitoń]]></dc:creator>
            <pubDate>Sat, 24 Aug 2013 15:46:48 GMT</pubDate>
            <atom:updated>2013-08-24T15:55:40.812Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*e6SW5EEVKm2mTj-e.png" /><figcaption>© 2013 SPACE EXPLORATION TECHNOLOGIES CORP.</figcaption></figure><p>And here I am writing my first post on Medium. Wow! Kudos guys for accepting me in!</p><p>Let’s start from introduction. I’m Ralph, 23 years old full-stack web dev from Poland.</p><p>I <em>make </em>the<em> </em>software, but it’s not writing code that makes me like my work. I believe that engineering is about making solutions for people problems. It’s all about understanding problems, devising quality solutions and finally seeing users having smooth experience using my work to solve their problems.</p><p>In future I hope to find time to write about designing and developing software as well as share my experiences and observations from perspective of fresh OS project developer/maintainer.</p><p>On final note I owe my knowledge of english to unhealthy amount of movies and games in my early years. My spelling, grammar and writing style may look awkward, but I’m doing my best to improve my skills.</p><p>Thanks and see ya soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6050e856c0dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>