<?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[Rock and Null - Medium]]></title>
        <description><![CDATA[Tech, software and whatever comes to mind. - Medium]]></description>
        <link>https://medium.com/rocknnull?source=rss----45dd21ca8c08---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Rock and Null - Medium</title>
            <link>https://medium.com/rocknnull?source=rss----45dd21ca8c08---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:07:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/rocknnull" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Converting Callback-based SDK methods to Coroutines in Kotlin]]></title>
            <link>https://medium.com/rocknnull/converting-callback-based-sdk-methods-to-coroutines-in-kotlin-8184b373c7d9?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/8184b373c7d9</guid>
            <category><![CDATA[kotlin-coroutines]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Fri, 07 Jul 2023 13:05:28 GMT</pubDate>
            <atom:updated>2023-07-07T13:05:27.977Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Lxj8TFEbVaP27vuG" /></figure><p>Kotlin’s coroutines are an excellent feature of the language that makes asynchronous programming enjoyable and easy to understand.</p><p>However, even if you have organized your project neatly and extensively use coroutines, you may encounter a third-party library at some point that still uses old-fashioned callbacks. Combining callbacks and coroutines can be unpleasant, to say the least.</p><p>Luckily, there is a solution to this problem. You can wrap these callbacks and “transform” them into coroutines. It’s generally a good practice to wrap your external dependencies and provide a consistent coroutine-style interface, regardless of the interface offered by the third-party libraries.</p><p><a href="https://www.rockandnull.com/convert-callbacks-coroutines-kotlin/">Continue reading…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8184b373c7d9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/converting-callback-based-sdk-methods-to-coroutines-in-kotlin-8184b373c7d9">Converting Callback-based SDK methods to Coroutines in Kotlin</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Metrics pollution and how to avoid it]]></title>
            <link>https://medium.com/rocknnull/https-www-rockandnull-com-metrics-pollution-and-how-to-avoid-it-89e52c893780?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/89e52c893780</guid>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Sun, 11 Jun 2023 10:47:18 GMT</pubDate>
            <atom:updated>2023-06-11T10:47:18.082Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BPZKwAHRakez-leB" /></figure><p>I believe that in today’s product development landscape, there is a prevailing culture driven by metrics. It all started with good intentions — the desire to make data-driven decisions rather than relying on hunches. However, over time, I have realized that this approach has become counterproductive.</p><p>As digital products became more prevalent, product managers began placing increasing importance on metrics. It wasn’t just a slight uptick in their usage; it was a significant shift. Now, every single user interaction in popular apps is meticulously tracked — from the tiniest button click to the length of time a user spends gazing at a particular element.</p><p><a href="https://www.rockandnull.com/metrics-pollution-and-how-to-avoid-it/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89e52c893780" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/https-www-rockandnull-com-metrics-pollution-and-how-to-avoid-it-89e52c893780">Metrics pollution and how to avoid it</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Should we still write software engineering blog posts?]]></title>
            <link>https://medium.com/rocknnull/should-we-still-write-software-engineering-blog-posts-ffd924c3e1d4?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/ffd924c3e1d4</guid>
            <category><![CDATA[blogging]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[tech-blog]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Mon, 29 May 2023 08:34:35 GMT</pubDate>
            <atom:updated>2023-05-29T08:34:35.839Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*z_2ezbTpy6HtN_Km" /><figcaption>Photo by <a href="https://unsplash.com/es/@soymeraki?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Javier Allegue Barros</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>We initiated this blog with the realization that we were consuming a lot of content on the internet without actively contributing. As software engineers, both as a hobby and professionally, we have become accustomed to relying on search engines to find solutions and complete our software projects. Often, our queries led us to blog posts, Stack Overflow threads, or forum discussions where we discovered the answers we sought.</p><p>Hence, we naturally created this blog as a way to document our own software engineering discoveries, hoping to assist fellow engineers who may encounter similar challenges. Initially, it worked well, serving as a valuable resource for others. However, as we enter the era of artificial intelligence, the way people seek software engineering solutions is changing. Traditional search engines are being replaced by AI language models like Google Bard and ChatGPT, which provide direct answers. There is no longer a need to sift through blogs, forums, or personal websites to find solutions.</p><p>Given this new reality, one might question the purpose of continuing to write these concise blog posts that aim to address specific engineering issues. Initially, it may seem unnecessary. After all, why maintain personal notes when the answers are just a chat away?</p><p><a href="https://www.rockandnull.com/software-engineering-blog-posts-in-ai-era/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffd924c3e1d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/should-we-still-write-software-engineering-blog-posts-ffd924c3e1d4">Should we still write software engineering blog posts?</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bump version code for Android apps using GitHub Actions]]></title>
            <link>https://medium.com/rocknnull/bump-version-code-for-android-apps-using-github-actions-d5dd412ddb3f?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/d5dd412ddb3f</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[play-store]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[automate]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Mon, 17 Apr 2023 10:45:02 GMT</pubDate>
            <atom:updated>2023-04-17T10:45:01.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*wBmsi1tOZVbIR2jA" /><figcaption>Photo by <a href="https://unsplash.com/@hjwinunsplsh?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Jungwoo Hong</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>Play Store, since the beginning of time, had the same policy about <a href="https://developer.android.com/studio/publish/versioning">versioning</a>: every artifact uploaded and served from Play Store should have a unique version code. And this is a reasonable requirement for tracking reasons.</p><p>The only downside is that they leave the developer the responsibility of bumping and maintaining the version code. There’s no way to “auto-increase” the version code. The version code is stored in the build.gradle file which means the codebase needs to be touched for the version code to be kept in sync with what you are uploading to the store.</p><p>To automate the process of bumping the version code and then committing the updated version to the codebase, we can have a GitHub Action (if you use GitHub; but the equivalent can be created for other sites) that does the “boring” work for us. More specifically, the process can be as follow:</p><p><a href="https://www.rockandnull.com/github-actions-android-version/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5dd412ddb3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/bump-version-code-for-android-apps-using-github-actions-d5dd412ddb3f">Bump version code for Android apps using GitHub Actions</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android CI/CD part 2: Building and pushing to Play Store in GitHub Actions]]></title>
            <link>https://medium.com/rocknnull/android-ci-cd-part-2-building-and-pushing-to-play-store-in-github-actions-805e258ba8c1?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/805e258ba8c1</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 16:26:08 GMT</pubDate>
            <atom:updated>2023-03-24T16:26:07.960Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*R7h786wr2CXdRARd" /></figure><p>In the <a href="https://www.rockandnull.com/fastlane-android/">previous post</a> of this series, we showed how to use <a href="https://fastlane.tools/">Fastlane</a> to create an automated way to build, package, and upload your Android app to Play Console’s Internal test channel locally. In this post, we will show how to use that same script but running it on GitHub Actions to create a CI/CD system that gets triggered when you push to a specific branch.</p><p>As noted in the previous post, we aim to make this automated way as CI/CD-agnostic as possible. Therefore, even if you are not using GitHub Actions, I believe that this will be easy to adapt to the platform of your choice.</p><h3>Set the variables</h3><p>In the last post, we created a script that sets the necessary environment variables and then runs the fastlane deploy command. So the first thing here is to set the environment variables in the GitHub Actions runner.</p><p>In your GitHub project, head to the Settings tab -&gt; Secrets and variables -&gt; Actions. Note that the secrets that you are setting will not be readable once you set them. You would be able to update their value, but not see the existing value. So make sure that you store the values of these secrets safely somewhere else. From there you would need to set these secrets:</p><ul><li>GPLAY_SERVICE_ACCOUNT_KEY *</li><li>STAGING_KEYSTORE_FILE *</li><li>STAGING_KEYSTORE_PASSWORD</li><li>STAGING_KEY_ALIAS</li><li>STAGING_KEY_PASSWORD</li><li>STAGING_PACKAGE_NAME</li></ul><p>The 2 variables with the asterisk are not string values, but files that need to be stored here somehow. We will use <a href="https://en.wikipedia.org/wiki/Base64">Base64 encoding</a> to store these files as strings.</p><p><a href="https://www.rockandnull.com/github-actions-android/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=805e258ba8c1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/android-ci-cd-part-2-building-and-pushing-to-play-store-in-github-actions-805e258ba8c1">Android CI/CD part 2: Building and pushing to Play Store in GitHub Actions</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android CI/CD part 1: Locally building and pushing to Play Store using Fastlane]]></title>
            <link>https://medium.com/rocknnull/android-ci-cd-part-1-locally-building-and-pushing-to-play-store-using-fastlane-cfc28032d8ed?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/cfc28032d8ed</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[play-store]]></category>
            <category><![CDATA[google-play-console]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Sun, 19 Mar 2023 18:11:23 GMT</pubDate>
            <atom:updated>2023-03-19T18:11:23.111Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NUFS3TUPO30MQrXj" /><figcaption>Photo by <a href="https://unsplash.com/@wstn?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Ben Garratt</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>Automating the deployment of Android apps to Google Play, I believe is a must for teams with more than 1–2 people. Having the latest test version on your physical device, allows you to perform more thorough testing and allows non-engineer members of the team to play with the app and maybe even contribute to QA.</p><p>Even though Play Console is elegant and intuitive, having to manually do these test releases is arduous and a waste of time. The good news is that Play Console provides an API to perform almost all the publishing actions. The bad news is that it takes some time to set it up and requires many steps.</p><p>In this 2 posts series, I aim to give the simplest way possible to set up a CI/CD system for Android apps using GitHub Actions. The result would be to push to a specific branch (e.g. called staging) and the Android app will be deployed to Play Console&#39;s internal testing channel. If you add and properly opt-in testers in that channel, then they will get an available update for the specific app within a few minutes (for an overview of Play Console&#39;s distribution capabilities, <a href="https://www.rockandnull.com/google-play-console-publish/">check this post</a>).</p><p>In general, most CI/CD platforms such as GitHub Actions do not offer running them locally. This makes it hard to debug while setting up the system. Therefore, my preference is to create pipelines that are as CI/CD-agnostic as possible. In this case, I will be using <a href="https://fastlane.tools/">Fastlane </a>which is a tool for automating many app-specific workflows, for iOS &amp; Android, including pushing to the Play Console Internal channel. Once we set this up, and test it locally, we will just run this in the GitHub Action runner in the next post.</p><h3>Set up access to the Google Play Developer API</h3><p>The first step in this journey is to get access to the <a href="https://developers.google.com/android-publisher#start">API</a> that allows you to make publishing actions in the Google Play Console. The steps to set this up are <a href="https://developers.google.com/android-publisher/getting_started">listed here</a>. What you want to end up with, is a JSON file that has the credentials for a service account that has access to your developer account. Since these steps are confusing at first, I am listing here an overview of what needs to be done (at the time of writing):</p><p><a href="https://www.rockandnull.com/fastlane-android/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfc28032d8ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/android-ci-cd-part-1-locally-building-and-pushing-to-play-store-using-fastlane-cfc28032d8ed">Android CI/CD part 1: Locally building and pushing to Play Store using Fastlane</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a User Profile model in Django to hold additional user info]]></title>
            <link>https://medium.com/rocknnull/creating-a-user-profile-model-in-django-to-hold-additional-user-info-caa12156e29a?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/caa12156e29a</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[django-admin]]></category>
            <category><![CDATA[django-framework]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Sat, 04 Mar 2023 13:44:45 GMT</pubDate>
            <atom:updated>2023-03-04T13:44:45.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-ABIHo-tfrhx6oVD" /><figcaption>Photo by <a href="https://unsplash.com/@benjaminsweet?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Ben Sweet</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>Creating a new user in a Django project is quite straightforward and well-documented.</p><p>But most of the time, you want to capture more data than the basic user model provided by Django. You see, the default Django user model only contains fields for the first name, last name, and email. The typical registration flow usually requires more data to be captured. In this case, the recommended way is to create a user profile model, and “link” it to the user using a one-to-one relationship.</p><p>In this post, we will show a complete example of declaring a user profile model, the registration form that contains both the user fields and the user profile fields, and finally the view that will handle the creation of the user and user profile instances in the database.</p><h3>Model</h3><p>class UserProfile(models.Model): user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) id_number = models.CharField(max_length=20, unique=True) occupation = models.CharField(max_length=50, blank=True) address = models.CharField(max_length=100) street_number = models.CharField(max_length=10) flat_number = models.CharField(max_length=10, blank=True) zip_code = models.CharField(max_length=10) city = models.CharField(max_length=50)</p><p>The only highlight in this model declaration is the use of OneToOneField relationships. This means that instances of this UserProfile model can point to one and only one instance of the User model.</p><p>Also, note that we are not referencing directly the User model, but we are using settings.AUTH_USER_MODEL as <a href="https://docs.djangoproject.com/en/dev/topics/auth/customizing/#referencing-the-user-model">recommended in the documentation</a> to support custom-defined models. Finally, we are using on_delete=models.CASCADE to ensure that when a User is deleted, the &quot;linked&quot; UserProfile will be deleted as well.</p><p><a href="https://www.rockandnull.com/django-user-profile/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caa12156e29a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/creating-a-user-profile-model-in-django-to-hold-additional-user-info-caa12156e29a">Creating a User Profile model in Django to hold additional user info</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential settings to change for a Django app in production]]></title>
            <link>https://medium.com/rocknnull/essential-settings-to-change-for-a-django-app-in-production-8717b5f6f167?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/8717b5f6f167</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[django-framework]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Sun, 19 Feb 2023 12:54:18 GMT</pubDate>
            <atom:updated>2023-02-19T12:54:18.451Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*nWTg8iHTBmyL4knT" /><figcaption>Photo by <a href="https://unsplash.com/es/@iniguez?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Carlos Alberto Gómez Iñiguez</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>So you have finished your Django app, after months of development, and you are ready to go live. Up until now, you’ve been running the app in development mode. There are a few settings that you would need to change before you can go live safely.</p><p>In this post, I will go through what I consider fundamental production settings. Nevertheless, the more complex your app, the more settings you would need to differentiate between a development and a production environment. If your app is complex, this is not a comprehensive guide for the production configuration of a Django app, rather than an essential configuration for a production environment.</p><h3>Debug mode</h3><p>Maybe the most important setting you would need to turn off before going into production.</p><p>The default value when you create a Django project is DEBUG = true in the settings.py accompanied by a warning to turn it off in the production. This setting is responsible for pretty-printing the error messages when something goes wrong. And even though this is extremely useful while developing an app because it&#39;s showing the stack trace along with other debug data, it&#39;s extremely dangerous information to be shown in production.</p><p>I usually set an environment variable that stores what environment is the current one. Having this information, I enable debugging only in the non-prod environments.</p><p>is_prod = os.environ.get(&quot;ENVIRONMENT&quot;, default=&quot;local&quot;) == &quot;prod&quot; DEBUG = not is_prod</p><p><a href="https://www.rockandnull.com/django-production-settings/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8717b5f6f167" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/essential-settings-to-change-for-a-django-app-in-production-8717b5f6f167">Essential settings to change for a Django app in production</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick start on Selenium tests with Django and GitHub Actions deployment]]></title>
            <link>https://medium.com/rocknnull/quick-start-on-selenium-tests-with-django-and-github-actions-deployment-e1a71d216169?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/e1a71d216169</guid>
            <category><![CDATA[testing-framework]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[selenium-webdriver]]></category>
            <category><![CDATA[python-web-developer]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Sat, 11 Feb 2023 15:04:45 GMT</pubDate>
            <atom:updated>2023-02-11T15:04:45.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TCgnJ5uLhDc1goLX" /><figcaption>Photo by <a href="https://unsplash.com/@minkus?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Minku Kang</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>Writing a combination of unit and integration/UI tests is ideal for any kind of project that contains both user-facing components and business logic.</p><p>Django has excellent support for both of these kinds of tests. Unit tests are more straightforward to write and deploy in a CI/CD pipeline. The challenge in most languages and platforms comes when you need to write Integration/UI tests. Most of the time these integration tests are slow to write, slow to execute, and many times unreliable and flaky when you run them in a CI/CD system. In Django, these tests are supported via the popular <a href="https://www.selenium.dev/">Selenium framework</a> used for testing all kinds of web applications.</p><p>Django gives you a great headstart when writing integration tests by coupling together a local running server with your app and a local DB and Selenium WebDriver. In this post, I will quickly guide you through a simple Django test using Selenium and how to deploy it to GitHub Actions for running it every time there&#39;s a new PR or commit.</p><h3>The test part</h3><p><a href="https://www.selenium.dev/documentation/webdriver/">Selenium WebDriver</a> offers a great API for interacting with a browser and &quot;driving&quot; it to perform clicks and interactions to test your web app.</p><p>You can write most of these tests manually, but if you are new to the space I would strongly recommend giving <a href="https://www.selenium.dev/selenium-ide/">Selenium IDE</a> a try. This is a browser extension to quickly start with Selenium WebDriver tests without writing a single line of code. As your tests and app become complex over time, you would most probably need to write code, but still, the tests created by Selenium IDE can be a great starting point (you export those tests and modify the code).</p><p><a href="https://www.rockandnull.com/django-selenium/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1a71d216169" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/quick-start-on-selenium-tests-with-django-and-github-actions-deployment-e1a71d216169">Quick start on Selenium tests with Django and GitHub Actions deployment</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Removing unused CSS in a Django template-based project]]></title>
            <link>https://medium.com/rocknnull/removing-unused-css-in-a-django-template-based-project-942eaefa8e3f?source=rss----45dd21ca8c08---4</link>
            <guid isPermaLink="false">https://medium.com/p/942eaefa8e3f</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[django-framework]]></category>
            <dc:creator><![CDATA[Bevan Steele]]></dc:creator>
            <pubDate>Sat, 04 Feb 2023 13:39:58 GMT</pubDate>
            <atom:updated>2023-02-04T13:39:58.486Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Igsid_-NdetijoD-" /></figure><p>When productionizing a web app there are many best practices you can do to improve the performance of the deployed app. One of those best practices is to purge all the unneeded CSS classes and elements for quicker download times, and potentially faster performance when the browser is parsing through the CSS file (this is especially important in bigger sites where a huge CSS file might make the site perform slow).</p><p>This is almost a trivial task if you are working with a modern client-side JS framework. But if you are developing a web app using Django&#39;s template language with some CSS library (such as <a href="https://bulma.io/">Bulma</a> or <a href="https://getbootstrap.com/">Bootstrap</a>), and potentially <a href="https://www.rockandnull.com/htmx-django/">using HTMx</a> for more dynamic behavior, this is not an easily solved problem.</p><p>These CSS libraries are great and allow you to develop web apps fast and easily, with the downside that they provide a single huge CSS file. Some of them do offer more modular CSS files in case you want to make the effort. But even in that case, you will include more classes that you will actually use (for instance there might be a module for all the button classes - but you will most probably use only a single style of buttons).</p><p>When I searched online I couldn&#39;t find an &quot;industry standard&quot; solution to this problem. What I ended up doing was using the popular tool <a href="https://purgecss.com/">PurgeCSS</a> along with a quick Python script to generate the appropriate command. What the <a href="https://purgecss.com/">PurgeCSS</a> tool does is search for all your HTML files, gather all the CSS classes used, and then &quot;purge&quot; all the unused ones from the CSS file. You just need to declare all the HTML files you have.</p><p><a href="https://www.rockandnull.com/django-remove-unused-css/">Continue reading this post in our official blog…</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=942eaefa8e3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocknnull/removing-unused-css-in-a-django-template-based-project-942eaefa8e3f">Removing unused CSS in a Django template-based project</a> was originally published in <a href="https://medium.com/rocknnull">Rock and Null</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>