<?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: Akhil Chand</title>
    <description>The latest articles on DEV Community by Akhil Chand (@akhilchand).</description>
    <link>https://dev.to/akhilchand</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%2F242648%2Fa4939868-7b29-44f2-94a1-6d7d6a3dca7f.jpeg</url>
      <title>DEV Community: Akhil Chand</title>
      <link>https://dev.to/akhilchand</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akhilchand"/>
    <language>en</language>
    <item>
      <title>Data Science</title>
      <dc:creator>Akhil Chand</dc:creator>
      <pubDate>Sun, 26 Jan 2020 12:15:57 +0000</pubDate>
      <link>https://dev.to/akhilchand/data-science-2pn9</link>
      <guid>https://dev.to/akhilchand/data-science-2pn9</guid>
      <description>&lt;p&gt;Started my journey learning Data Science course. Any suggestions!?&lt;br&gt;
Please share your journey to become successful Data Scientist.&lt;/p&gt;

&lt;h1&gt;
  
  
  Datascience #datascientist #SAS
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>This works!</title>
      <dc:creator>Akhil Chand</dc:creator>
      <pubDate>Thu, 24 Oct 2019 12:13:24 +0000</pubDate>
      <link>https://dev.to/akhilchand/this-works-1ki7</link>
      <guid>https://dev.to/akhilchand/this-works-1ki7</guid>
      <description>&lt;p&gt;Oh god, I just saw &lt;br&gt;
i-=-1 &lt;br&gt;
as a means to do &lt;br&gt;
i = i + 1&lt;/p&gt;

&lt;p&gt;(yes, it works) ;)&lt;/p&gt;

</description>
      <category>codefuncodetalk</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Step-by-step procedure to post your Django project on GitHub</title>
      <dc:creator>Akhil Chand</dc:creator>
      <pubDate>Sun, 20 Oct 2019 01:03:13 +0000</pubDate>
      <link>https://dev.to/akhilchand/step-by-step-procedure-to-post-your-project-on-github-37hj</link>
      <guid>https://dev.to/akhilchand/step-by-step-procedure-to-post-your-project-on-github-37hj</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open your project folder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a virtual environment&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual environment isolates our project. Anything we install within the virtual environment does not affect the rest &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;of the computer and vice-versa.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;on cmd: vitualenv . (to install virtual environment)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Activate the virtual environment by running activate.bat files within the scripts folder.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  git status git commands 
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;git init&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This creates a .git folder on our project folder that means git is initialized.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This shows all the folders that are not added to git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git add -all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This adds all the files to git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git commit -m "commit message"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This commits all folders to git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git log&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This shows the log of all commits in our repository. This displays most recent commits first.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Now we need to push our existing repository. First, we will need to add push our remote origin which is our remote&lt;br&gt;
repository that we created on GitHub. Copy the HTTPs web URL and paste in cmd.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git remote add origin weburl&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, we will need to push our local repository to our remote repository or GitHub account we use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git push -u origin master&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In case we get an error 'failed to push some reps to weburl, run below commands&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git pull --rebase origin master&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git push origin master&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now we can see your project on your GitHub repository.&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                 *** THANK YOU ***
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>github</category>
      <category>beginners</category>
      <category>python</category>
      <category>django</category>
    </item>
    <item>
      <title>Step-by-step procedure to post your project to Publicly accessible Heroku Server</title>
      <dc:creator>Akhil Chand</dc:creator>
      <pubDate>Sat, 19 Oct 2019 00:29:31 +0000</pubDate>
      <link>https://dev.to/akhilchand/cheatsheet-to-posting-your-project-to-publicly-accessible-heroku-server-3084</link>
      <guid>https://dev.to/akhilchand/cheatsheet-to-posting-your-project-to-publicly-accessible-heroku-server-3084</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open your project folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;install pipenv&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;on cmd: pip install pipenv&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install git ( check git --version)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install Heroku CLI (Heroku Command Line Interface)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can be installed from 'Getting Started on Heroku with Python' web page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After installing, open cmd and enter 'Heroku login' and enter login credentials same as our Heroku account login.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This will log in Heroku, which is a sign that Heroku is properly installed on our computer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a virtual environment&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual environment isolates our project. Anything we install within the virtual environment does not affect the rest &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;of the computer and vice-versa.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;on cmd: vitualenv . (to install virtual environment)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Activate the virtual environment by running activate.bat files within the scripts folder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check which version Django, requests you have and install it&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On cmd: pip install django==2.1.11 (to install Django on our virtual environment)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On cmd: pip install requests==2.19.1 (to install requests package on our virtual environment)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run manage.py and then stop it&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;on cmd: python manage.py runserver (this runs our project locally)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now Django Heroku requires Procfile &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;type 'web: gunicorn projectname.wsgi' on Procfile&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install gunicorn&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On cmd: pip install gunicorn&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*'gunicorn' is required by Heroku to run our website on the server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Install django-heroku&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On cmd: pip install django-heroku&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add stuff to settings.py file&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add the following import statement to the top of settings.py:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;import django_heroku&lt;/p&gt;

&lt;p&gt;Then add the following to the bottom of settings.py:&lt;/p&gt;

&lt;h1&gt;
  
  
  Activate Django-Heroku.
&lt;/h1&gt;

&lt;p&gt;django_heroku.settings(locals())&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;pip freeze &amp;gt; requirements.txt&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whenever we upload something to Heroku, it goes to requirements.txt file and it installs the requirements on the server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On cmd: pip freeze (this displays the packages needed on the Heroku server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On cmd: pip freeze &amp;gt; requirements.txt (this creates a new file on your project folder which contains all the requirements&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;that are needed by Heroku to install.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To create an app on heroku&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On cmd: Heroku create subdomainname (choose the name as you wish)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This creates the app with the name you give. This can be verified by opening our Heroku account dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git status git commands &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git init&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This creates a .git folder on our project folder that means git is initialized.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git status&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This shows all the folders that are not added to git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git add -all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This adds all the files to git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git commit -m "commit message"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This commits all folders to git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now we have to set remote to Heroku using below command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;heroku git:remote -a subdomainname&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git push heroku master &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This command pushes files to Heroku server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open up the website from subdomainname.herokuapp.com on the browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Admin panel not working. heroku run bash. Migrations&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now create superuser to access admin panel. To create superuser follow below steps:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On cmd: heroku run bash (This will give access to files uploaded on Heroku Server)&lt;/p&gt;

&lt;p&gt;bash gives access to files uploaded in Heroku server.&lt;/p&gt;

&lt;p&gt;$ls - shows directories inside Linux&lt;/p&gt;

&lt;p&gt;$python manage.py migrate (runs migrations)&lt;/p&gt;

&lt;p&gt;$python manage.py createsuperuser (To create superuser)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now we can log in to administrator panel using below link&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;subdomainname.herokuapp.cpm/admin/&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To update any files on the project (ex: HTML pages) and push changes to Heroku server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On cmd: git status (shows updated or new files added)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add -all

git commit -m "commit message"

git push heroku master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Now your web app is live on Heroku Server&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          *** THANK YOU ***
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>django</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
