Recent Flask Posts from Tech Monger :///feeds/flask/ 2019-06-14T13:54:00.029529Z Werkzeug Script to Recover Web Application After Crash https://techmonger.github.io/73/crash-auto-restart 2019-06-14T13:54:00.029529Z 2019-06-10T11:20:17.800411Z Tech Monger <p class="lead"> So you have web application running in production but it goes down unexpectedly and you get midnight calls to take up application. In this post we will build simple script that will recover web application after server crash due to over resource utilization. Custom Validation Messages with WTForms https://techmonger.github.io/64/wtf-custom-validation-hack 2018-11-11T09:18:28.423182Z 2018-11-11T07:56:08.911691Z Tech Monger <p class="lead"> While using WTF or Flask-WTF for the form validation you would often find yourself adding custom validation messages according to the requirement of your web application. You can always use WTF's <code>ValidationError</code> API however in this tutorial we will show you clever hack to add validation messages during page rendering. We will show <a href="#example">example code</a> with <a href="/tag/flask" title="Flask Tutorials">flask</a> but you can use this method with any other framework which is using WTF for form validation. Flask Basic Access Authentication https://techmonger.github.io/42/flask-basic-auth 2018-08-10T04:35:26.912615Z 2018-08-08T18:23:23.061924Z Tech Monger <p class="lead"> If you are writing simple and minimalist web application or api using Python and Flask which requires user login without database then you can use HTTP Basic Authentication to authorize user login. This authentication is part of HTTP protocol <code>RFC 7617</code> and does not require session or cookies for implementation. Client implementation is supported by browsers hence you need not write client side code like html, css and javascript. In this tutorial we will learn how to implement server side code in flask from scratch without using plugin or existing libraries. Also it is <em>strongly advised</em> to understand theory of <a href="/41/basic-access-auth/" title="Basic Authentication with HTTP">How Basic Access Authentication Works</a> before we dive into <a href="#example" title="Flask Basic Auth Example Code">code</a>. Email Functionality in Flask without Mail Server https://techmonger.github.io/26/flask-mailgun 2018-08-07T19:05:22.466132Z 2018-02-04T14:57:04.944782Z Tech Monger <p class="lead"> Often web application needs to implement mail features for user verification, notification or to implement as trivial functionality as contact form. If your web host does not provide mail server then you can use external solution like <code>mailgun</code> which provides push email functionality along with other useful features using <code>Rest API</code>. It also provides <mark>free 10, 000 emails per month</mark> before charging you for the service. Learn how you can implement this with python and flask. Previously we have built <a href="/5/python-flask-recaptcha/" title="Python Basic Contact Form with ReCaptcha">contact form with flask and ReCaptcha</a>. We will further develop contact form in this tutorial by adding email support. Python Customized ATOM Feeds Generator without Feed Services https://techmonger.github.io/25/flask-atom-feed 2018-08-07T19:05:07.964151Z 2018-01-27T11:35:50.698992Z Tech Monger <p class="lead"> If you have custom content management system written in python with direct control on your code then you can publish your blog feeds without using feed services like feedburner. With custom code you will also be able to generate feeds for specific tags on your blog. In this post we will generate feeds using python module called <code>werkzeug</code>. Host web site from Home without Static IP https://techmonger.github.io/22/rpi-web-app 2018-08-07T19:04:41.783407Z 2018-01-21T15:09:50.964577Z Tech Monger <p class="lead"> If you want to host web application from home computer or with raspberry pi then you can use free and open source software <a href="/20/httptunnel-working/" title="What is localtunnel and How it works">Localunnel</a>. Localtunnel is simple to use and works behind Network Address Translator (NAT) which means it does not require you to have Public IP. Nor it assumes you to have control over firewall configuration of router. In this tutorial we will demonstrate it by building simple python web application in <a href="/tag/flask/" title="Flask Tutorials">flask</a> and host it using Gunicorn. However if you have static website or dynamic web application running on Apache, NGNIX or Microsoft IIS locally then you can also follow along by directly jumping to the <a href="#expose" title="">exposing web app</a> section. Flask Simple User Login without Extension https://techmonger.github.io/10/flask-simple-authentication 2018-08-10T05:56:47.819696Z 2017-12-13T17:55:49.741545Z Tech Monger <p class="lead">In this tutorial we will learn how to build simple user authentication mechanism in Flask without using any login extensions. It's good idea to use existing extensions however if you want more control over how user session cookies are getting handled or if you are not sure about working of an existing extensions then you can quickly roll out your own code to build something very simple. We will make use of <em>Flask-SqlAlchemy </em>to read and write into the database.</p> Integrate ReCaptcha in Flask Web App without Plugin https://techmonger.github.io/5/python-flask-recaptcha 2018-08-07T19:02:07.836333Z 2017-11-26T18:04:53.643618Z Tech Monger <p class="lead">In this article we will learn to integrate Google ReCaptcha into flask web application without using any flask extension to prevent bots from submitting spam.</p> Secure Passwords in Python With Werkzeug https://techmonger.github.io/4/secure-passwords-werkzeug 2018-08-07T19:01:56.280012Z 2017-11-26T09:38:45.329075Z Tech Monger <p class="lead">In this article we will learn how to implement secure user authentication system using python <code>werkzeug</code>. We will store secure passwords with salted hashes and later we will verify entered user password in plaintext against it's password hash to authenticate user.</p> Python Flask Openshift Application Deployment https://techmonger.github.io/1/openshift-flask-app 2018-08-07T19:01:33.544212Z 2016-12-23T08:16:04.594379Z Tech Monger <p class="lead">In this tutorial we will learn deployment of flask application on openshift. I assume that you have some working knowledge of <em>openshift</em>, <em>python</em>, <em>flask</em> and <em>git</em>. </p>