<?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: gupta-niharika</title>
    <description>The latest articles on DEV Community by gupta-niharika (@guptaniharika).</description>
    <link>https://dev.to/guptaniharika</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%2F315866%2F0c51cad8-48e7-40cc-a1c6-6d907476a952.png</url>
      <title>DEV Community: gupta-niharika</title>
      <link>https://dev.to/guptaniharika</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/guptaniharika"/>
    <language>en</language>
    <item>
      <title>Deploying Flask app on Heroku using GitHub</title>
      <dc:creator>gupta-niharika</dc:creator>
      <pubDate>Wed, 21 Oct 2020 18:00:47 +0000</pubDate>
      <link>https://dev.to/guptaniharika/deploying-flask-app-on-heroku-using-github-50nh</link>
      <guid>https://dev.to/guptaniharika/deploying-flask-app-on-heroku-using-github-50nh</guid>
      <description>&lt;p&gt;Flask is a micro web framework written in Python meant for easy and quick development of web apps. It can be used to create small web apps and is easy to use. It is meant for server side scripting and uses the Jinja2 templating engine for rendering web pages.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;Deploying Flask web apps on Heroku can be quite a tricky task, especially when the official docs are outdated. On Heroku, when it comes to deploying web apps written with Flask, it requires you to download the Heroku CLI and then proceed further. Well, there's another way to do it as well and that is by installing dependencies on the go and deploying the Flask app by connecting the GitHub repository to your Heroku app. &lt;br&gt;&lt;br&gt;
Here, is a sure short way of successfully deploying a web app on Heroku.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Steps to deploy a new app
&lt;/h1&gt;

&lt;p&gt;1) Create a &lt;a href="https://github.com/new" rel="noopener noreferrer"&gt;new&lt;/a&gt; repository and add a .gitignore file for Python under the drop down menu while creating it&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft9n61t6t1n7o1i35a7gr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ft9n61t6t1n7o1i35a7gr.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To add the .gitignore file to a pre-existing repository, go to the repository settings and add it.&lt;/p&gt;
&lt;/blockquote&gt;



&lt;p&gt;&lt;br&gt;&lt;br&gt;
2) Copy the link to the repository&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxkt5ab9be5e3qlyk6sqo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxkt5ab9be5e3qlyk6sqo.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) In the IDE clone the repository. I've used &lt;a href="https://www.jetbrains.com/pycharm/download/#section=windows" rel="noopener noreferrer"&gt;PyCharm&lt;/a&gt; where I have cloned my GitHub repository using 'Get from Version Control' option in PyCharm. It helps you to create a new folder and save your code here so it will be easy to commit and push any changes in the code to your GitHub&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feq48n85ll8njs4gaynm9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feq48n85ll8njs4gaynm9.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;4) Now move all the existing code to the new folder you just created or simply create a new file and write your code. This folder also contains the .gitignore file &lt;br&gt; &lt;br&gt;&lt;/p&gt;

&lt;p&gt;5) Now create a virtual environment using &lt;code&gt;python -m venv env&lt;/code&gt; in the folder where you want to keep the project. Activate it using &lt;code&gt;env\Scripts\activate&lt;/code&gt;. &lt;br&gt; If you're on mac use &lt;code&gt;source venv/bin/activate&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F87ojq5yg5drhm8skxoeq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F87ojq5yg5drhm8skxoeq.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;6) Install all the needed dependencies, including gunicorn which is a WSGI HTTP server, using &lt;code&gt;pip install gunicorn&lt;/code&gt; and test your app locally, in the virtual environment you created &lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;7) Now create the requirements file by typing this command in the terminal &lt;code&gt;pip freeze &amp;gt; requirements.txt&lt;/code&gt;. This file contains all the dependencies you installed to run this app&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F37gjctjaf2qcvsmux2lw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F37gjctjaf2qcvsmux2lw.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;8) Now create a new file, name it Procfile and type &lt;code&gt;web: gunicorn --bind 0.0.0.0:$PORT app:app&lt;/code&gt;. Here app will be your app (main file) name &lt;br&gt;&lt;br&gt;
A Procfile is a text file (named Procfile) placed in the root of your app that lists the process types in the app. Heroku apps include a Procfile that specifies the commands that are executed by the app on startup. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa2hcgkypqp1caagh4hbx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa2hcgkypqp1caagh4hbx.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;9)Commit the changes and push the files to your GitHub repository &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn0wmclzgmqh4ctfjhl9e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn0wmclzgmqh4ctfjhl9e.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;10) Now got to &lt;a href="https://dashboard.heroku.com/new-app" rel="noopener noreferrer"&gt;Heroku&lt;/a&gt;, login and create a new app &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1lmyeu73htawqd3rr9i5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1lmyeu73htawqd3rr9i5.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;11) Set the mode of deployment as GitHub and connect it to your GitHub repository.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb0cnaxocoh8qww672sbo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb0cnaxocoh8qww672sbo.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;12) Choose the option for automatic deploys. This enables your code to be automatically deployed every time you make changes on the selected branch. Hit deploy and watch the magic&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fltkf4a1inzhqn1vz8p8c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fltkf4a1inzhqn1vz8p8c.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpygk2zeslef0i7odcgrh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpygk2zeslef0i7odcgrh.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;13) Click on 'View' to view your deployed app&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1599063787825%2FmaI9r-nXV.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1599063787825%2FmaI9r-nXV.jpeg" alt="Clipboard (10).jpg"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
You can now be able to access the active deployment under the Environments section of your GitHub repository &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fahiz7gpwrmwavjjqui0c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fahiz7gpwrmwavjjqui0c.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
And that’s the easiest way of deploying a Flask app on Heroku by connecting it to your GitHub repository! :)&lt;/p&gt;

</description>
      <category>github</category>
      <category>heroku</category>
      <category>python</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Mailing bot with Python</title>
      <dc:creator>gupta-niharika</dc:creator>
      <pubDate>Fri, 15 May 2020 13:27:35 +0000</pubDate>
      <link>https://dev.to/guptaniharika/til-mailing-bot-with-python-1a8l</link>
      <guid>https://dev.to/guptaniharika/til-mailing-bot-with-python-1a8l</guid>
      <description>&lt;p&gt;Bots are a really cool way to automate boring tasks. To finish this chore i wished to code a mailer bot and i finally succeeded using the Flask-mail library in python. &lt;/p&gt;

&lt;p&gt;I started out by referring to the most commonly available codes for this task, however, the official documentation of the Flask-mail extension did not help me at all. It was just extra. I did refer multiple Youtube tutorials and stumbled upon codes that were perfect... well, almost.&lt;/p&gt;

&lt;p&gt;Here's the thing though, SMTP authentication errors are not easy to rectify. What with the TSL AND SSL ports and their never ending expectations, it made me almost want to give up on this task. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d_ZXj5EV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1589541799829/bTSwrTObE.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d_ZXj5EV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1589541799829/bTSwrTObE.png" alt="OnPaste.20200515-165300.png" width="561" height="117"&gt;&lt;/a&gt;&lt;br&gt;
This kept showing up on my window and it got frustrating to work with.&lt;/p&gt;

&lt;p&gt;After spending hours staring at the screen, wondering what was wrong and searching for all possible error solutions online i stumbled upon a particular setting that had been from my mail host that had been turned off. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZM0-_2IJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1589542290979/klmNG32SQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZM0-_2IJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1589542290979/klmNG32SQ.png" alt="OnPaste.20200515-170118.png" width="529" height="153"&gt;&lt;/a&gt;&lt;br&gt;
Such a small thing, and i wasted so much time figuring it out. &lt;br&gt;
The secret to my success lay not in my code but in the settings of my account! Even after changing the settings, my code, which i had picked up online, wasn't working as expected. I altered and made changes wherever i needed to and fixed it, pronto, and voila! &lt;/p&gt;

&lt;p&gt;My mailer can send mails to as many people as you want, as many times as you'd like it to, (well, of course it's a spam bot ;) ) albeit it is being used as an invitation list tracker. &lt;/p&gt;

&lt;p&gt;Here's the key part of the source code. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Importing the right libraries
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import smtplib, ssl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Setting the right port, according to the mail server you use
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;port = 465
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Use the updated version of functions, which are currently supported
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;context = ssl.create_default_context()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Head over to my github repository for the whole code. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/gupta-niharika/Mailer"&gt;https://github.com/gupta-niharika/Mailer&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that's what i learnt today, that these codes online, may or may not work, but if you code with a purpose, there's nothing that can stop you from doing your tasks satisfactorily.&lt;/p&gt;

</description>
      <category>python</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Flask - A Quick Guide</title>
      <dc:creator>gupta-niharika</dc:creator>
      <pubDate>Thu, 14 May 2020 06:13:57 +0000</pubDate>
      <link>https://dev.to/guptaniharika/flask-a-quick-guide-4lfp</link>
      <guid>https://dev.to/guptaniharika/flask-a-quick-guide-4lfp</guid>
      <description>&lt;p&gt;Hey there developers! How's your day going? :) &lt;/p&gt;

&lt;p&gt;This post is for those who want to create a basic Flask app pronto !&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Flask?
&lt;/h2&gt;

&lt;p&gt;Flask is a micro web framework written in Python meant for easy and quick development of web apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick - Launch
&lt;/h2&gt;

&lt;p&gt;The official documentation is always necessary, however it may not be handy when you have the deadline ticking over your head. You could be having cool ideas yet be unsure of how to go about them, and knowledge of other frameworks would only add to the confusion. This could get frustrating.&lt;/p&gt;

&lt;p&gt;So, how could you quickly skip the basic setup and jump into the main section to start modeling your ideas? &lt;/p&gt;

&lt;h2&gt;
  
  
  Starting your Flask App
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Make sure you have python and a good code editor installed on your laptop which would be the base of our construct.
&lt;/li&gt;
&lt;li&gt;Now, navigate to the project directory, either from your files or from Command Prompt. &lt;/li&gt;
&lt;li&gt;Create a virtual environment where you can work on this project independently, without worrying about the quirks of other projects with:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;py -m venv env 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where env is the name of the environment. You could change its name if you &lt;br&gt;
  want.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Activate the environment with:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;env\Scripts\activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Install flask in this environment with:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;To install a specific version of flask, simply mention it :
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install flask==0.6.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;In case you get a pip warning, you might have to upgrade pip :
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python -m pip install --upgrade pip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I always upgrade pip when I install flask for my projects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In your text editor,  simply copy-paste the following code and save the file as app.py
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello():
    return 'Hello World!'

if __name__ == '__main__':
    app.run()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Now in the terminal, set the environment variable for your app and you are good to go !
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set FLASK_APP = app.py
flask run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Alternatively, you could run it directly by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that we have our localhost running, with the following message expected to show up on the terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* Debugger is active!
* Debugger PIN: XXX-XXX-XXX
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila ! And there you go, with your basic flask app ready to be exploited for your game. &lt;/p&gt;

</description>
      <category>python</category>
      <category>mlh</category>
      <category>majorleaguehacking</category>
      <category>localhackday</category>
    </item>
  </channel>
</rss>
