<?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 Dwi Sulfahnur on Medium]]></title>
        <description><![CDATA[Stories by Dwi Sulfahnur on Medium]]></description>
        <link>https://medium.com/@dwisulfahnur?source=rss-2f688711c9c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uoPagBgUzlksNJSNGNPoSA.jpeg</url>
            <title>Stories by Dwi Sulfahnur on Medium</title>
            <link>https://medium.com/@dwisulfahnur?source=rss-2f688711c9c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:16:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dwisulfahnur/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[FastAPI Deployment to AWS Lambda with Serverless Framework]]></title>
            <link>https://dwisulfahnur.medium.com/fastapi-deployment-to-aws-lambda-with-serverless-framework-b637b455142c?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b637b455142c</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[fastapi]]></category>
            <category><![CDATA[mangum]]></category>
            <category><![CDATA[aws-lambda-layer]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Fri, 09 Jul 2021 18:01:16 GMT</pubDate>
            <atom:updated>2021-07-11T17:39:16.370Z</atom:updated>
            <content:encoded><![CDATA[<p>Deploy FastAPI to AWS Lambda using Serverless Framework</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*1P0PYwhfbXYwvYaEQbfZKw.png" /></figure><p>Hello, I will share how to deploy your FastAPI Project to the AWS Lambda Function. Let&#39;s do it…</p><h3>Table of Contents</h3><ul><li>Create FastAPI Project or you can use the existing one</li><li>Create AWS Execution Role for Lambda</li><li>Serverless Framework Configurations</li><li>Deploy the project</li></ul><h4>Create FastAPI Project</h4><blockquote>If you are using the existing FastAPI Project, just skip this. <br>Ops, dont forget to install mangum as the requirements</blockquote><p>Start with creating the project directory anywhere do you want on your machine, then create the python virtual environment in it.</p><pre>mkdir FastAPI-Lambda-Function<br>cd FastAPI-Lambda-Function<br>python3 -m venv venv<br>source venv/bin/activate</pre><p>Then install the requirements that are FastAPI, and Mangum</p><ul><li>FastAPI (<a href="https://fastapi.tiangolo.com/">fastapi.tiangolo.com</a>)</li><li>Mangum (<a href="https://mangum.io/">mangum.io</a>)</li></ul><pre>pip install fastapi mangum uvicorn</pre><ul><li>Uvicorn (<a href="http://uvicorn.org/">uvicorn.org</a>) we need this to test the project locally</li></ul><p>then, create a file named main.py</p><pre># main.py</pre><pre>import os<br>from fastapi import FastAPI<br>from mangum import Mangum</pre><pre><br>STAGE = os.environ.get(&#39;STAGE&#39;)<br>root_path = &#39;/&#39; if not STAGE else f&#39;/{STAGE}&#39;</pre><pre>app = FastAPI(title=&quot;FastAPI x AWS Lambda&quot;, root_path=root_path)</pre><pre>@app.get(&#39;/hello&#39;)<br>def hello_api(name: str = &quot;World&quot;):<br>    return {&quot;hello&quot;: name}</pre><pre># Mangum Handler, this is so important<br>handler = Mangum(app)</pre><p>Let’s run the project,</p><pre>uvicorn main:app --reload</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hPtiCpRBzgpAgeneqt0vSA.png" /><figcaption>The FastAPI Documentation (Swagger)</figcaption></figure><h4><strong>Create AWS Execution Role for Lambda</strong></h4><h3>Creating an execution role in the IAM console</h3><p>By default, Lambda creates an execution role with minimal permissions when you <a href="https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html">create a function in the Lambda console</a>. You can also create an execution role in the IAM console.</p><p><strong>To create an execution role in the IAM console</strong></p><ul><li>Open the <a href="https://console.aws.amazon.com/iam/home#/roles">Roles page</a> in the IAM console.</li><li>Choose <strong>Create role</strong>.</li><li>Under <strong>Common use cases</strong>, choose <strong>Lambda</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Nwnf4ClNrAG7AjXA32esw.png" /><figcaption>Create Role for Lambda</figcaption></figure><ul><li>Choose <strong>Next: Permissions</strong>.</li><li>Under <strong>Attach permissions policies</strong>, choose the AWS managed policies <strong><em>AWSLambdaBasicExecutionRole</em></strong> and <strong><em>AWSXRayDaemonWriteAccess</em></strong>.</li><li>Choose <strong>Next: Tags</strong>.</li><li>Choose <strong>Next: Review</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FXQa9Q2mlO__793UC9EhkA.png" /><figcaption>Review Lambda Execution Role Creation</figcaption></figure><ul><li>For <strong>Role name</strong>, enter <strong>lambda-execution-role</strong>.</li><li>Choose <strong>Create role</strong>.</li></ul><p>Open the role that you just created, then copy the <strong>Role ARN<em> </em></strong><em>(will be used on the next step)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zs3_TR4seShsXPfbM_upsA.png" /><figcaption>AWS Role Detail</figcaption></figure><h4>Serverless Framework Configurations</h4><p>create Python Requirements file</p><pre>pip freeze &gt; requirements.txt</pre><p>Install serverless framework if it&#39;s not installed before</p><pre>npm i -g serverless</pre><p>Install <strong>serverless-python-requirements</strong> plugin for serverless</p><pre>sls plugin install -n serverless-python-requirements</pre><p>then, create the <strong><em>serverless.yaml </em></strong>file</p><pre># serverless.yaml<br>service: FastAPI-Lambda-Function<br></pre><pre>package:<br>  individually: true<br></pre><pre>provider:<br>  name: aws<br>  profile: ${opt:aws-profile, &quot;default&quot;}<br>  region: ${opt:region}<br>  stage: ${opt:stage, &quot;dev&quot;}<br>  runtime: python3.8<br>  memorySize: 128<br>  timeout: 30<br>  iam:<br>    role: ${opt:iamrole}</pre><pre>plugins:<br>  - serverless-python-requirements<br></pre><pre>custom:<br>  pythonRequirements:<br>    dockerizePip: true<br>    layer:<br>      name: FastAPI-Lambda-Function<br>      description: FastAPI-Lambda-Function API Layer<br>      compatibleRuntimes:<br>        - python3.8</pre><pre>functions:<br>  app:<br>    package:<br>      patterns:<br>        - &#39;src/**&#39;<br>        - &#39;!requirements.txt&#39;<br>        - &#39;!package.json&#39;<br>        - &#39;!package-lock.json&#39;<br>        - &#39;!.serverless/**&#39;<br>        - &#39;!venv/**&#39;<br>        - &#39;!node_modules/**&#39;<br>      handler: main.handler<br>      environment:<br>        STAGE: ${self:provider.stage}<br>      layers:<br>        - { Ref: PythonRequirementsLambdaLayer }<br>      events:<br>        - http:<br>            method: get<br>            path: /<br>        - http:<br>            method: any<br>            path: /{proxy+}</pre><h4>Deploy the project</h4><blockquote>Make sure you already configure the AWS CLI Before, because the deployment process will be using it.</blockquote><pre>serverless deploy --region &#39;<strong>ap-southeast-1</strong>&#39; --stage &#39;dev&#39; --aws-profile &#39;<strong>default</strong>&#39; --iamrole &#39;<strong>paste-your-lambda-arn-role-here</strong>&#39;</pre><p>Change the opt value with your own</p><ul><li><strong>region:</strong> the AWS region that you wanna used</li><li><strong>aws-profile: </strong>the AWS CLI Profile (default will be used if it&#39;s not provided)</li><li><strong>stage:</strong> the default is dev, but you could change it with do you want (ex: staging)</li><li><strong>iamrole:</strong> using the ARN Role that you are copied on the previous step</li></ul><p>If the deployment process success, the output on the console will be like the following picture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ES6QIA2LH6XebAkm_MrdWQ.png" /><figcaption>Deploy FastAPI on the AWS Lambda Success</figcaption></figure><p>Then open the docs URL on the browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EbQqZRS5VpqvpukglwUWMA.png" /><figcaption>Deploy FastAPI on the AWS Lambda</figcaption></figure><p>Done 🎉🎉🎉</p><p>Project Repo: <a href="https://github.com/dwisulfahnur/fastapi-mangum-lambda">https://github.com/dwisulfahnur/fastapi-mangum-lambda</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b637b455142c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Avoid redundant Component imports in Nuxt]]></title>
            <link>https://dwisulfahnur.medium.com/shared-global-component-in-nuxt-through-plugins-2f22d56c9c7c?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f22d56c9c7c</guid>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[nuxt]]></category>
            <category><![CDATA[nuxt-plugin]]></category>
            <category><![CDATA[nuxtjs]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Mon, 28 Jun 2021 12:27:27 GMT</pubDate>
            <atom:updated>2021-07-05T09:06:20.850Z</atom:updated>
            <content:encoded><![CDATA[<p>The idea is to create a plugin to register some reusable components that will be used repeatedly</p><p>Okay, so in this post I will share how I solve my problem about redundant import Component in Nuxt.</p><p>Here we go…</p><p>I have a component named <strong>“PrimaryButton”</strong>, it will be use in some pages. In each pages, I have to import it and register it on the page component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c24df13873adcaf0244543500659ea71/href">https://medium.com/media/c24df13873adcaf0244543500659ea71/href</a></iframe><p>The codes in above is an example of page component that use <strong>PrimaryButton</strong> component, which is we have to import and register it on our component. If we have more than one component, we will doit repeatedly right?</p><p>So, my idea is to create a <strong>plugin</strong> in <strong>Nuxt</strong> to solve the problem. <strong><em>src/plugins/global-components.js</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a777f01bdbef795ace23abc6377953d/href">https://medium.com/media/3a777f01bdbef795ace23abc6377953d/href</a></iframe><p>then, register it on the <strong><em>nuxt.config.js</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/655c318e005c7b1f42cf91db132a3e92/href">https://medium.com/media/655c318e005c7b1f42cf91db132a3e92/href</a></iframe><p>After that, I can use the global components directly on the all of the component/page-component in the project without import statement.</p><p>Thanks ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f22d56c9c7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Change the default Port (8080) of  the Jenkins in CentOS]]></title>
            <link>https://dwisulfahnur.medium.com/how-to-change-the-default-port-8080-of-the-jenkins-in-centos-66cf99422243?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/66cf99422243</guid>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Sat, 25 Jan 2020 10:45:36 GMT</pubDate>
            <atom:updated>2020-01-25T10:46:26.111Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Change the default Port (8080) of the Jenkins in CentOS</h3><p>The simple way to change the default PORT of Jenkins Instance</p><p>Make sure you have root access to the server, then edit the jenkins configuration file:</p><pre>vi /etc/sysconfig/jenkins</pre><blockquote>Using your favorite editor</blockquote><p>Search the <strong>JENKINS_PORT</strong> var on that file, and change the value with the port that do you want.</p><pre>JENKINS_PORT=”8080&quot;</pre><p>Then, restart the Jenkins service</p><pre>$ sudo systemctl restart jenkins</pre><p>Change the firewall configurations</p><p>Remove the old port of Jenkins. In this case, we will close the port 8080/http and open it for the new port (8081/tcp).</p><pre>$ sudo firewall-cmd --remove-port=8080/tcp<br>$ sudo firewall-cmd --permanent --zone=public --add-port=8081/tcp</pre><p>Reload the firewall-cmd configurations</p><pre>$ sudo firewall-cmd --reload</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YKcq_lyTPlp_fg9pkAMMtw.png" /><figcaption>Jenkins login on the new port (8081)</figcaption></figure><p>Congratulations, you have success to change the Jenkins PORT.</p><p>You could support me with your claps if you think this article is useful for you<br><strong>Thank you very much 😘</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66cf99422243" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Jenkins on CentOS 8]]></title>
            <link>https://dwisulfahnur.medium.com/install-jenkins-on-centos-8-ec4581d861d9?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec4581d861d9</guid>
            <category><![CDATA[centos]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Sat, 25 Jan 2020 10:21:03 GMT</pubDate>
            <atom:updated>2020-01-26T13:07:39.714Z</atom:updated>
            <content:encoded><![CDATA[<p>Jenkins installation and configuration on Linux CentOS 8</p><h3>What is Jenkins and what is CI/CD?</h3><p>Jenkins is an open-source software automation server that allows you to set up Continuous Integration and Continuous Delivery (CI/CD) pipeline.</p><p><strong>Continuous Integration</strong> is a <em>software development</em> practice in which team members regularly commit and push their code to the repository of the version control like <strong>git</strong> or svn, after which automated builds and tests are run.</p><p><strong>Continuous Delivery </strong>is a process where code changes are automatically built, tested, and deployed to the production environment or even only for the development or staging environment.</p><p>This article is part of my other article about <strong>Set up Continous Integration for Python App with Jenkins</strong></p><p>Will be posted later…</p><h3>Jenkins Installation</h3><h4>Install Java</h4><p>Jenkins is a java-based software, so the first step is to install Java. The java version that compatible with Jenkins is 8 and 11, but some Jenkins plugins may not be compatible anymore with Java 8.</p><pre>$ sudo yum update<br>$ sudo yum install java-11-openjdk-devel</pre><h4>Install Jenkins</h4><p>Add the Jenkins repository and download the repo file, then import the GPG key:</p><pre>$ sudo wget -O /etc/yum.repos.d/jenkins.repo <a href="http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo">http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo</a><br>$ sudo rpm --import <a href="https://jenkins-ci.org/redhat/jenkins-ci.org.key">https://jenkins-ci.org/redhat/jenkins-ci.org.key</a></pre><p>Install the latest stable version of the Jenkins</p><pre>$ sudo yum install jenkins</pre><p>if the installation process has been finished, start and enable the Jenkins service</p><pre>$ sudo systemctl start jenkins<br>$ sudo systemctl enable jenkins</pre><p>Check the service status</p><pre>$ sudo systemctl status jenkins</pre><p>The normal output if the Jenkins service successfully install will be like the following picture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vrENUNtan8qfrBOBoIbhhw.png" /><figcaption>Jenkins service status running smoothly 😉</figcaption></figure><h3>Set up Jenkins</h3><p>If the Jenkins service has been running successfully, theoretically you could access the Jenkins from your browser in the port 8080. Make sure the port 8080 on your server is opened.</p><h4>Set up Firewall</h4><p>In CentOS, you can open the port by using <strong><em>firewall-cmd</em></strong>.</p><pre>$ sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp<br>$ sudo firewall-cmd --reload</pre><p>Now, you could continue the setup process by access the Jenkins on your browser in URL: Http<strong><em>://&lt;host-ip&gt;:8080</em></strong></p><blockquote>In some cases, if you are using a cloud service to install Jenkins, you have to open the 8080 port from the Network Group configurations of your Jenkins instance.</blockquote><h4>Jenkins Configuration</h4><p>The first screen if you access the Jenkins on the browser will be like the following picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JrWpp6UMmlf3Up0bok_OXg.png" /><figcaption>The first screen on the browser of the Jenkins installation</figcaption></figure><p>So the Jenkins protecting itself with Administrator that generated on the installation process, so the unauthorized user will not be able to access or make a configuration without access to the server.</p><p>Let’s follow the description on the screen to get the <strong><em>Administrator password </em></strong>and unlock the Jenkins,</p><pre>$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6uUbm88xVD-TPKA2fmiiQ.png" /><figcaption>Open the Jenkins Administrator Password</figcaption></figure><p>Fill the password form with the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yyEA7YN_Ovni8O58UG8GHQ.png" /><figcaption>Select the Jenkins Plugins</figcaption></figure><p>On the next screen, you will be asked whether you want to <strong>“Install the suggested plugins”</strong> or to <strong>“Select the plugins to install”</strong>. Select the <strong>“Install suggested plugins”</strong> if you don’t want to be confused to select the plugins. You could install the other plugins that you needed later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OpDlbJUK_ZFqj6gE_1Qjfg.png" /><figcaption>Jenkins Plugins installation process</figcaption></figure><p>Once the installation is finished, you will be asked to set up the first Admin User. Fill the user form and click “Save and Continue”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ElJxBqhTs5WKCQomO-sZuA.png" /><figcaption>Create the first Admin Jenkins User</figcaption></figure><p>The next page is the Instance Configuration process. Usually, the input form will be automatically be filled with the default IP/Domain of your Jenkins instance, you just have to ensure it is correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zDDdLeCY5xERciKjLkW-Kg.png" /><figcaption>Jenkins Instance Configuration</figcaption></figure><p>To finish the setup, click the “Save and Finish” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rACOHLDa_KulDGVEo9MuGA.png" /><figcaption>Jenkins Configurations finish</figcaption></figure><p>Finally, our Jenkins is ready. Click the <strong>“Start using Jenkins” </strong>button to access the Jenkins dashboard page.</p><p>The following is the picture of the Jenkins Dashboard Page, you can start to create your first job by clicking the<strong> “create new jobs”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sO3WJoOAVm34xU-jBT-2Ow.png" /><figcaption>Jenkins Dashboard Page</figcaption></figure><p>Happy working 😃</p><p>You could support me with your claps if you think this article is useful for you, Thank you very much 😘</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec4581d861d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Menggunakan Django Debug Toolbar untuk Development]]></title>
            <link>https://dwisulfahnur.medium.com/menggunakan-django-debug-toolbar-untuk-development-fc650be403e5?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc650be403e5</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[django-debug-toolbar]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Mon, 11 Feb 2019 11:54:16 GMT</pubDate>
            <atom:updated>2019-02-12T03:32:53.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gLVtAu6Yjs3p8-fHJrsPOQ.png" /></figure><h3><strong>Introduction</strong></h3><blockquote>The Django Debug Toolbar is a configurable set of panels that display various debug information about the current request/response and when clicked, display more details about the panel’s content.</blockquote><p>Django Debug Toolbar adalah panel set yang dapat dikonfigurasi yang menampilkan berbagai informasi debug tentang (requests/respons) dari halaman/endpoint yang kita akses dan ketika diklik, menampilkan detail lebih lanjut tentang konten panel.</p><p>Menurut saya sendiri fitur yang ada pada django-debug-toolbar sangat membantu dalam proses development.</p><h3><strong>Features</strong></h3><p>Pada saat membuat postingan ini, saya menggunakan django-debug-toolbar versi 1.11 dengan beberapa panel fitur diantaranya sebagai berikut,</p><ul><li><strong>Versions. </strong>Menampilkan versi Python, Django, dan django-debug-toolbar yang kita gunakan</li><li><strong>Time. </strong>Menampilkan waktu yang digunakan untuk menampilkan halaman/endpoint yang kita akses, baik itu dari sisi server maupun Client yang kita gunakan. berikut merupakan salah satu contoh hasil debug T<strong>imes </strong>dari django-debug-toolbar untuk halaman yang saya akses.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AeouyJeR1y4p484qnGMYtQ.png" /><figcaption>Time Tabs of django-debug-toolbar</figcaption></figure><ul><li><strong>Settings</strong>. Menu settings akan menampilkan settings file dan daftar flag/variables yang aktif.</li><li><strong>Headers</strong>. Menampilkan daftar header pada <strong>request</strong> dan <strong>response </strong>yang kita gunakan untuk mengakses halaman.</li><li><strong>Requests. </strong>Menampilkan fungsi/class yang digunakan untuk menampilkan halaman tersebut dan urlName-nya. Tab <strong>Requests </strong>juga menampilkan <strong>Cookies, Session</strong>,<strong> </strong>dan <strong>GET/POST data.</strong></li><li><strong>SQL. </strong>Tab SQL akan menampilkan jumlah <strong>Query </strong>yang digunakan untuk menampilkan halaman yang diakses. Tab ini juga akan menampilkan secara detail masing-masing query beserta Timeline Graphic dan waktu eksekusi query tersebut.</li><li><strong>Static Files, </strong>Tab Static Files menampilkan static file yang ada pada halaman tersebut seperti css, js, atau images files.</li><li><strong>Templates.</strong></li><li><strong>Cache.</strong></li><li><strong>Signals.</strong></li><li><strong>Logging.</strong></li></ul><h3><strong>Installation</strong></h3><p>Proses instalasi django-debug-toolbar dapat dilakukan dengan menggunakan pip,</p><pre><strong>pip install django-debug-toolbar</strong></pre><p>Tambahkan sebagai INSTALLED_APPS pada settings.py file:</p><pre><strong>INSTALLED_APPS = [<br>    ...<br>    &#39;debug_toolbar&#39;,<br>]</strong></pre><p>Tambahkan ke main urls.py file dari django project,</p><pre># project/urls.py</pre><pre>...</pre><pre><strong>if settings.DEBUG:<br>    import debug_toolbar<br>    urlpatterns = [<br>        path(&#39;__debug__/&#39;, include(debug_toolbar.urls)),<br><br>        <em># For django versions before 2.0:</em><br>        <em># url(https://medium.com/r&#39;^__debug__/&#39;,%20include(debug_toolbar.urls)),</em><br><br>    ] + urlpatterns</strong></pre><p>Tambahkan middleware untuk django-debug-toolbar:</p><pre>MIDDLEWARE [ <br>    ...<br>    <strong>&#39;debug_toolbar.middleware.DebugToolbarMiddleware&#39;</strong><br>]</pre><p>Tambahkan INTERNAL_IPS pada settings file,</p><pre><strong>INTERNAL_IPS = [&quot;127.0.0.1&quot;]</strong></pre><p>Django Debug Toolbar akan ditampilkan hanya jika IP yang mengakses ada pada list di INTERNAL_IPS.</p><p>Done 😉</p><p>Source: <a href="https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips"><em>https://django-debug-toolbar.readthedocs.io/en/latest/installation.html</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc650be403e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django SlugField Auto Generate and Unique]]></title>
            <link>https://dwisulfahnur.medium.com/django-slugfield-auto-generate-and-unique-ffaff2043bb3?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffaff2043bb3</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[model]]></category>
            <category><![CDATA[slugfield]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Sat, 09 Feb 2019 09:42:41 GMT</pubDate>
            <atom:updated>2019-02-13T08:33:25.108Z</atom:updated>
            <content:encoded><![CDATA[<p>This is my code when using SlugField on Django with autogenerate when the data created in the first time and it will be unique.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23301c3a33e52378408cc3a1922459f0/href">https://medium.com/media/23301c3a33e52378408cc3a1922459f0/href</a></iframe><p>😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffaff2043bb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use MS SQL as Database Server in Django 2.1]]></title>
            <link>https://dwisulfahnur.medium.com/how-to-use-ms-sql-as-database-server-in-django-2-1-42959314e8bb?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/42959314e8bb</guid>
            <category><![CDATA[microsoft-sql-server]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[mssql]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Sat, 01 Dec 2018 20:44:48 GMT</pubDate>
            <atom:updated>2018-12-07T16:49:20.891Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*ZhkdlooPVplzgl1t0oVwQg.png" /></figure><h3>How to Use MS SQL Azure Database Server in Django 2.1</h3><h3>Install ODBC Driver for MS SQL Server</h3><h4>OS X 10.11 (El Capitan), 10.12 (Sierra), 10.13 (High Sierra), and 10.14 (Mojave)</h4><pre>$ brew update<br>$ brew install -no-sandbox msodbcsql17 mssql-tools<br>$ brew tap microsoft/mssql-release <a href="https://github.com/Microsoft/homebrew-mssql-release">https://github.com/Microsoft/homebrew-mssql-release</a></pre><h4>Ubuntu 14.04, 16.04, 17.10 and 18.04</h4><pre>$ sudo su</pre><pre>$ curl <a href="https://packages.microsoft.com/keys/microsoft.asc">https://packages.microsoft.com/keys/microsoft.asc</a> | apt-key add -</pre><pre>$ curl <a href="https://packages.microsoft.com/config/ubuntu/%7Bversion%7D/prod.list">https://packages.microsoft.com/config/ubuntu/<strong><em>{version}</em></strong>/prod.list</a> &gt; /etc/apt/sources.list.d/mssql-release.list</pre><pre>$ exit</pre><pre>$ sudo apt-get update </pre><pre>$ sudo ACCEPT_EULA=Y apt-get install msodbcsql17 </pre><pre>$ sudo ACCEPT_EULA=Y apt-get install mssql-tools </pre><pre>$ echo &#39;export PATH=&quot;$PATH:/opt/mssql-tools/bin&quot;&#39; &gt;&gt; ~/.bash_profile</pre><pre>$ echo &#39;export PATH=&quot;$PATH:/opt/mssql-tools/bin&quot;&#39; &gt;&gt; ~/.bashrc </pre><pre>$ source ~/.bashrc </pre><pre>$ sudo apt-get install unixodbc-dev</pre><blockquote>Adjust the <strong>{version}</strong> with your ubuntu version (14.04,16.04,17.10,18.04)</blockquote><h3>Install Django Pyodbc Azure</h3><p>Install django-pyodbc-azure using pip on the python environment of your djangoapp.</p><pre>pip install django-pyodbc-azure</pre><h3><strong>Update Database Configuration</strong></h3><p>Update your databases configuration in settings file of the project like the following. Adjust the name, host, user, password, and port parameter with yours.</p><pre>DATABASES = {<br>     &#39;default&#39;: {<br>         &#39;ENGINE&#39;: &#39;sql_server.pyodbc&#39;,<br>         &#39;NAME&#39;: &#39;***&#39;,<br>         &#39;HOST&#39;: &#39;***&#39;,<br>         &#39;USER&#39;: &#39;***&#39;,<br>         &#39;PASSWORD&#39;: &#39;***&#39;,<br>         &#39;PORT&#39;: 1433,<br>         &#39;OPTIONS&#39;: {<br>            &#39;driver&#39;: &#39;ODBC Driver 17 for SQL Server&#39;,<br>         }<br>     }<br>}</pre><p>Done 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42959314e8bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open edX student grades download issue (404 Not Found)]]></title>
            <link>https://dwisulfahnur.medium.com/open-edx-student-grades-download-issue-404-not-found-3d7995980389?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d7995980389</guid>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[open-edx]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Thu, 15 Nov 2018 18:22:16 GMT</pubDate>
            <atom:updated>2018-11-15T18:22:16.242Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vem-9tm28cyMnf8YY2Fa4Q.png" /></figure><p>In this post, i will share about how to fix student data generation of Open edX <strong>Not Found.</strong> This problem occurs when we don’t use <strong>s3</strong> as to save student data generation.</p><p>To fix this problem we have to create a link to true location of <strong>.csv</strong> file (<strong>/tmp/edx-s3/grades</strong>) in <strong>/edx/var/edxapp/media</strong> directory by typing the following command.</p><pre>$ ln -s /tmp/edx-s3/grades /edx/var/edxapp/media</pre><p>Then, update nginx VirtualHost configuration of lms (<strong>/edx/app/nginx/sites-avaliable/lms</strong>). Find the following codes on the file:</p><pre>location ~ ^/media/(?P&lt;file&gt;.*) {<br>    root /edx/var/edxapp/media;<br>    try_files /$file =404;<br>    expires 31536000s;<br>}</pre><p>then update it with the following codes:</p><pre>location ~ ^/media/(?P&lt;file&gt;.*) {<br>    root /edx/var/edxapp/media;<br>    try_files /$file /grades/$file;<br>    expires 31536000s;<br>}</pre><pre>location ~ ^/grades/(?P&lt;file&gt;.*) {<br>    root /edx/var/edxapp/media/grades;<br>    try_files /$file =404;<br>    expires 31536000s;<br>}</pre><p>Restart the nginx service</p><pre>$ sudo service nginx restart</pre><p>Done 😎</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d7995980389" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cara menggunakan fitur Library di Open edX]]></title>
            <link>https://medium.com/valutac/cara-menggunakan-fitur-library-di-open-edx-c8aea2666633?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8aea2666633</guid>
            <category><![CDATA[studio]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[libraries]]></category>
            <category><![CDATA[open-edx]]></category>
            <category><![CDATA[elearning]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Thu, 23 Aug 2018 09:31:28 GMT</pubDate>
            <atom:updated>2018-08-23T09:31:28.672Z</atom:updated>
            <content:encoded><![CDATA[<p>Fitur <em>Library</em> di Open edX ini digunakan untuk untuk membuat sekumpulan <em>components</em> yang akan digunakan sebagai konten soal pada kursus.</p><p>Kelebihan dari fitur ini adalah kita dapat menampilkan komponen yang telah kita buat secara acak (<strong><em>Random</em></strong>) dalam jumlah tertentu. Misalnya kita mempunyai 8 soal yang ada pada Library, kita hanya ingin menampilkan 3 soal secara acak dari 8 soal tersebut ke setiap user.</p><p>Berikut merupakan gambar ilustrasi dari skenario diatas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*DEi79REPWnYv4ErSds7pdA.png" /></figure><p>Semoga dipahami yah 😅. Selanjutnya kita akan coba untuk membuat <em>Library</em> untuk kursus yang sudah ada.</p><p>Pada menu Home Studio, pilih <strong><em>New Library </em></strong>yang ada pada pojok kanan atas halaman. Anda akan diminta untuk mengisi form yang dibutuhkan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ypfg86PC04j-VlMBjnM9DA.png" /><figcaption>Create Library</figcaption></figure><p>Langkah selanjutnya kita membuat komponen-komponen yang akan kita tambahkan ke <em>Library</em> tersebut. Disini saya menambahkan 6 komponen problem berupa <em>Multiple Choice</em>. Selain <em>Problem Component</em>, kita juga dapat menambahkan <strong><em>Video dan HTML Component</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8s4hHRTocw2VfZz6x8AfQ.png" /><figcaption>List Component of the Library</figcaption></figure><p>Setelah kita mengisi <em>Library</em> tersebut dengan <em>Components</em>, langkah selanjutnya yaitu menerapkan <em>library</em> tersebut ke kursus. Sebelum kita menggunakan Library yang ada pada kursus, kita perlu mengaktifkan Fitur <em>Library</em> pada kursus.</p><p>Pada menu <strong><em>Settings -&gt; Advanced Settings, </em></strong>tambahkan<em> </em><strong><em>“library_content” </em></strong>pada form input <strong><em>Advance Module List.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_X0Heq3o2kGbKaE1wV6RsQ.png" /><figcaption>Activate <strong>Library Content</strong> on the Course Settings</figcaption></figure><p>Setelah itu, pilih <strong><em>unit</em></strong> yang akan anda gunakan untuk menampilkan c<em>omponents</em> yang ada pada <em>library</em> yang telah dibuat. Tambahkan komponen <strong><em>Randomized Content Block </em></strong>yang ada pada<strong> Advanced Component</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5FE8L0DDiZT7DCBQfcX8WQ.png" /><figcaption>Add <strong><em>Randomized Content Block</em></strong> Component</figcaption></figure><p>Setelah <strong><em>Randomized Content Block </em></strong>dibuat, edit komponen tersebut.</p><ul><li><strong>Count, </strong>tentukan jumlah komponen yang akan ditampilkan ke user.</li><li><strong>Display Name, </strong>tentukan nama dari komponen tersebut.</li><li><strong>Library, </strong>pilih nama Library yang telah anda buat.</li><li><strong>Problem Type, </strong>pilih tipe problem yang akan digunakan. Jika ingin menampilkan semua jenis problem anda bisa memilih pilihan default yaitu <strong>“Any Type”.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bsl2Oug10PrOYY3hH7wE0g.png" /><figcaption>Setup <strong>Randomized Content Block </strong>Component</figcaption></figure><p>Jangan lupa klik <strong>“save” </strong>untuk menyimpan pengaturan yang telah dilakukan dan “<strong>Publish</strong>” Unit tersebut.</p><p>Untuk melihat hasil dari penggunaan fitur Library ini, anda dapat melihat preview Unit dari kursus tersebut dengan menggunakan user yang berbeda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WoY1vIFfRAMzfgtsfNNpNQ.png" /><figcaption>(<strong>Left</strong>) Access using staff user. (<strong>Right</strong>) Access using admin user.</figcaption></figure><p>Dapat kita lihat pada gambar diatas, kedua user mengakses Unit dan Kursus yang sama dan menampilkan jenis dan urutan dan komponen yang berbeda.</p><p>Terimakasih, Semoga bermanfaat 😃</p><p>Jika Anda ingin diskusi lebih lanjut tentang Open edX silahkan kontak kami di support@valutac.com</p><p>(<strong>Editor RA</strong>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8aea2666633" width="1" height="1" alt=""><hr><p><a href="https://medium.com/valutac/cara-menggunakan-fitur-library-di-open-edx-c8aea2666633">Cara menggunakan fitur Library di Open edX</a> was originally published in <a href="https://medium.com/valutac">Valutac</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to setup Github push with SSH Keys]]></title>
            <link>https://dwisulfahnur.medium.com/how-to-setup-github-push-with-ssh-keys-243ce0d4d40a?source=rss-2f688711c9c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/243ce0d4d40a</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[Dwi Sulfahnur]]></dc:creator>
            <pubDate>Thu, 14 Sep 2017 00:00:00 GMT</pubDate>
            <atom:updated>2019-01-06T02:55:02.231Z</atom:updated>
            <content:encoded><![CDATA[<p>Thursday. September 14, 2017–2 mins</p><p>Every you push a commit to your repository, you usually have to enter your username and password. It will take much time and effort, In this post, i show you how to push your commit without enter username and password using ssh keys. So how to do it.</p><h3>Generating a new ssh key.</h3><p>Open your terminal Paste the text below, substituting in your GitHub email address.</p><pre>ssh-keygen -t rsa -b 4096 -C &quot;<a href="/service/mailto:your_email@example.com">your_email@example.com</a>&quot;</pre><p>This creates a new ssh key, using the provided email as a label. When you’re prompted to “Enter a file in which to save the key,” press Enter. This accepts the default file location. At the prompt, type a secure passphrase.</p><h3>Adding your ssh key to the ssh-agents</h3><p>Start the ssh-agent in the background.</p><pre>eval &quot;$(ssh-agent -s)&quot;</pre><p>Add your SSH private key to the ssh-agent. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.</p><pre>ssh-add ~/.ssh/id_rsa</pre><h3>Adding a new SSH key to your GitHub account</h3><p>Copy the SSH Key to your clipboard. in this case, I using xclip tools to copy some text in terminal to my clipboard. so you have to install xclip by typing the following command in your terminal.(I use Ubuntu OS, adjust with your os)</p><pre>$ sudo apt install xclip<br>$ xclip -sel clip &lt; ~/.ssh/id_rsa.pub</pre><p>In the upper-right corner of any page, click your profile photo, then click Settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/0*6h1LfuM8pvaKEqCY" /></figure><p>In the user settings sidebar click SSH and GPG keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/0*rZkehntS-nABJl4M" /></figure><p>Click New SSH key or Add SSH key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*SjVfaHT-SXVPWbYS" /></figure><p>In the “Title” field, add a descriptive label for the new key. For example “My Ubuntu”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*pb_rrtBHvN0HAjwD" /></figure><p>Paste your key into the “Key” field. then, click Add SSH key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/159/0*t2Uqb1eE94IRsGjI" /></figure><p>If prompted, confirm your GitHub password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/0*X47yioUsWCBPtM6D" /></figure><h3>Configure you Github Repository</h3><p>In your terminal, go to your repository directory, then typing the following command. Adjust with your repository address.</p><pre>$ git config remote.origin.url <a href="/service/mailto:git@github.com">git@github.com</a>:your_username/your_project.git</pre><p>Done 😃</p><p><em>Originally published at </em><a href="https://dwisulfahnur.com/How-to-setup-Github-push-with-SSH-Keys/"><em>dwisulfahnur.github.io</em></a><em> on September 14, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=243ce0d4d40a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>