<?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 Sushant Rao on Medium]]></title>
        <description><![CDATA[Stories by Sushant Rao on Medium]]></description>
        <link>https://medium.com/@raosushant7?source=rss-d9c032971740------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LHUP6WlaRAUN1hqDtuNe0Q.jpeg</url>
            <title>Stories by Sushant Rao on Medium</title>
            <link>https://medium.com/@raosushant7?source=rss-d9c032971740------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:07:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raosushant7/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[Building a Data Science Website with Flask + Venv(Anaconda) — Part 1]]></title>
            <link>https://raosushant7.medium.com/building-a-data-science-website-with-flask-venv-anaconda-part-1-981a319bbe05?source=rss-d9c032971740------2</link>
            <guid isPermaLink="false">https://medium.com/p/981a319bbe05</guid>
            <category><![CDATA[anaconda]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[virtual-environment]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[website-development]]></category>
            <dc:creator><![CDATA[Sushant Rao]]></dc:creator>
            <pubDate>Fri, 30 Oct 2020 08:24:09 GMT</pubDate>
            <atom:updated>2020-10-30T08:24:09.850Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Data Science Website with Flask + Venv(Anaconda) — Part 1</h3><p>I have recently undertaken to learn about building a website using <em>Flask</em> and <em>Anaconda</em>. I have chosen <a href="https://www.anaconda.com/">Anaconda</a> since, for starters, I have worked extensively on it in my journey so far as a Data Scientist, and also to integrate Dashboards and Machine Learning models easily into the website.</p><p>In Part 1, we will see the basic set-up of <em>git, virtual environment, Flask</em> to start building an interactive data science and analytics website.</p><p>NOTE: This set-up is done for Windows. Kindly refer to the documentation of your respective OS to look-up alternate commands.</p><h3>Set-up folder and git</h3><ol><li>Create a folder</li><li>Initialize git inside the folder</li></ol><p>We will use the Anaconda prompt throughout this process since that makes your life easier. For initializing a folder and git, open up the Anaconda prompt and type the following commands</p><pre>mkdir &lt;your_folder_name&gt; &amp;&amp; cd &lt;your_folder_name&gt;</pre><pre>git init</pre><h3>Set-up virtual environment using Anaconda</h3><p>Creating a virtual environment is helpful since it protects your project/website from any unnecessary/inadvertent upgrades to any packages that occur when Anaconda is updated on your system. Follow the steps below to create a virtual environment inside your project folder.</p><p>Check the version of Anaconda (optional step)</p><pre>conda -V</pre><p>Update Anaconda to the latest version (optional step)</p><pre>conda update conda</pre><p>Create a virtual environment (might take some time).</p><pre>conda create -n &lt;envname&gt;</pre><p>Alternatively, if you want a specific version of python to be used for creating the virtual environment, simply use this command. Replace x.x with the python version that you desire. Eg. python=3.5</p><pre>conda create -n &lt;envname&gt; python=x.x anaconda</pre><p>Activate your virtual env</p><pre>conda activate &lt;envname&gt;</pre><p>Once the virtual environment is activated, the (base) written before the prompt will change to (&lt;envname&gt;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*gHMSKNto8GJA12ZQiOb2ag.png" /></figure><h3>Set-up Flask</h3><p>Flask is usually installed and included in the Anaconda packages. If you do not find it, you can go through the following steps.</p><pre>python -m pip install Flask</pre><p>To quickly check if Flask is installed, run the following:</p><pre>python</pre><pre>&gt;&gt;&gt; import flask</pre><p>If no error is displayed, you have Flask installed and you can now exit python. Yay!</p><pre>&gt;&gt;&gt; exit()</pre><h3>Save your Requirements</h3><p>Put the list of libraries/packages in your virtual environment into the <em>requirements.txt</em> file. This is a futuristic step which is required in case of any collaboration. Since we have set-up the virtual environment already, we can quickly get this step out of the way.</p><pre>python -m pip freeze &gt; requirements.txt</pre><h3>Write your first Flask program</h3><p>Choose an IDE of your choice (I prefer <a href="https://www.jetbrains.com/pycharm/">PyCharm</a> / <a href="https://code.visualstudio.com/">VSCode</a>) and create a file “app.py” in the folder that you set-up in the beginning.</p><p>Write the following snippet of code in your app.py file</p><pre>from flask import Flask<br><br>app = Flask(__name__)<br></pre><pre># Selects the page for which a function is to be defined. Right now there will only be one page in your website.<br><br>@app.route(&#39;/&#39;)<br><br>def hello():<br><br>    return &quot;&lt;h1&gt;Hello World!&lt;/h1&gt;&quot; \<br>           &quot;\nThis is my introduction to Flask!&quot; \<br>           &quot;\nI can write a lot of things on this page.\nLet&#39;s get started!&quot;<br><br># The above function returns the HTML code to be displayed on the page</pre><pre><br>if __name__ == &#39;__main__&#39;:<br><br>   app.run()</pre><h3>Your Website is ready for launch!</h3><p>Run the “app.py” file with the following command in the Anaconda prompt</p><pre>python app.py</pre><p>After you run the above command, you will get this output in your Anaconda prompt window. This means your website is up and running!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*hgQZn2uugLgLdBmZmHKDTA.png" /></figure><h3>Have a Look!</h3><p>Finally, to take a look at your website, type in either “http://127.0.0.1:5000/&quot; or “localhost:5000” into your browser’s address bar, and voila! Your website is ready to go!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*3giVXIoTjVWyuQL5uN0unQ.png" /></figure><p>In the next parts, we will dive into more intricate functionality using Flask and also introduce UI components. Watch this space for future articles.</p><p>References:</p><ul><li>Flask by Example: <a href="https://realpython.com/flask-by-example-part-1-project-setup/">https://realpython.com/flask-by-example-part-1-project-setup/</a></li><li>Flask Web Development Tutorial #1: Installation and Setup on Windows: <a href="https://youtu.be/4mrq8PYQ0Zg">https://youtu.be/4mrq8PYQ0Zg</a></li></ul><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=981a319bbe05" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>