<?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: Wilfred Chukwu</title>
    <description>The latest articles on DEV Community by Wilfred Chukwu (@fredcode).</description>
    <link>https://dev.to/fredcode</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%2F209754%2F13ca670d-8e48-4869-b871-d505b2f12110.jpeg</url>
      <title>DEV Community: Wilfred Chukwu</title>
      <link>https://dev.to/fredcode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fredcode"/>
    <language>en</language>
    <item>
      <title>Easy Steps to Deploy a Python Flask app on Heroku</title>
      <dc:creator>Wilfred Chukwu</dc:creator>
      <pubDate>Mon, 24 Aug 2020 21:24:43 +0000</pubDate>
      <link>https://dev.to/fredcode/easy-steps-to-deploy-a-python-flask-app-on-heroku-3o24</link>
      <guid>https://dev.to/fredcode/easy-steps-to-deploy-a-python-flask-app-on-heroku-3o24</guid>
      <description>&lt;p&gt;I had issues the first time i wanted to deploy my flask app to heroku and i remember vividly searching for articles and youtube tutorials on how to host wep apps with heroku i wasted a lot of time on something rather simple to follow. so i am writing this this article to help ease your way to deployment of wep apps in heroku.&lt;/p&gt;

&lt;p&gt;Before reading this article i already assume that you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a free Heroku account.&lt;/li&gt;
&lt;li&gt;Python installed&lt;/li&gt;
&lt;li&gt;your project(codes) ready to be deployed &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Heroku CLI Set up
&lt;/h2&gt;

&lt;p&gt;In this step you need to install the Heroku Command Line Interface (CLI). You use the CLI to manage and scale your applications,view your application logs, and run your application locally.&lt;br&gt;
&lt;em&gt;vist heroku.com to download your operating system's cli&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once installed run this command line in the terminal&lt;/p&gt;

&lt;p&gt;&lt;em&gt;heroku login&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;you will be prompt to login for authentication&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparing the app
&lt;/h2&gt;

&lt;p&gt;if the app is on github clone the application so that you have a local version of the code but if its already in your local machine in the terminal run&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cd yourproject/app folder name&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;if cloned from github after the first command then run:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;pip install -r requirements.txt&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Note: if you are using your own application, make sure you have added a requirements.txt file by running &lt;/p&gt;

&lt;p&gt;&lt;em&gt;pip freeze &amp;gt; requirements.txt&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;so that all the application dependencies are added.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add gunicorn and Procfile
&lt;/h2&gt;

&lt;p&gt;run&lt;/p&gt;

&lt;p&gt;&lt;em&gt;pip install gunicorn&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;update requirements.txt by running&lt;/p&gt;

&lt;p&gt;&lt;em&gt;pip freeze &amp;gt; requirements.txt&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now create a new file Procfile as name in the project folder&lt;br&gt;
&lt;em&gt;note: (P) must be uppercase&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;in Procfile add &lt;/p&gt;

&lt;p&gt;&lt;em&gt;web: gunicorn app:app&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;note:The first app represents the name of the python file that runs your application or the name of the module it is in. The second app represents your app name. For example if your application runs from a run.py file that looks like this:&lt;br&gt;
run:app&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Runtime.txt
&lt;/h2&gt;

&lt;p&gt;create runtime.txt&lt;br&gt;
and Add this in runtime&lt;/p&gt;

&lt;p&gt;&lt;em&gt;python-3.7.2 or the current python version you used for the app&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment
&lt;/h2&gt;

&lt;p&gt;In the application folder run&lt;/p&gt;

&lt;p&gt;&lt;em&gt;heroku create appname of your choice&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;config database through heroku site and connect&lt;br&gt;
then in the terminal run&lt;/p&gt;

&lt;p&gt;&lt;em&gt;heroku git:remote -a appname of your choice&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git push heroku master&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;wait... after its done &lt;br&gt;
to view your web app run&lt;/p&gt;

&lt;p&gt;&lt;em&gt;heroku open&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;wolah!! you have successfully deployed your app.&lt;/p&gt;

&lt;p&gt;related articles&lt;br&gt;
&lt;a href="https://devcenter.heroku.com/articles/getting-started-with-python"&gt;https://devcenter.heroku.com/articles/getting-started-with-python&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/the-andela-way/deploying-a-python-flask-app-to-heroku-41250bda27d0"&gt;https://medium.com/the-andela-way/deploying-a-python-flask-app-to-heroku-41250bda27d0&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Some of the most common operators used in filter() method SQLAlchemy</title>
      <dc:creator>Wilfred Chukwu</dc:creator>
      <pubDate>Sun, 16 Aug 2020 07:57:24 +0000</pubDate>
      <link>https://dev.to/fredcode/some-of-the-most-common-operators-used-in-filter-method-sqlalchemy-3eoc</link>
      <guid>https://dev.to/fredcode/some-of-the-most-common-operators-used-in-filter-method-sqlalchemy-3eoc</guid>
      <description>&lt;p&gt;SQLAlchemy query with OR/AND/like common filters&lt;br&gt;
Some of the most common operators used in filter() method SQLAlchemy&lt;/p&gt;

&lt;p&gt;equals:&lt;br&gt;
query.filter(User.name == 'leela')&lt;br&gt;
not equals:&lt;br&gt;
query.filter(User.name != 'leela')&lt;br&gt;
LIKE:&lt;br&gt;
query.filter(User.name.like('%leela%'))&lt;br&gt;
IN:&lt;br&gt;
query.filter(User.name.in_(['leela', 'akshay', 'santanu']))&lt;/p&gt;

&lt;h1&gt;
  
  
  works with query objects too:
&lt;/h1&gt;

&lt;p&gt;query.filter(User.name.in_(session.query(User.name).filter(User.name.like('%santanu%'))))&lt;br&gt;
NOT IN:&lt;br&gt;
query.filter(~User.name.in_(['lee', 'sonal', 'akshay']))&lt;br&gt;
IS NULL:&lt;br&gt;
filter(User.name == None)&lt;br&gt;
IS NOT NULL:&lt;br&gt;
filter(User.name != None)&lt;br&gt;
AND:&lt;br&gt;
from sqlalchemy import and_&lt;br&gt;
filter(and_(User.name == 'leela', User.fullname == 'leela dharan'))&lt;/p&gt;

&lt;h1&gt;
  
  
  or, default without and_ method comma separated list of conditions are AND
&lt;/h1&gt;

&lt;p&gt;filter(User.name == 'leela', User.fullname == 'leela dharan')&lt;/p&gt;

&lt;h1&gt;
  
  
  or call filter()/filter_by() multiple times
&lt;/h1&gt;

&lt;p&gt;filter(User.name == 'leela').filter(User.fullname == 'leela dharan')&lt;br&gt;
OR:&lt;br&gt;
from sqlalchemy import or_&lt;br&gt;
filter(or_(User.name == 'leela', User.name == 'akshay'))&lt;br&gt;
match:&lt;br&gt;
query.filter(User.name.match('leela'))&lt;/p&gt;

</description>
      <category>sql</category>
      <category>postgres</category>
      <category>database</category>
      <category>python</category>
    </item>
    <item>
      <title>How i escaped Tutorial Hell</title>
      <dc:creator>Wilfred Chukwu</dc:creator>
      <pubDate>Thu, 25 Jun 2020 05:51:32 +0000</pubDate>
      <link>https://dev.to/fredcode/how-i-escaped-tutorial-hell-5af</link>
      <guid>https://dev.to/fredcode/how-i-escaped-tutorial-hell-5af</guid>
      <description>&lt;p&gt;"when will i be ready","oh i should learn this other language", "i need to learn everything about this language","i am not ready", "i'm done with this tutorial , i think i should watch another tutorial again", "Ahh!! i need to be perfect", "bookmarks 10 other tutorial to buy or watch again after successfully completing the first one", "i need to learn 7 different different tutorials on one language" etc... &lt;br&gt;
If you are having more or even all of the thoughts above i'm sorry to inform you that you are in the tutorial hell&lt;/p&gt;

&lt;p&gt;Hey don't beat yourself up most of us has been there even the very best of us. Most of this thoughts are because of insecurities and self-doubts but the good news is like every problem there is a solution. so id like to help you escape the tutorial hell with these some ways i personally used when i was once stuck there.&lt;br&gt;
&lt;em&gt;(nb- this results and advice are based on my personal opinion and experience)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7tzi8vvc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ab6wyozo4bqbhynbz6rq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7tzi8vvc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ab6wyozo4bqbhynbz6rq.jpg" alt="image" width="300" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Tutorial Hell ?
&lt;/h1&gt;

&lt;p&gt;It’s a place where you keep doing the same thing over and over again without any guidance on how to break free from this cycle.&lt;/p&gt;

&lt;p&gt;Completing tutorials make you feel great and it’s quite addictive to go and try to complete as many as possible. But when you try to do something similar without the guidance of the tutorial you will probably get stuck and won’t be able to keep going.&lt;/p&gt;

&lt;p&gt;As a result, you decide to go out and follow another tutorial.&lt;br&gt;
&lt;a href="https://theflying.dev/posts/tutorial-hell"&gt;Definition credits:&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  why and How i got stuck in Tutorial Hell
&lt;/h2&gt;

&lt;p&gt;I just finished &lt;a href="https://www.edx.org/course/cs50s-introduction-to-computer-science"&gt;Harvard's cs50 introduction to Computer science&lt;/a&gt; and got exposed to the possibilities of programming. i felt like i could create anything i want and was eager to start the journey of learning new things. i got some new web development tutorials online.&lt;/p&gt;

&lt;p&gt;I was learning by watching videos and following along, so I spent a few months doing just that watching videos, rewriting the code  and trying to get the same results. it felt great and enjoyed the process because Tutorials are risk-free i would literally follow the instructor code by code&lt;/p&gt;

&lt;p&gt;But the issue was when I wanted to change the code to do something else or try to add a new feature Most of the times the changes that I added either broke the whole thing or didn’t do as I expected. that's when the famous impostor syndrome comes to mind too. The fear of being exposed as a fraud makes me keep doing tutorials until i felt  "i'm ready"&lt;/p&gt;

&lt;p&gt;When things didn’t work as i wanted I just ignore it and say to myself that I just needed to learn more. And off I went into another tutorial.&lt;/p&gt;

&lt;h1&gt;
  
  
  Escaping From Hell
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a9m9X6Ra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d39ntwc1rwudlyu3r0bu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a9m9X6Ra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d39ntwc1rwudlyu3r0bu.jpg" alt="Alt Text" width="860" height="390"&gt;&lt;/a&gt;&lt;br&gt;
This is the most import part of my journey to breaking free from tutorial hell because this is exactly want i did to escape&lt;br&gt;
&lt;em&gt;nb-"There is nothing wrong with using tutorials to learn new things. You just need to stop that urge of starting a new tutorial as soon as you finish the one you were working on"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build Personal Projects&lt;/strong&gt;&lt;br&gt;
When you complete a tutorial, try to recreate the same code using only your memory or build a similar project but your style and feature. you will probably get stuck and when you do, this is where you learn how to google or ask stackoverflow/reddit for solutions to help fix your code&lt;br&gt;
or might have to refer back to watch the tutorial again to firmly understand the concept By doing this, you will start understanding how the code falls into place and what sort of things you should practice more you will quickly learn how to work with a codebase and figure out what sort of things you might need to refactor and delete.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Coding Challenge&lt;/strong&gt;&lt;br&gt;
when you complete a tutorial on a given subject you should test yourself and see if you really understood the concept by doing coding challenges and test. some website i'm using are &lt;br&gt;
&lt;a href="https://www.codewars.com/"&gt;code wars&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.freecodecamp.org/"&gt;freecodecamp&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.hackerrank.com/"&gt;hackerrank&lt;/a&gt;&lt;br&gt;
coding challenges enhances your problem-solving skills which is a valuable skill every programmer needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read other peoples code and contribute to open source&lt;/strong&gt;&lt;br&gt;
The open source community provides a great opportunity for aspiring programmers to distinguish themselves and by contributing to various projects, you can improve your skills and get inspiration and support from like-minded people. But most importantly, you can prove that you can build fantastic experiences that people love.&lt;br&gt;
By doing this it will expose you to different styles of solving problems and it will enhance your knowledge of coding rather sitting all day going through a tutorial and not actually doing anything with what you learned.&lt;/p&gt;

&lt;p&gt;follow this steps and you might fully escape tutorial hell just like i did but if you don't and need further in depth details check my recommended list below&lt;/p&gt;

&lt;p&gt;Personal recommendations to read or watch more contents about escaping tutorial hell:&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=g_aMpyMvQ9k"&gt;Escape Tutorial Hell &amp;amp; Utilize Them In A Better Way&lt;/a&gt;&lt;br&gt;
&lt;a href="https://theflying.dev/posts/tutorial-hell"&gt;Tutorial Hell&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/davidmm1707/how-to-escape-from-tutorial-hell-and-never-come-back-bb6"&gt;how to escape from Tutorial Hell and never come back&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if you have more steps/advice and questions please engage at the comment section.&lt;br&gt;
thanks for reading!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How i learned flask in one week by building</title>
      <dc:creator>Wilfred Chukwu</dc:creator>
      <pubDate>Mon, 14 Oct 2019 15:32:29 +0000</pubDate>
      <link>https://dev.to/fredcode/how-i-learned-flask-in-one-week-by-building-1989</link>
      <guid>https://dev.to/fredcode/how-i-learned-flask-in-one-week-by-building-1989</guid>
      <description>&lt;p&gt;lets be honest here it actually takes more than one week to actually master flask but in one week its actually possible to grasp the basics and get things running up in flask, as they say all you have to do is get started "Action"&lt;br&gt;
so im going to be laying out how i wrote my first webapp in flask and also got comfortable with flask basics ps-i am still learning flask.&lt;/p&gt;

&lt;p&gt;Day 1- i knew nothing about flask but i was already adapted to python so starting out wasn't that tough well i did what every millennial would do "Google" first i researched what flask documentations, flask limits, when and the best type of web app to use flask and if it was worth learning by day one i was already equipped with what flask was and the difference between flask and Django &lt;/p&gt;

&lt;p&gt;Day 2 &amp;amp; 3- Flask is a micro web framework&lt;br&gt;
now i knew what flask was i needed to know how it works, rules and syntax in the library but the way i learn is this first i look through what i want to learn scope through it then come back and learn it piece by piece. through google i found cs50 flask lecture &lt;a href="https://www.youtube.com/watch?v=j5wysXqaIV8"&gt;https://www.youtube.com/watch?v=j5wysXqaIV8&lt;/a&gt; and Corey Schafer's youtube playlist on building a webblog with flask &lt;a href="https://www.youtube.com/playlist?list=PL-osiE80TeTs4UjLw5MM6OjgkjFeUxCYH"&gt;https://www.youtube.com/playlist?list=PL-osiE80TeTs4UjLw5MM6OjgkjFeUxCYH&lt;/a&gt;&lt;br&gt;
after spending hours watching and following their tutorials now i have got the push to write my first project in flask but i had to make a plan.&lt;/p&gt;

&lt;p&gt;Day 4 &amp;amp; 3 - Building with flask&lt;br&gt;
what other popular way to build a project in a new library than to start by building a todolist app. the objective of this app was to store activities you want to do daily and to delete or tick as done when you complete the activity&lt;br&gt;
building this todo app enabled me to learn how to use flask sqlachemy, templates, static files and how to connect my back-end to the front-end&lt;/p&gt;

&lt;p&gt;Day 5, 6 &amp;amp; 7 - Git push &lt;br&gt;
i have successfully built my first webapp with flask and at this point i dont feel like stopping, i feel like doing more making more mistakes and learning from it &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LuPTWDP1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7lz98o58yh9lyylppy1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LuPTWDP1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7lz98o58yh9lyylppy1w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
thats the overall view of the app , i know it looks basic but this is just for me to get started in flask and here is the github link for the source code &lt;a href="https://github.com/fredcodee/todolistapp"&gt;https://github.com/fredcodee/todolistapp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;for the beginners like me dont be afraid or give up easily all you have to do i start you dont have to be guru or whatever just know programming fundamentals and python syntax is all you need to get started dont let anyone tell you something else otherwise &lt;br&gt;
like i said im just getting started i plan on building more complicated programs in the future and will surely update you guys about it&lt;/p&gt;

</description>
      <category>python</category>
      <category>flask</category>
      <category>sql</category>
    </item>
    <item>
      <title>First blog post...</title>
      <dc:creator>Wilfred Chukwu</dc:creator>
      <pubDate>Thu, 15 Aug 2019 21:19:42 +0000</pubDate>
      <link>https://dev.to/fredcode/first-blog-post-3ebj</link>
      <guid>https://dev.to/fredcode/first-blog-post-3ebj</guid>
      <description>&lt;p&gt;Imagine entering a class for the first time and the instructor told you to come out, introduce yourself and tell the class about something you did recently with time lol 75% of you reading this will be intimidated, shy and uncomfortable while some of you might be confident. so as similar to this story i'm the new student and the instructor is dev.to while the classmates are you reading this right now and i hope am part of the small percentage of the confident ones &lt;br&gt;
       i'm Wilfred chukwu but you can call me fredcode. i am computer science student(almost done) but i'm really interested in web development and web scrapping. i'm currently living in the Philippines but i'm from Nigeria by birth&lt;/p&gt;

&lt;p&gt;1) WHY AM I HERE?&lt;br&gt;
      Actually i read dev.to,freecodecamp,hackernoon and techcrunch blogs regularly to get inspired and see the amazing impact of programming community&lt;br&gt;
so i decided to start my blog talk about my experiences, projects and journey as an aspiring web developer&lt;/p&gt;

&lt;p&gt;2) WHY DO I CODE OR EVEN BOTHER TO STRESS MY LIFE WITH BUGS?&lt;br&gt;
     i wrote my first code at the age of 17, obviously yes a "hello, world" program with C language and what really made me interested in coding was the possibility of building amazing stuffs to either impact people's lives or have just have fun with. when i log on the internet or my phone and see all this apps and software out there i always have this feeling of building my own software or app would be mind blowing.&lt;/p&gt;

&lt;p&gt;3) WHAT VALUE DO I PLAN ON GIVING YOU?&lt;br&gt;
      when i started to code as a beginner i would have loved to read blogs documenting how the owner built his/her projects and the struggles they had overcome to fix the bugs and also detailed information of what they learned or improved on while making their project.....  now thats exactly what i'm going to be doing. &lt;/p&gt;

&lt;p&gt;(referring back to the story at the beginning) thank you my fellow classmates for listening to me and i hope i was articulated and confident too.&lt;/p&gt;

</description>
      <category>introduction</category>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
