<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Raphael Schubert</title>
    <description>The latest articles on DEV Community by Raphael Schubert (@rf_schubert).</description>
    <link>https://dev.to/rf_schubert</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F125449%2F0c879809-926a-46ec-9ab9-6368f303cced.jpg</url>
      <title>DEV Community: Raphael Schubert</title>
      <link>https://dev.to/rf_schubert</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rf_schubert"/>
    <language>en</language>
    <item>
      <title>Postman tips - Autosave auth token on the session</title>
      <dc:creator>Raphael Schubert</dc:creator>
      <pubDate>Mon, 04 Mar 2019 19:55:36 +0000</pubDate>
      <link>https://dev.to/rf_schubert/postman-tips---autosave-auth-token-on-the-session-4bi4</link>
      <guid>https://dev.to/rf_schubert/postman-tips---autosave-auth-token-on-the-session-4bi4</guid>
      <description>&lt;p&gt;As a dev, you have to test your API endpoints every time, and if it is a bit evolved, it has a login endpoint that you need to evoke to get the auth token to work.&lt;/p&gt;

&lt;p&gt;Imagine you have this response from &lt;code&gt;/api/login&lt;/code&gt; endpoint&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3N1ZWQiOiIyMDE5LTAzLTA0VDE2OjQ2OjAzLjMyMDU1NC0wMzowMCIsImV4cGlyZXMiOiIyMDE5LTAzLTA0VDE2OjQ3OjAzLjMyMDYxOS0wMzowMCIsInNjb3BlcyI6ZmFsc2V9.cbPmdag39wvttxLHHe2BfOHUjM6vHDJ52WvoSxqLLF4g"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Normally you need to get the response, copy/paste on your session to be able to use on every endpoint on Postman.&lt;/p&gt;

&lt;p&gt;But you can do something best, you can configure your Postman to save the token on your session when you just logged in!&lt;/p&gt;

&lt;p&gt;Go on the &lt;code&gt;Tests&lt;/code&gt; tab on your Postman:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjot5qasx9k02p7wq51q8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjot5qasx9k02p7wq51q8.png" alt="Postman request tabs" width="800" height="61"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Put this config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;jsonData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;responseBody&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;token&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;jsonData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tada!!! This will save the response of the request on the current environment with the var name as &lt;code&gt;token&lt;/code&gt;, and now you can use on your routes just configuring it like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbf6bcfzpzu3fampauukt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbf6bcfzpzu3fampauukt.png" alt="Postman request headers" width="800" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can just do your login anytime and Postman will automatically save the token on your environment and all endpoints will be able to use it with no efforts.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

</description>
      <category>postman</category>
    </item>
    <item>
      <title>Using Masonite as microservice</title>
      <dc:creator>Raphael Schubert</dc:creator>
      <pubDate>Sun, 03 Mar 2019 16:06:57 +0000</pubDate>
      <link>https://dev.to/rf_schubert/using-masonite-as-microservice-4bml</link>
      <guid>https://dev.to/rf_schubert/using-masonite-as-microservice-4bml</guid>
      <description>&lt;p&gt;We have a big project built on top of &lt;code&gt;Django&lt;/code&gt; and now we started to break it on a few minor parts to be easy to maintain, update and scale.&lt;/p&gt;

&lt;p&gt;So we decided to build some of the microservices with &lt;code&gt;Masonite&lt;/code&gt; which is a good python framework and has almost all that we need built-in and ready to use.&lt;/p&gt;

&lt;p&gt;So, how to integrate it, without need change much of our current logic?&lt;/p&gt;

&lt;p&gt;We decided to basically consume it as a Rest API and built a small SDK that we override our code.&lt;/p&gt;

&lt;p&gt;For sample:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_user_documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;documents.model&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Document&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We know the above relation can be reached with &lt;code&gt;related_name&lt;/code&gt; but as we had lots of implementations, it ends on some cases in a cyclic import, so on this sample case, we will use this approach.&lt;/p&gt;

&lt;p&gt;So we moved all the documents of users to a new microservice because there we can scale the document server as we need and also improve it without the need to update the core server.&lt;/p&gt;

&lt;p&gt;How we changed the class above?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# ...
&lt;/span&gt;    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_user_documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;DocumentsMS&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get_user_documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And on our &lt;code&gt;DocumentMS&lt;/code&gt; class, we have few classes that consume the REST API, for sample:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DocumentMS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_user_documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://......&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; &lt;span class="c1"&gt;# security token header
&lt;/span&gt;        &lt;span class="n"&gt;querystring&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GET&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;querystring&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All of the codes we just wrote is for sample purposes and give you a simplistic way to use microservices along with your core server without the need to change your logic.&lt;/p&gt;

&lt;p&gt;We normally use this for all implementations and then we dive deep as each situation needs.&lt;/p&gt;

&lt;p&gt;I hope this gives you the north to how you can use microservices in an easy way.&lt;/p&gt;

&lt;p&gt;On the next article I will show how we can create a small API to response the calls we just wrote.&lt;/p&gt;

</description>
      <category>masonite</category>
      <category>api</category>
    </item>
    <item>
      <title>How to create a PIP package hosted on private Github repo</title>
      <dc:creator>Raphael Schubert</dc:creator>
      <pubDate>Mon, 21 Jan 2019 16:47:24 +0000</pubDate>
      <link>https://dev.to/rf_schubert/how-to-create-a-pip-package-and-host-on-private-github-repo-58pa</link>
      <guid>https://dev.to/rf_schubert/how-to-create-a-pip-package-and-host-on-private-github-repo-58pa</guid>
      <description>&lt;p&gt;I have few projects with few classes I've developed to integrate multiples services and servers. Those classes are &lt;code&gt;private&lt;/code&gt; to my business and now I need an easy way to allow all projects use it and download it and all its updates.&lt;/p&gt;

&lt;p&gt;What is the best way? Well, we all use &lt;code&gt;pip&lt;/code&gt; everytime to download thousands of packages to our projects and is awesome. &lt;/p&gt;

&lt;p&gt;So what can we do with our own &lt;code&gt;private&lt;/code&gt; repos? Lets host its project on &lt;code&gt;Github&lt;/code&gt; and see what happens.&lt;/p&gt;

&lt;p&gt;This articles I'm writing and will share my experience on how to do this. Until the day of this article, I have no idea like you, on HOW it will works.&lt;/p&gt;

&lt;p&gt;Lets start our study case.&lt;/p&gt;

&lt;h2&gt;
  
  
  First steps
&lt;/h2&gt;

&lt;p&gt;Based on this tutorial: &lt;a href="https://python-packaging.readthedocs.io/en/latest/minimal.html" rel="noopener noreferrer"&gt;https://python-packaging.readthedocs.io/en/latest/minimal.html&lt;/a&gt; I'll create my first ever package ready to go to my private pip repo.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating root path and start a git
&lt;/h3&gt;

&lt;p&gt;First, I'll create an path, called &lt;code&gt;ptolemaios&lt;/code&gt; wich is my main class name and start a new git on it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;ptolemaios
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;ptolemaios
&lt;span class="nv"&gt;$ &lt;/span&gt;git init
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Initialized empty Git repository &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="s1"&gt;'...ptolemaios/.git/'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Folder structure
&lt;/h4&gt;

&lt;p&gt;On the tutorial it says I need this folder structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ptolemaios/
    ptolemaios/
        __init__.py
    setup.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so, lets create again one more folder called &lt;code&gt;ptolemaios&lt;/code&gt; inside my &lt;code&gt;ptolemaios&lt;/code&gt; folder... sounds a little confusing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;ptolemaios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Creating basic files
&lt;/h4&gt;

&lt;p&gt;and lets create the files &lt;code&gt;setup.py&lt;/code&gt; and &lt;code&gt;__init__.py&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;setup.py
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;ptolemaios/__init__.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ok, now I have the exactly structure on the tutorial. Let's commit it and go to next steps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;git commit &lt;span class="nt"&gt;-am&lt;/span&gt; &lt;span class="s2"&gt;"created basic package structure files and folders"&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2 files changed, 0 insertions&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;, 0 deletions&lt;span class="o"&gt;(&lt;/span&gt;-&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; create mode 100644 ptolemaios/__init__.py
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; create mode 100644 setup.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  MVP Package
&lt;/h4&gt;

&lt;p&gt;As I want to learn how to do it, and check if is working, I'll start by creating a function that just prints something on my screen.&lt;/p&gt;

&lt;p&gt;lets open our &lt;code&gt;__init__.py&lt;/code&gt; file and edit it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def my_cool_test_method():
    print('It works!')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and also lets open our &lt;code&gt;setup.py&lt;/code&gt; and configure the basics about the package&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;setuptools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;setup&lt;/span&gt;

&lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ptolemaios&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0.0.1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;My private package from private github repo&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;git@github.com:rfschubert/ptolemaios-sdk-package.git&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Raphael Schubert&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;author_email&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;raphael.schubert@digitalbankscorp.com&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;license&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;unlicense&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ptolemaios&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;zip_safe&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can customize those infos with all infos you want.&lt;/p&gt;

&lt;p&gt;lets commit it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git commit &lt;span class="nt"&gt;-am&lt;/span&gt; &lt;span class="s2"&gt;"updated setup.py and created my_cool_test_method"&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2 files changed, 19 insertions&lt;span class="o"&gt;(&lt;/span&gt;+&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've created my private repo on github already, so now, I'll add it to project and push all commits to my repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git remote add origin git@github.com:rfschubert/ptolemaios-sdk-package.git
&lt;span class="nv"&gt;$ &lt;/span&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin master
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Counting objects: 9, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Delta compression using up to 8 threads.
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Compressing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;6/6&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Writing objects: 100% &lt;span class="o"&gt;(&lt;/span&gt;9/9&lt;span class="o"&gt;)&lt;/span&gt;, 1.00 KiB | 514.00 KiB/s, &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Total 9 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;, reused 0 &lt;span class="o"&gt;(&lt;/span&gt;delta 0&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; To github.com:rfschubert/ptolemaios-sdk-package.git
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;  &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;new branch]      master -&amp;gt; master
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Branch &lt;span class="s1"&gt;'master'&lt;/span&gt; &lt;span class="nb"&gt;set &lt;/span&gt;up to track remote branch &lt;span class="s1"&gt;'master'&lt;/span&gt; from &lt;span class="s1"&gt;'origin'&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now, I want to add it on my running project to see if will work, I'll open any project I have on my machine and try installl it from &lt;code&gt;GitHub&lt;/code&gt; using &lt;code&gt;pip&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installing with &lt;code&gt;pip&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;lets open our terminal inside the project we want to install it and run this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;git+ssh://git@github.com/rfschubert/ptolemaios-sdk-package.git
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Collecting git+ssh://git@github.com/rfschubert/ptolemaios-sdk-package.git
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;   Cloning ssh://git@github.com/rfschubert/ptolemaios-sdk-package.git to &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /private/var/folders/7z/....
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Installing collected packages: ptolemaios
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;   Running setup.py &lt;span class="nb"&gt;install &lt;/span&gt;&lt;span class="k"&gt;for &lt;/span&gt;ptolemaios ... &lt;span class="k"&gt;done&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Successfully installed ptolemaios-0.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we have few important things. Where I finded this &lt;code&gt;URL&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Well, it is the basic clone url with few modifications.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;ssh&lt;/code&gt; clone url is: &lt;code&gt;git@github.com:rfschubert/ptolemaios-sdk-package.git&lt;/code&gt;, look at &lt;code&gt;:&lt;/code&gt; on &lt;code&gt;ssh&lt;/code&gt; url, change it to &lt;code&gt;/&lt;/code&gt; and add &lt;code&gt;git+ssh://&lt;/code&gt; on your &lt;code&gt;ssh url&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now you should have &lt;code&gt;git+ssh://git@github.com/rfschubert/ptolemaios-sdk-package.git&lt;/code&gt;, that's it! just do &lt;code&gt;pip install git+ssh://git@github.com/rfschubert/ptolemaios-sdk-package.git&lt;/code&gt; and be happy!&lt;/p&gt;

&lt;p&gt;Lets test it on my project.&lt;/p&gt;

&lt;p&gt;I'll go on &lt;code&gt;Django console&lt;/code&gt; to test it easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ptolemaios&lt;/span&gt;

&lt;span class="n"&gt;ptolemaios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;my_cool_test_method&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="c1"&gt;# It works!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AWESOME! I can have now private packages on my project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step back
&lt;/h3&gt;

&lt;p&gt;Well, on my computer, all works like a charm, but that's why I have the &lt;code&gt;ssh&lt;/code&gt; keys to fetch data from private repository. How my &lt;code&gt;Heroku&lt;/code&gt; app will download it ?&lt;/p&gt;

&lt;p&gt;first I'll run the command to update my &lt;code&gt;requirements.txt&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pip freeze &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'requirements.txt'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;now, if I look inside of it, it only has my package name, and not the GIT url&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
ptolemaios==0.0.1
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you will need change this line to work like expected to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
git+ssh://git@github.com/rfschubert/ptolemaios-sdk-package.git
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so, when your server deploy, it will fetch from repository the current version.&lt;/p&gt;

&lt;p&gt;I've founded an answer that can be usefull to some of you, but not to me, I'll need do some more research and update this file later.&lt;/p&gt;

&lt;p&gt;You can create a &lt;code&gt;Machine User&lt;/code&gt; on &lt;code&gt;GitHub&lt;/code&gt; add it to your private repos, generate an &lt;code&gt;ssh&lt;/code&gt; key on your server and add it to &lt;code&gt;Machine User&lt;/code&gt;, every time you deploy, your server will have the &lt;code&gt;ssh&lt;/code&gt; key and will be allowed to download it.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to deploy to Heroku?
&lt;/h3&gt;

&lt;p&gt;I dont know yet, but I'll find out and &lt;em&gt;I'll be back&lt;/em&gt;... let's do some more research...&lt;/p&gt;

</description>
      <category>python</category>
      <category>pip</category>
      <category>packages</category>
      <category>github</category>
    </item>
  </channel>
</rss>
