<?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 Grant McConnaughey on Medium]]></title>
        <description><![CDATA[Stories by Grant McConnaughey on Medium]]></description>
        <link>https://medium.com/@gmcconnaughey?source=rss-63ffd924d521------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fg9dr35Eb0lPC0Cki8SbbQ@2x.jpeg</url>
            <title>Stories by Grant McConnaughey on Medium</title>
            <link>https://medium.com/@gmcconnaughey?source=rss-63ffd924d521------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 13:27:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gmcconnaughey/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[Announcing Postpone]]></title>
            <link>https://medium.com/@gmcconnaughey/announcing-postpone-8a9f975a4198?source=rss-63ffd924d521------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a9f975a4198</guid>
            <category><![CDATA[side-project]]></category>
            <category><![CDATA[scheduling]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[reddit]]></category>
            <dc:creator><![CDATA[Grant McConnaughey]]></dc:creator>
            <pubDate>Mon, 16 Mar 2020 17:28:16 GMT</pubDate>
            <atom:updated>2020-03-16T17:28:16.731Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I’m happy to announce the release of <a href="https://www.postpone.app/">Postpone</a>, an app to schedule Reddit posts for increased views, upvotes, and traffic to your projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LRFZ9phutI602jB-.png" /></figure><p>Postpone is an app created to solve my own need. I often have blog posts, open source project updates, or other content to share on Reddit. However, I don’t want to share this content when others are offline and won’t see it. This is where Postpone comes in.</p><p>Postpone lets users queue up Reddit posts so that they’re submitted when others are online to see them.</p><h3>Prediction, Queueing, and Analytics</h3><p>Postpone helps users get their content noticed by:</p><ul><li><strong>Predicting</strong> the best time to post and which subreddits to post to.</li><li><strong>Queueing</strong> your posts so that they are submitted to these subreddits at these times.</li><li><strong>Analytics</strong> to see how your posts are performing over time.</li></ul><p>The launch version of Postpone focuses on Queueing first. Development on Postpone will continue to improve Prediction and Analytics of posts as well.</p><h3>Plans</h3><p>Postpone supports 3 plans: Base, Premium, and Unlimited.</p><p><strong>Base</strong> lets you queue up one post per week from a single Reddit account. <strong>Premium</strong> lets you queue up unlimited posts from a single Reddit account. <strong>Unlimited</strong> lets you queue up unlimited posts from unlimited Reddit accounts.</p><p>As new features are built, some will only be available to paid plans (Premium and Unlimited).</p><h3>Writing Posts</h3><p>Postpone has two different ways to write posts.</p><p>By default, Postpone provides a fancy WYSIWYG editor for writing posts. This is built using <a href="https://tiptap.scrumpy.io/">Tiptap</a>, which is a great WYSIWYG library for Vue.js. I’ve meticulously tweaked and configured Tiptap, and I think the end result is pretty great.</p><p>Not everyone wants to use a WYSIWYG editor, however. Some folks prefer to write in raw <a href="https://www.reddit.com/wiki/markdown">Markdown</a>. If you’d prefer to write posts in Markdown then you can use the Markdown-only editor instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QXnHCAMPcORkHBG3.png" /></figure><h3>Subreddit Search</h3><p>Postpone provides a subreddit search input to help you pick the subreddit to post in. This gives you the ability to search for a subreddit, as well as related subreddits. Postpone will even show you the total number of subscribers to these subreddits, in order to help you pick subreddits with the largest audience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/0*l7zLI0YqgRDsrSx9.png" /></figure><h3>Retry Support</h3><p>Sometimes posts fail to submit. This could happen for several reasons, such as Reddit being temporary unavailable or user login credentials being out of date.</p><p>When errors occur, Postpone will send you an e-mail letting you know that it could not submit your post. The next time you visit Postpone the app will display a list of failed posts, the reason why they failed, and let you retry them.</p><h3>Just the Start</h3><p>This initial version of <a href="https://www.postpone.app/">Postpone</a> is just a start. Over the coming weeks and months I’ll be adding features such as:</p><ul><li>The ability to see the best time to post to certain subreddits.</li><li>Support for cross-posting to multiple subreddits at once.</li><li>Simple analytics, such as total post upvotes and comments.</li><li>Improved analytics, such as post performance over time.</li></ul><p>To suggest a feature or report a bug please either:</p><p>Happy Postponing!</p><p><em>Originally published at </em><a href="http://www.grantmcconnaughey.com/blog/2020/03/16/announcing-postpone/">http://www.grantmcconnaughey.com/blog/2020/03/16/announcing-postpone/</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a9f975a4198" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Python code reviews for free with GitHub Actions, Flake8, and Lintly]]></title>
            <link>https://medium.com/@gmcconnaughey/automate-python-code-reviews-for-free-with-github-actions-flake8-and-lintly-52e3d9d44f7c?source=rss-63ffd924d521------2</link>
            <guid isPermaLink="false">https://medium.com/p/52e3d9d44f7c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Grant McConnaughey]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 01:07:57 GMT</pubDate>
            <atom:updated>2020-03-02T01:09:29.332Z</atom:updated>
            <content:encoded><![CDATA[<p>Code is read much more often than it is written. As software developers, we have many options for ensuring our code is as readable as possible. In this post I’ll describe how you can use several free open source tools to automate code reviews in your GitHub repositories.</p><h3>The Tools</h3><p>We’re going to use the following tools to automate code quality checking in pull requests:</p><ul><li><a href="http://flake8.pycqa.org/en/latest/">Flake8</a>, a popular Python linter that combines three separate linters: pycodestyle (styling), pyflakes (syntax, semantics), and mccabe (code complexity).</li><li><a href="http://github.com/grantmcconnaughey/lintly">Lintly</a>, a CLI tool which parses linter output, determines which lines have violations, and creates a pull request review with comments on each line.</li><li><a href="https://github.com/features/actions">GitHub Actions</a>, GitHub’s new CI service, which is free for up to <a href="https://help.github.com/en/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-actions#about-billing-for-github-actions">2,000 minutes of execution per month</a> for GitHub users.</li></ul><h3>Lintly-Flake8 GitHub Action</h3><p>To make this whole process easy, I’ve created a GitHub Action to merge Flake8 with Lintly. Its called <a href="https://github.com/marketplace/actions/lintly-flake8">Lintly-Flake8</a>, and its available on the GitHub Marketplace.</p><p>To use Lintly-Flake8, add the following to a GitHub Actions file at the file .github/workflows/lint.yml in your repo:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85a4feef89d943d5b2dc6b3d8e7c6ceb/href">https://medium.com/media/85a4feef89d943d5b2dc6b3d8e7c6ceb/href</a></iframe><p>This tells GitHub Actions to only run on pull requests. We first check out the code in the pull request, then use Lintly-Flake8 by passing the GitHub Actions bot token. This ensures that the bot github-actions will be used for the review.</p><p>Next, open a pull request with flake8 issues, such as too many blank lines between functions or the cryptic “ <a href="https://www.flake8rules.com/rules/E127.html">Continuation line over-indented for visual indent</a>.” GitHub Actions will run and detect all of the changed lines with violations. Then the github-actions bot will leave a code review on each line, making it very clear what needs to be updated.</p><h3>Options</h3><p>Lintly-Flake8 supports a few different options to tweak how it runs.</p><p>First, it supports failIf, which allows you to change if Lintly should catch <em>any</em> violation or only <em>new</em> ones. Valid values are any or new. new is the default, which is handy for projects with existing flake8 violations.</p><p>Lintly-Flake8 also supports args, which are additional arguments sent to the flake8 CLI. This gives you the ability to pass arguments like --select or --ignore, as well as changing the directory to be listing. This defaults to ., which lints all files in the current directory.</p><h3>Example</h3><p>Below is an example of all arguments supported in a Lintly-Flake8 step in a Github Action:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/781f35b66516db8926aa2276c65d03fc/href">https://medium.com/media/781f35b66516db8926aa2276c65d03fc/href</a></iframe><h3>Conclusion</h3><p>Flake8 lints code. Lintly creates GitHub pull request reviews. GitHub Actions automates and orchestrates all of this. The power of open source allows these distinct tools to work together to provide overall value.</p><p>If you’d like to contribute to Lintly, Flake8, or Flake8Rules then check out the following GitHub repos:</p><ul><li><a href="http://github.com/grantmcconnaughey/lintly">Lintly</a></li><li><a href="https://github.com/PyCQA/flake8">Flake8</a></li><li><a href="http://github.com/grantmcconnaughey/flake8rules">Flake8Rules</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52e3d9d44f7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Launching Lintly: One Month In]]></title>
            <link>https://medium.com/hackernoon/launching-lintly-one-month-in-959078221048?source=rss-63ffd924d521------2</link>
            <guid isPermaLink="false">https://medium.com/p/959078221048</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[apps]]></category>
            <dc:creator><![CDATA[Grant McConnaughey]]></dc:creator>
            <pubDate>Wed, 15 Feb 2017 13:47:21 GMT</pubDate>
            <atom:updated>2019-05-02T11:03:44.714Z</atom:updated>
            <content:encoded><![CDATA[<p>It has been about a month since <a href="http://blog.lintly.com/2017/01/04/introducing-lintly/">I launched</a> my app <a href="https://lintly.com/"><strong>Lintly</strong></a>, an automated code linting website for <a href="https://hackernoon.com/tagged/python">Python</a>, <a href="https://hackernoon.com/tagged/javascript">JavaScript</a>, and CSS. I’ve learned a lot in the last 6 months while working on and deploying Lintly. In this article I’m going to recap Lintly’s first month and discuss all that goes into <strong>building a production app</strong>.</p><p>Specifically, I’ll talk about…</p><ul><li>My strategy for <strong>planning </strong>the app</li><li>Project management I used during <strong>development</strong></li><li>The AWS services I used for <strong>deployment</strong></li><li>How I <strong>marketed </strong>the app without spending a dime</li><li>The app’s <strong>finances</strong> (a breakdown of every dollar I’ve spent on Lintly)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZzb91R8Wv5XRtnP5_W3vA.png" /><figcaption>The Lintly Dashboard</figcaption></figure><h3>The numbers</h3><p>Let’s get some stats out of the way. Here is how Lintly has performed in the last month:</p><ul><li><strong>78 users</strong> have signed up</li><li><strong>131 GitHub repos</strong> are being linted</li><li><strong>642 times</strong> Lintly has linted code</li><li><strong>320,146 lines of code</strong> linted</li></ul><p>Not bad! I told my wife that if 10 people signed up in the first week that I would be happy. So 75 users in a month is certainly something I’m happy with.</p><p>Now let’s talk about building and deploying the app. First up: Planning.</p><h3>Planning</h3><p>Planning was where I spent the least amount of time. There can be philosophical arguments about how much planning one should perform on a side project, but those are best left to smarter developers.</p><p>I do like to do one bit of planning: <strong>checking out competitors</strong>. I knew there was already a similar app in the Python landscape (wink, nudge), and several other competitors that work with all sorts of languages. So I went to the home page for all of those sites and read about their features. I also checked out the documentation for those apps.</p><p>I do all of this to give me a good sense of <strong>what features are universal</strong> between all code linting sites. For example, all sites integrate with GitHub webhooks, so I knew that would be important. On the flip side, some sites simply lint pull requests and don’t store the results, so perhaps that isn’t a required feature.</p><p>I wrote down all the required and non-essential features. All the required features went into the Beta feature set. Everything non-essential went into the Someday or v1.0 feature set.</p><h3>Development</h3><p>After planning it was time to start hacking on this thing. I’m pretty familiar with Python and Django, so those are what I used to build Lintly. I worked on Lintly in my spare time for about 6 months before finally releasing it. Occasionally I wouldn’t work on Lintly for weeks at a time. However, <strong>setting a goal</strong> to release the first week of January helped me to finally focus and ship a working product.</p><p>I used <strong>Trello</strong> to help keep track of features that needed to be completed. I split the Trello board into 5 lanes:</p><ol><li>To-Do — Someday</li><li>To-Do— v1.0</li><li>To-Do — Beta</li><li>Doing</li><li>Done</li></ol><p>The <strong>To-Do — Someday</strong> lane consists of features that would be nice to have, but are not required at all. <strong>To-Do — v1.0</strong> is for features that need to be in version 1.0 (like accepting payments for private repos), but don’t need to be in the beta. The <strong>To-Do — Beta</strong> lane is for features required to even release a beta.</p><p>By using these 5 lanes I was able to <strong>focus exclusively on the features required to release a functional beta</strong>. This is easier than it sounds, as I often found myself moving new features into the beta lane. But overall this system worked well for me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAcyGwRTMpCshyoGDv37Eg.png" /><figcaption>My trusty Trello board</figcaption></figure><h3>Deployment</h3><p>When I finally completed all cards in the <strong>To-Do — Beta</strong> lane in Trello I was ready for deployment. I decided to go with <strong>AWS</strong> since we use a lot of AWS services <a href="http://britecore.com/">where I work</a>, and because knowing AWS is an important skill set to have these days. AWS also provides a <a href="https://aws.amazon.com/free/">free tier</a>, which allowed me to play around with the different services and initially deploy the app without having to pay a dime.</p><p>AWS is overwhelming to those unfamiliar with it. AWS has dozens of services at the developers disposal. In the end, I used these services to deploy Lintly:</p><ul><li><strong>Elastic Beanstalk</strong> — A Heroku-esque web server environment</li><li><strong>RDS</strong> — Hosts the Postgres database</li><li><strong>ECS</strong> — Runs a cluster of Docker containers (I use these for the Lintly Celery workers)</li><li><strong>ElasticCache</strong> — Hosts the Redis cache</li><li><strong>SQS</strong> — A message queueing system that integrates with Celery</li><li><strong>Route 53</strong> — DNS management</li><li><strong>S3</strong> — Stores Lintly’s static assets</li><li><strong>CloudFront</strong> — A CDN in front of Lintly’s static assets</li></ul><p>This is just the tip of the iceberg of what AWS has to offer. However, I believe these services are some of the most essential ones to learn. If you understand them then you should be able to deploy most standard web apps to the world.</p><p><em>Side note: If you want to deploy a Django app to AWS and need a place to start, </em><a href="https://realpython.com/blog/python/deploying-a-django-app-and-postgresql-to-aws-elastic-beanstalk/"><em>this article is excellent</em></a><em>.</em></p><h3>Marketing</h3><p><strong>In order to market you have to provide value in one form or another.</strong> The easiest way to provide value is to pay money for a site to place an ad or promote a Tweet that others will see. Most solo developers don’t want to spend a lot of money marketing an app, especially one they would consider a side project. I’m certainly no exception to that, which meant I needed to find alternative ways to let people know about Lintly.</p><blockquote>In order to market you have to provide value in one form or another.</blockquote><p>I decided to <strong>write articles about Lintly</strong> and post them on Medium, Twitter, and Reddit. These articles (much like this one) aim to teach the reader about something. One of the articles I wrote was called <a href="https://hackernoon.com/mistakes-i-made-writing-a-django-app-and-how-i-fixed-them-16de4e632042#.964j9d9y8">“Mistakes I Made Writing a Django App (and How I Fixed Them)”</a>, which talked about Lintly and some of the ways I messed up while working on it. This article provides value to the reader by giving them real world examples of a Django app. It also informs them about Lintly. Everyone wins!</p><h3>Finances</h3><p>Lintly has no way of accepting money yet. Eventually I will charge for private repos, but to start out I wanted to offer it for free to have people try it out and report bugs. I can, however, talk about how much Lintly costs.</p><p>So far Lintly hasn’t cost that much. Here’s a breakdown of what I’ve spent:</p><ul><li>$9 — lintly.com domain name</li><li>$18 — Bootstrap theme</li><li>$4.69 — AWS costs for December 2016</li><li>$56.39 — AWS costs for January 2017</li></ul><p>January 2017 was by far the most expensive month I’ve had. This is mostly because in mid-January I tried changing how the app was deployed in a number of different ways. I tried using a single container Docker instance, a multi-container Docker instance, regular Elastic Beanstalk, <a href="https://github.com/Miserlou/Zappa">Zappa</a>, and ECS. All of that stopping and starting various EC2 instances added up, and the bill came to be $56.39.</p><p>Since then I have found a deployment that I really like — Elastic Beanstalk for the web server and ECS for the Celery worker containers. These both run on t2.micro EC2 instances (there just isn’t very much traffic right now) so the costs are pretty minimal.</p><h3>Going Forward</h3><p>Lintly had an exciting and fun first month. I don’t know if it will ever be considered a success from a monetary standpoint, but I don’t think it matters. To me it’s a success either way.</p><p>I would work on it even if it never made a dollar.</p><p>I build it because <em>it’s fun</em>.</p><p><em>Thanks for reading! If you’d like to </em><strong><em>keep track of your Python, JavaScript, or CSS code quality </em></strong><em>then I’d love for you to try out Lintly. Check it out at </em><a href="https://lintly.com/">lintly.com</a>.</p><p><em>Also, if you’re into the whole Twitter thing then follow me </em><a href="https://twitter.com/gmconnaughey"><em>@gmconnaughey</em></a><em>.</em></p><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=959078221048" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/launching-lintly-one-month-in-959078221048">Launching Lintly: One Month In</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling webhooks using Django and ngrok]]></title>
            <link>https://medium.com/hackernoon/handling-webhooks-using-django-and-ngrok-b7ff27a6fd47?source=rss-63ffd924d521------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7ff27a6fd47</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Grant McConnaughey]]></dc:creator>
            <pubDate>Mon, 23 Jan 2017 13:17:01 GMT</pubDate>
            <atom:updated>2019-05-02T11:03:45.068Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we’ll go over how to handle webhooks using Django, create a webhook in <a href="https://hackernoon.com/tagged/github">GitHub</a>, and test the webhook on your local machine using ngrok. But first a brief primer on webhooks.</p><p><em>If you’re already familiar with webhooks then feel free to skip past this first part.</em></p><h3>What are webhooks?</h3><p>Imagine you are writing an app that needs to be informed when an event occurs in another system. The event could be when a user sends a tweet or when the price of an item changes.</p><p>One way to know when the event occurs is to check every so often. For instance, your app could make a request to Twitter every 5 minutes asking “Has <em>user</em> posted anything yet?” This is called polling, and it can be taxing on your servers because you must constantly make requests to external services.</p><p>Another way to know an event has occurred is to have the other service inform your app when things change. This can be accomplished using <strong>webhooks</strong>. With webhooks you no longer need to poll every 5 minutes or once a day. Instead, your app <strong>receives events in real-time</strong>.</p><h3>Handling GitHub webhooks</h3><p>GitHub has a <a href="https://developer.github.com/webhooks/#events">plethora of events</a> that can trigger webhooks. The event we’ll handle is the default push event, which occurs when a user pushes commits, branches, or tags to a GitHub repository.</p><p>Let’s write some code that handles GitHub’s webhooks. We’re writing a Django app, so we’ll create a view function. Be sure to wire up this view to the URL /hooks/handle_github.</p><p>Below is a view function that will handle GitHub webhooks <a href="https://developer.github.com/webhooks/creating/">based on the instructions in GitHub’s documentation</a>. For this to work, you’ll need to first add a GITHUB_WEBHOOK_SECRET to your settings file. Think of this as your webhook’s password, so make it a long string with lots of random characters. Also, remember it, because we’ll need it later.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2f8adc4637d08823a3ba8d532dbf7fe/href">https://medium.com/media/c2f8adc4637d08823a3ba8d532dbf7fe/href</a></iframe><p>Requests from GitHub come into our app through the handle_github_hook view function. The view ensures the request is authorized, loads the payload JSON, does something useful with the payload, and returns an HTTP response.</p><p>When writing your handler, keep in mind that <a href="https://developer.github.com/guides/best-practices-for-integrators/#favor-asynchronous-work-over-synchronous">GitHub expects you to respond to webhooks within 30 seconds</a>. If the task you need to perform can happen quickly then do it synchronously. Otherwise it’s probably best to put the task in the background using <a href="http://www.celeryproject.org/">Celery</a> or <a href="http://python-rq.org/">RQ</a>.</p><p>Now that we have code that handles webhooks, we need to test it.</p><h3>Enter ngrok</h3><p>Webhooks take some work to test locally. That’s because by their very nature they expect a publicly accessible URL to send requests to, and most of our development laptops don’t have that. Luckily there is a very easy way that we can create a public URL that leads right to our development server: <a href="https://ngrok.com/">ngrok</a>.</p><p>Ngrok is a command line application you can use to expose your development machine to the Internet. To install ngrok, go to <a href="https://ngrok.com/">ngrok.io</a> and follow their installation steps. It’s as simple as downloading and unzipping. I’ll wait while you go off and do that.</p><blockquote>🎵 Jeopardy theme song 🎵</blockquote><p>Is ngrok installed now? Great! To run it, open up your terminal and enter the following.</p><pre>ngrok http 8000</pre><p>This should start up a secure tunnel that is connected to your local HTTP port. It will look something like this:</p><pre>ngrok by <a href="http://twitter.com/inconshreveable">@inconshreveable</a>                                                                                                                                         (Ctrl+C to quit)</pre><pre>Session Status                online<br>Version                       2.1.18<br>Region                        United States (us)<br>Web Interface                 <a href="http://127.0.0.1:4041/">http://127.0.0.1:4041</a><br>Forwarding                    <a href="http://dda5f8fd.ngrok.io/">http://dda5f8fd.ngrok.io</a> -&gt; localhost:8000<br>Forwarding                    <a href="https://dda5f8fd.ngrok.io/">https://dda5f8fd.ngrok.io</a> -&gt; localhost:8000</pre><pre>Connections                   ttl     opn     rt1     rt5     p50     p90<br>                              0       0       0.00    0.00    0.00    0.00</pre><p>The forwarding URL <a href="http://dda5f8fd.ngrok.io/">http://dda5f8fd.ngrok.io</a> is what I’ll use for the webhook. Your URL will be different, so use whatever ngrok provides.</p><h3>Setting up our webhook</h3><p>Now that we have code to handle webhooks <em>and</em> a publicly accessible URL, let’s set up a webhook in GitHub.</p><p>You can add a webhook to a repository programmatically using GitHub’s API. In fact, that’s what you <em>should</em> do to automate this whole process. In the spirit of brevity, however, we’ll add a webhook through the GitHub UI. To do that, go to one of your repositories in GitHub, select Settings, then Webhooks.</p><p>Add your ngrok URL + /hooks/handle_github to the Payload URL field. Next, add the secret string from your Django settings to the Secret field. GitHub will send along this secret string so that you can verify the request is really coming from them. Finally, choose the events you would like GitHub to notify your app about. When it’s all said and done, the form should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*INZptfN1WBQuD2mSOhiDdg.png" /><figcaption>Setting up our webhook in GitHub</figcaption></figure><p>Click the Add webhook button and your webhook is ready for action.</p><h3>Testing it out</h3><p>It’s finally time to confirm this whole thing is working. To do that, start up the development Django server by running python manage.py runserver. This should start your server on port 8000, which is the port ngrok expects.</p><p>Next we’ll need to trigger an event in GitHub. If you’re webhook is configured to handle the default push event then pushing a branch to GitHub will suffice.</p><p>Clone the repository where you created your webhook. For example:</p><pre>$ git clone <a href="https://github.com/grantmcconnaughey/django-field-history.git">https://github.com/grantmcconnaughey/django-field-history.git</a></pre><p>Now, create a new branch and push it back to GitHub.</p><pre>$ git checkout -b webhook_test<br>$ touch new_file.py<br>$ git add new_file.py<br>$ git commit -m &quot;Testing webhooks&quot;<br>$ git push origin webhook_test</pre><p>This will trigger the push event and GitHub will make a request to the ngrok URL you entered in your repo’s settings. This means you should see some activity over in the terminal where ngrok is running:</p><pre>HTTP Requests<br>-------------</pre><pre>POST /hooks/handle_github/            202 Accepted</pre><p>Huzzah! 🎉 We’ve successfully handled a GitHub webhook.</p><h3>Conclusion</h3><p>In this post I discussed <strong>what webhooks are</strong> and why they’re useful. Next I showed you <strong>how to handle webhooks</strong> in a Django app using a view function. Then I made a derivative joke involving a beloved American game show. After that I showed you how to <strong>configure your local development</strong> machine to handle webhooks over the Internet. Finally, we proved that <strong>all of this actually works</strong>.</p><p>I hope you learned something, and thanks for reading!</p><p><em>This code is pulled almost verbatim from my project </em><a href="https://lintly.com/"><strong><em>Lintly</em></strong></a><em>, a continuous </em><a href="https://hackernoon.com/tagged/python"><em>Python</em></a><em> code linting service that integrates with GitHub. If you’d like to </em><strong><em>keep track of your Python code quality </em></strong><em>then Lintly can help. Check it out at </em><a href="https://lintly.com/">lintly.com</a>.</p><p><em>Also, if you’re into the whole Twitter thing then follow me </em><a href="https://twitter.com/gmconnaughey"><em>@gmconnaughey</em></a><em>.</em></p><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7ff27a6fd47" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/handling-webhooks-using-django-and-ngrok-b7ff27a6fd47">Handling webhooks using Django and ngrok</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Quick 7-Step Guide for Naming Your Next App or Startup]]></title>
            <link>https://medium.com/hackernoon/a-quick-7-step-guide-for-naming-your-next-app-or-startup-481c260528da?source=rss-63ffd924d521------2</link>
            <guid isPermaLink="false">https://medium.com/p/481c260528da</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[branding]]></category>
            <dc:creator><![CDATA[Grant McConnaughey]]></dc:creator>
            <pubDate>Mon, 16 Jan 2017 15:24:58 GMT</pubDate>
            <atom:updated>2019-05-02T11:03:45.567Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://twitter.com/gmcconnaughey/status/816671427596259329">A few weeks ago</a> I released <a href="https://lintly.com/">a little web app</a> to the world. The app is called Lintly, and it is a code quality checker that helps keep codebases squeaky clean.</p><p>Lintly is a name I’m really happy with. It’s short, it’s a word you won’t find in the dictionary, and it evokes <a href="http://stackoverflow.com/questions/8503559/what-is-linting">code linting</a>, which is its purpose for existing. But perhaps best of all, I was able to get the URL lintly.com! 🎉</p><p>In this article I will go over the steps I took to brainstorm and ultimately decide on a name for the app. It is my belief that following these steps can make the entire process much simpler.</p><p><strong>Heads up:</strong> For the rest of the article I will use the word “app” to mean an app, a startup, or a side project.</p><h3>What you’ll need</h3><p>First, let’s gather some resources to help us name the app. Make sure the following items are handy:</p><ul><li>A <strong>notebook</strong></li><li>A <strong>pen</strong> (you can’t go wrong with a <a href="https://www.amazon.com/Pilot-Retractable-Roller-12-Pieces-31002/dp/B00006JNJ8">Pilot G2</a>)</li><li>A <strong>web browser</strong></li></ul><h3>Thinking up a name</h3><p>Below are 7 steps you can take to help you come up with a name for your app. They should be followed in order.</p><h4>Step 1: Write one sentence that describes what your app does</h4><p>The first thing you should do is write one short sentence that explains what your app does. You’ll use this sentence to help come up with the words that will form the name. After writing your sentence, underline the <strong>key words</strong> in the sentence. These are the words that best relate to your app.</p><p>For Lintly, I came up with the following sentence:</p><blockquote>__________ tracks your code quality and reports any violations.</blockquote><p>In my example, I underlined <strong>tracks</strong>, <strong>code</strong>, <strong>quality</strong>, and <strong>reports</strong>. In retrospect, the word “code” is probably too generic and “violations” would have been a good one to underline. The point is we need some words to start with.</p><h4>Step 2: Come up with a list of base words</h4><p>Next, it is time to come up with some <strong>base words </strong>that can be incorporated into the app’s name. So brush off that dusty ol’ thesaurus or head over to <a href="http://thesaurus.com/">thesaurus.com</a>.</p><p>To create your base words, enter each of the words you underlined in step 1 into thesaurus.com. For each word, read the list of synonyms and write down the ones that you think could potentially work in a name. At this point you should be very liberal with the words you consider; if you’re on the fence then go ahead and write it down.</p><p>Here are some of the base words I came up with:</p><ul><li>clean, sweep, neat, pure, trim, crisp — these all related to <strong>quality</strong> and <strong>cleanliness</strong></li><li>score, grade, rate, tally, summary — these all relate to <strong>reporting</strong> and <strong>scoring</strong></li><li>grumble, declare, proclaim, inform — these all relate to <strong>tracking</strong> and <strong>notifying</strong></li></ul><h4>Step 3: Come up with accompanying words</h4><p>Lots of companies and apps have names that are one word. Twitter, Pocket, <a href="https://hackernoon.com/tagged/google">Google</a>, and <a href="https://hackernoon.com/tagged/amazon">Amazon</a> come to mind immediately. Other apps combine words or portions of words to make one new word. Some examples would be Netflix (“net” + “flix”) and Feedly (“feed” + the suffix “-ly”).</p><p>For step 3, write down as many <strong>accompanying words</strong> that are related to your app. These words are typically:</p><ul><li><strong>Suffixes.</strong> <em>-ly</em> is a common one, as in Lintly or Feedly. <em>-hub</em> is also common, as in GitHub or ZenHub. Finally, the suffix <em>-let</em>, as in Quizlet.</li><li><strong>Words that relate loosely to your app</strong> but aren’t a main focus. I added “git” and “code” as accompanying words for Lintly, even though the main focus of the app is on cleaning and quality.</li></ul><p><em>Tip: For help coming up with accompanying words, look to your browsers bookmark bar. There are likely several websites you visit that have suffixes in their name.</em></p><h4>Step 4: Brainstorm</h4><p>Steps 1–3 are all about providing input for this step. This is the classic brainstorming step.</p><p>Use your app’s sentence, base words, and accompanying words to think of as many company names as you can. Combine base words and suffixes. Combine base words with other base words. When you think of new words or themes during brainstorming then be sure to write them down in the base words or accompanying words sections.</p><p>Here are some other things you can do in this step to come up with a name:</p><ul><li>Misspell words (Netflix, Reddit)</li><li>Remove letters (Tumblr, Toggl, Modernizr)</li><li>Create a portmanteau (Pin + Interest = <strong>Pinterest</strong>, Code + Academy = <strong>Codecademy</strong>)</li><li>Add numbers (37signals)</li><li>Change your base words into another language like Spanish or French</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hgoMPxzKktU5YSsUeJFDnA.jpeg" /><figcaption>The notes I took when thinking up a name for Lintly</figcaption></figure><h4>Step 5: Narrow the options down</h4><p>Now it’s time to narrow down the names you came up with while brainstorming. There are a few criteria I like to use to easily get rid of some of the names:</p><ol><li><strong>Remove names that immediately stand out as bad</strong>. These can be names that are too generic, too long, or don’t make sense. I also marked off a few names were too negative.</li><li><strong>Remove names you are on the fence about</strong> (you should really love the final name you choose).</li><li><strong>Remove names that dont have a .com domain available</strong>. To find this out, go to <a href="http://namecheap.com/">namecheap.com</a> and enter each word into the search bar. Keep in mind there are other possibilities for a domain, like using a .io or .net domain instead. You could also prefix the domain with a word like “get” (getbootstrap.com).</li><li><strong>Remove names whose Twitter handle is unavailable</strong>. Of course, this is only if Twitter is important to you. If it is and you can’t find a decent alternative then remove the name.</li></ol><p>After all of this you should be left with a few decent choices. If not then go back to Step 4 and start brainstorming again.</p><h4>Step 6: Sleep on it!</h4><p>There is no need to make a decision right away — in fact, you should sleep on it! You may really like or hate a name at first, but giving it a night or two might change your mind.</p><p>Take a night off and look at your list the next day. Do any names stand out to you now? If so, then great! Now it’s time to…</p><h4>Step 7: Pick a name</h4><p>There is nothing left to do but choose one of the names. If you are on the fence about the name then it’s probably best to mark it off and go back to brainstorming. But if you truly love one name more than all the others then congrats! You have a name for your app, your side project, or your startup.</p><h3>Conclusion</h3><p>Naming an app doesn’t have to be hard. The trick is to clear off your schedule for about an hour and focusing on the task at hand. If you brainstorm long enough then there will be lots of input. Combine the input in different ways and eventually you’ll have a name that you love.</p><p>Thanks for reading, and good luck with your next gig!</p><p><em>If you’re a Python developer who wants to keep track of their code’s cleanliness then check out my latest project, </em><a href="https://lintly.com/"><em>Lintly</em></a><em>.</em></p><p><em>You can also connect with me on Twitter </em><a href="https://twitter.com/gmcconnaughey"><em>@gmcconnaughey</em></a><em> or see what I’m up to </em><a href="http://github.com/grantmcconnaughey/"><em>on GitHub</em></a><em>.</em></p><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=481c260528da" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/a-quick-7-step-guide-for-naming-your-next-app-or-startup-481c260528da">A Quick 7-Step Guide for Naming Your Next App or Startup</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mistakes I Made Writing a Django App (and How I Fixed Them)]]></title>
            <link>https://medium.com/hackernoon/mistakes-i-made-writing-a-django-app-and-how-i-fixed-them-16de4e632042?source=rss-63ffd924d521------2</link>
            <guid isPermaLink="false">https://medium.com/p/16de4e632042</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Grant McConnaughey]]></dc:creator>
            <pubDate>Mon, 09 Jan 2017 16:02:46 GMT</pubDate>
            <atom:updated>2019-05-02T11:03:46.204Z</atom:updated>
            <content:encoded><![CDATA[<p>I <a href="http://blog.lintly.com/2017/01/04/introducing-lintly/">recently announced</a> the release of a project I’ve been working on for a few months. The project is called <a href="https://lintly.com/">Lintly</a>. It is a continuous <a href="https://hackernoon.com/tagged/python">Python</a> code quality checking tool that lints your code when you push to <a href="https://hackernoon.com/tagged/github">GitHub</a>. I won’t go into detail about what Lintly is here — you can read about that in the other blog post or go to <a href="https://lintly.com/">lintly.com</a>. Instead, I’d like to discuss my experience creating my first proper side project, some of the mistakes that I made writing it, and how I fixed the mistakes.</p><p><strong>Technical Note:</strong> Lintly is a Django 1.9 application that runs on Python 2.7.</p><h4>The Mistakes</h4><ul><li>Mistake #1: Making functions do too much</li><li>Mistake #2: Using magic strings</li><li>Mistake #3: Putting third-party API calls everywhere</li><li>Mistake #4: Feature creep</li><li>Mistake #5: Comparing my app to others</li></ul><h3>Mistake #1: Making functions do too much</h3><p>My, how code can become a big bowl of spaghetti very quickly. And don’t get me wrong, I love a good bowl of spaghetti. But when it comes to code, I’m not a fan.</p><p>This mistake was mostly made out of laziness. I wrote functions that were too large, did too much, and knew about things they had no business knowing about. It turns out this trap is very easy to get into when you dive in coding without much planning. Let me give you an example.</p><p>The two methods below are a part of the Build class. A build occurs when Lintly pulls down code from GitHub, lints it, stores the results, and sends out notifications. Here’s how a Build linted a repo originally:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dcbbebeac32f0fa80275df5f6209bb7d/href">https://medium.com/media/dcbbebeac32f0fa80275df5f6209bb7d/href</a></iframe><p>This is rough, and a clear violation of the <a href="https://en.wikipedia.org/wiki/Single_responsibility_principle">Single Responsibility Principle</a>, which states the following:</p><blockquote>A class should have only one reason to change.</blockquote><p>In this example, a Build does more than it should. It knows about the flake8 CLI and also parses the results of flake8. It should really hand all of this (linting + parsing) off to another class.</p><h4>How I fixed the mistake</h4><p>I decided to create a new Linter class that would house the logic that could be shared between all linters. Builds could instantiate a linter and use that instead of doing the linting themselves.</p><p>Here was my second attempt:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a069fcc5cbcc69a677e4564acf0a7c6c/href">https://medium.com/media/a069fcc5cbcc69a677e4564acf0a7c6c/href</a></iframe><p>Much better! A build is no longer running CLI tools on the command line and no longer parsing its own results. This is much more extensible as well, as the flake8 tool is no longer hard-coded into the build. It will be a lot easier to add linters in the future.</p><h3>Mistake #2: Using magic strings</h3><p>Currently, Lintly only works with GitHub. In a future release, I plan to make Lintly work with other services like GitLab and BitBucket. That’s why URLs are in the form of /gh/dashboard/ or /gh/new/. The gh portion stands for GitHub. When you go to a page in Lintly, you go there in the context of an external Git service. That way the backend code knows which API tokens to use, which repos to show you, and which organizations to show you.</p><p>This is what the URL looks like:</p><pre>url(https://medium.com/r&#39;^(?P&lt;service&gt;gh|dummy)/&#39;,<br> include(&#39;lintly.apps.projects.urls&#39;, namespace=&#39;projects&#39;)),</pre><p>And here is how that maps to a view function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ed5d835e96f9cb916772490f874653d/href">https://medium.com/media/9ed5d835e96f9cb916772490f874653d/href</a></iframe><p>That looks okay. The URL ensures that the service variable will only ever be gh or dummy (more on dummy later). In the future, I can add gl and bb so that URLs and views work with GitLab and BitBucket respectively.</p><p>The problem was in my templates. My templates would hard-code the gh variable all over the place. For example, here’s what a button would look like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/598edaf3255f39247671f626e2084ca8/href">https://medium.com/media/598edaf3255f39247671f626e2084ca8/href</a></iframe><h4>How I fixed the mistake</h4><p>To fix this I introduce a new service variable into all templates. This variable can be passed to URLs so that all URLs are relative to the current page’s service. I did this via a context processor:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b087f182b64796d4fcdf52ffb133747/href">https://medium.com/media/9b087f182b64796d4fcdf52ffb133747/href</a></iframe><p>Now when I need a URL, I simply pass along the service to the url template tag:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9148547a9035d324f6788b21c04355ce/href">https://medium.com/media/9148547a9035d324f6788b21c04355ce/href</a></iframe><h3>Mistake #3: Putting third-party API calls everywhere</h3><p>Lintly uses several third-party APIs, the most important of which is the GitHub API.</p><p>I started out putting API calls directly in my views, models, and template tags. For example, here’s what the User.get_projects() method looked like originally:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f08762054cfa4cff5e9a19f4ceb95b80/href">https://medium.com/media/f08762054cfa4cff5e9a19f4ceb95b80/href</a></iframe><p>Notice that this creates a Github client object directly (the Github client comes from the great <a href="https://github.com/PyGithub/PyGithub">PyGithub</a> library). Unfortunately, the get_projects method was called from the project sidebar (the sidebar on the left-hand side of each and every page while logged into Lintly). This meant I had to mock the get_projects method on every single view test…quite the nightmare!</p><h4>How I fixed the mistake</h4><p>I made this change along with the change in Mistake #2. That’s right, the good ol’ service variable.</p><p>First, I refactored all interactions with GitHub into their own class: the GitHubBackend class. This is a simple wrapper around the PyGithub library. I also created a <a href="http://www.martinfowler.com/articles/mocksArentStubs.html">Stub object</a> called DummyGitBackend that would simulate the interactions with an external Git service (like GitHub).</p><p>Now when I need to call an external service I get a GitBackend instance depending on the service. In production, service is always &#39;gh&#39;, which means we always use the GitHubBackend class to make API calls. In unit tests, service is always &#39;dummy&#39;, and the DummyGitBackend stub class is used. This ensures that my tests never call out to GitHub.</p><p>Here is the new implementation of User.get_projects():</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b0f7b32f0c84694cfc45aa5794fde48/href">https://medium.com/media/4b0f7b32f0c84694cfc45aa5794fde48/href</a></iframe><h3>Mistake #4: Feature creep</h3><p>I love using <a href="https://trello.com/">Trello</a> for simple project management. That’s why I used it for Lintly.</p><p>For Lintly, I have a Trello board with 4 columns:</p><p>1. To-Do - v1.0<br>2. To-Do - Beta<br>3. Doing<br>4. Done</p><p>My workflow was simple: pull cards from the <strong>Beta</strong> lane and move them into the <strong>Doing</strong> lane. When I finished the feature, I would commit the code and move the card from <strong>Doing</strong> to <strong>Done</strong>. When all items in <strong>Beta</strong> were finished, then the <strong>Beta</strong> was ready to release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHZuRA-IwOJp0NLix3ahfQ.png" /><figcaption>My trusty Trello board</figcaption></figure><p>This sounds simple enough, right? The problem is how easy it is to move items from <strong>v1.0</strong> to <strong>Beta</strong>. I would sometimes see a feature in the <strong>v1.0</strong> lane and convince myself that I could easily throw that into the <strong>Beta</strong> as well. This may not seem like a big deal, but doing that over and over again ensured that I would miss my own personal deadlines to have the Lintly beta released.</p><h4>How I fixed my mistake</h4><p>I created a second Trello board called “Lintly v1.0” and moved the <strong>To-Do - v1.0</strong> lane over to that board. Just the simple act of making the lane harder to see on a daily basis meant that I was much less likely to move its cards over to the <strong>Beta</strong>.</p><p>Stay focused when you are working on a beta. Figure out which features are an absolute must and ignore all the rest until the beta is released.</p><h3>Mistake #5: Comparing my app to others</h3><p>Unless you are creating an app that is based on an entirely original idea, you’ll probably find yourself making this same mistake. The mistake is comparing your app (and perhaps even yourself) to others.</p><p>I thought of the idea for Lintly in June while I was driving my wife and I home from our honeymoon. I broke international car-napping laws and woke my wife up to have her type a note on my phone. The note was four words: Flake8 As A Service.</p><p>At the time this seemed wholly original. I couldn’t believe that no one else had thought of this! We have sites like <a href="https://codecov.io/">CodeCov</a> that continuously check your code’s test coverage, so why not have the same for linting. I had to make this quickly.</p><p>As I started working on Lintly over the next month or two I realized that I was less original than I thought. There were other sites like Landscape, which lints Python, or HoundCI, which comments on GitHub PRs. This realization was certainly disappointing. Those apps are great and I feared I could never make anything as good as them. I stop working on Lintly for at a time due to discouragement.</p><h4>How I fixed the mistake</h4><p>Finally, something clicked, and that something is what helped me push through and finally release Lintly. That was the realization of two things:</p><p>1. Competition is a good thing<br>2. <a href="https://simpleprogrammer.com/2016/11/23/side-projects/">Everyone needs a side project</a></p><p>There will almost certainly always be competition for an application you are making, and that is perfectly fine. All you can do is make the application the best that you can and enjoy working on it. And if nothing else, it will always look good on a resumé!</p><h3>Conclusion</h3><p>Lintly isn’t perfect and it never will be. As you can see, I made lots of mistakes making it. But I also learned a lot about creating projects from start to (kind of) finish and about releasing them. It was a lot of fun to make and it will continue to be fun to work on as I add new features like Python 3 support and support for other linters.</p><p><em>If you’d like to try out Lintly, head over to </em><a href="https://lintly.com/"><em>lintly.com</em></a><em> and sign up for the beta. It’s completely free for open source repos and it always will be.</em></p><p><em>Oh, and I’m on </em><a href="https://twitter.com/gmcconnaughey"><em>Twitter</em></a><em>! </em>😎</p><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16de4e632042" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/mistakes-i-made-writing-a-django-app-and-how-i-fixed-them-16de4e632042">Mistakes I Made Writing a Django App (and How I Fixed Them)</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>