<?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: Felipe Martins</title>
    <description>The latest articles on DEV Community by Felipe Martins (@bielmartin).</description>
    <link>https://dev.to/bielmartin</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%2F826889%2Fd24ac3c8-477a-46fc-a615-fc0a6c7358c1.jpeg</url>
      <title>DEV Community: Felipe Martins</title>
      <link>https://dev.to/bielmartin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bielmartin"/>
    <language>en</language>
    <item>
      <title>Diary of a developer #1: Which way to go?</title>
      <dc:creator>Felipe Martins</dc:creator>
      <pubDate>Mon, 21 Mar 2022 16:20:05 +0000</pubDate>
      <link>https://dev.to/bielmartin/diary-of-a-developer-1-which-way-to-go-4p3l</link>
      <guid>https://dev.to/bielmartin/diary-of-a-developer-1-which-way-to-go-4p3l</guid>
      <description>&lt;p&gt;If you are just starting out in the development area, this post can help you get a sense of how to proceed, however, if you are already an experienced developer, it is worth sharing a little bit of the path you took taken.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cKVIV3Wc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dx7a8269banqw3cbzspp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cKVIV3Wc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dx7a8269banqw3cbzspp.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Initially, it is important that you set some goals of your own, &lt;strong&gt;analyze if this is really what you want&lt;/strong&gt;, sit all day in front of the computer, analyze demands and propose solutions on top of them, do &lt;strong&gt;not imagine that it will be easy&lt;/strong&gt;, but as all the effort is worth it if applied in the right way, when you pass through all these points &lt;strong&gt;you will be in a beautiful area full of possibilities and challenges&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Below I leave my opinion on what I consider an ideal path for a novice developer to follow, remembering that it is not a rule, but they are important steps for learning and in the search for your first job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9AO9EiDg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdx2p6uaydn831nnsqss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9AO9EiDg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdx2p6uaydn831nnsqss.png" alt="Image description" width="308" height="40"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's go for points. if you've never had contact with any programming language, don't worry, choose one calmly, always taking into account &lt;strong&gt;your way of coding&lt;/strong&gt;, &lt;strong&gt;level of complexity of the language for beginners&lt;/strong&gt;, &lt;strong&gt;the job market&lt;/strong&gt; and if you already know people who develop and who may give you a boost initially. &lt;strong&gt;But the reality is that it doesn't matter&lt;/strong&gt;, python, ruby, java, C#, each one has its peculiarities, but they all exist for common purposes, &lt;strong&gt;they are codes that tell the computer how to behave&lt;/strong&gt;, never forget that, the common computer is not intelligent to the point of being highly managed, virtually everything that exists has been coded previously.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Rop7lrHQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tp6pkf4h1y47ycs3nb4s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rop7lrHQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tp6pkf4h1y47ycs3nb4s.png" alt="Image description" width="880" height="712"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Assuming that you have already chosen the most attractive language, now it's time to run, every information you receive in this period is important, &lt;strong&gt;try to develop mini-projects&lt;/strong&gt;, calculators, calendars, all this will help even when setting up your portfolio, at the end of this article I will leave some links with projects for beginner developers.&lt;/p&gt;

&lt;p&gt;Most development positions follow a pattern, and something I can suggest is: &lt;strong&gt;Be pursuing a degree related to technology&lt;/strong&gt;. It's not a rule, but if you're in an academic environment, your chances of getting your first job go up a lot, be it even an internship.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jX70lmta--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/udddc8h056bu5g2a3atz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jX70lmta--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/udddc8h056bu5g2a3atz.png" alt="Image description" width="880" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Paths in development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Assuming you have some experience in your language, have already developed introductory projects and feel that you are ready for the next steps, then let's see some interesting technologies that add significantly to your curriculum. Below I will cite a few:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understand the &lt;strong&gt;IDE&lt;/strong&gt; you are using (I quote VS Code)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Git&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Search for a &lt;strong&gt;framework&lt;/strong&gt; related to your language and the Area you intend to follow&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Docker&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Understand what a &lt;strong&gt;stack&lt;/strong&gt; is&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now I will briefly detail each topic:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IDE&lt;/strong&gt; - The integrated development environment is a development tool for editing code, accessing a terminal, running a script, debugging and compiling using a single environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; - These control systems have the function of recording any changes made on top of a code, storing this information and allowing, if necessary, a programmer to revert to previous versions of an application in a simple and fast way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Framework&lt;/strong&gt; - In programming, a framework is a set of generic codes capable of uniting parts of a development project. It works like a puzzle piece capable of fitting in the most diverse places and connecting all the lines of code in an almost perfect way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker&lt;/strong&gt; - In short, we can say that Docker is an open platform, created with the aim of facilitating the development, deployment and execution of applications in isolated environments. It was specially designed to deliver an application as quickly as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stack&lt;/strong&gt; - In programming, stack is the name we give to the set of technologies that can be used to develop applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3hGuAOoG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7cukt67pmabsk63mwbln.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3hGuAOoG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7cukt67pmabsk63mwbln.gif" alt="Image description" width="500" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the end of this article I will leave all the references so that you can study and better understand each technology. This was the learning line that I used in my learning flow, of course each language, framework and stack has its particularities, but understanding the concept makes everything easier.&lt;/p&gt;

&lt;p&gt;Thank you for reading and I hope I have helped you in the best way. As a bonus I can tell you, if this is your dream, don't give up, you have the ability, the most important thing is to never give up.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.tiagogouvea.com.br/profissional/projetos-reais-aprender-programacao/"&gt;https://www.tiagogouvea.com.br/profissional/projetos-reais-aprender-programacao/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.alura.com.br/artigos/o-que-e-uma-ide"&gt;https://www.alura.com.br/artigos/o-que-e-uma-ide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.atlassian.com/br/git/tutorials/what-is-git"&gt;https://www.atlassian.com/br/git/tutorials/what-is-git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lewagon.com/pt-BR/blog/o-que-e-framework"&gt;https://www.lewagon.com/pt-BR/blog/o-que-e-framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stack.desenvolvedor.expert/appendix/docker/oquee.html"&gt;https://stack.desenvolvedor.expert/appendix/docker/oquee.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kenzie.com.br/blog/full-stack-o-que-e/"&gt;https://kenzie.com.br/blog/full-stack-o-que-e/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>"weasyprint" pdf generator using HTML - in django</title>
      <dc:creator>Felipe Martins</dc:creator>
      <pubDate>Sun, 20 Mar 2022 17:46:36 +0000</pubDate>
      <link>https://dev.to/bielmartin/weasyprint-pdf-generator-using-html-in-django-2lij</link>
      <guid>https://dev.to/bielmartin/weasyprint-pdf-generator-using-html-in-django-2lij</guid>
      <description>&lt;p&gt;&lt;strong&gt;Why use weasyprint?&lt;/strong&gt;&lt;br&gt;
Easy to use. Without a doubt, weasyprint is one of the easiest libraries to use when it comes to pdf generators.&lt;br&gt;
Quick request. because of its simplicity, this library tends to convert HTML to pdf very quickly. (it varies depending on the tools you use in HTML, if you need to make many requests through links, there tends to be a longer conversion time)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When not to use weasyprint?&lt;/strong&gt;&lt;br&gt;
As I had said above, due to the simplicity of the library, newer styling features may not work properly, an example would be &lt;em&gt;flexbox&lt;/em&gt; as well as JS cannot be used in this generator either.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3-RWCzGB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m4d0hg905id5336ktntm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3-RWCzGB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m4d0hg905id5336ktntm.png" alt="Image description" width="288" height="18"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As in the title of this article, I will explain how to make a function to generate a pdf file from HTML, so let's start from the beginning.&lt;/p&gt;

&lt;p&gt;First we need to go to the &lt;strong&gt;&lt;em&gt;requirements.txt&lt;/em&gt;&lt;/strong&gt; file and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;weasyprint==53.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;If&lt;/strong&gt; your project is &lt;em&gt;Dockerized&lt;/em&gt; and linux is &lt;em&gt;alpine&lt;/em&gt;, I recommend that you have the following lines of code in your &lt;strong&gt;&lt;em&gt;Dockerfile&lt;/em&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RUN apk add --no-cache jpeg-dev zlib-dev git gcc musl-dev python3-dev postgresql-dev
RUN apk add py3-pip py3-pillow py3-cffi py3-brotli gcc musl-dev python3-dev pango
RUN apk add py3-pip gcc musl-dev python3-dev pango zlib-dev jpeg-dev openjpeg-dev g++ libffi-dev
RUN apk add --no-cache --virtual .build-deps build-base linux-headers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now inside the file that we are going to create the function we will have to make the following imports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# to get the current date and time
import datetime
# library import
from weasyprint import HTML
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can create our function containing the logic for our converter. Below is an example of how the function should be constructed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def export_pdf(request, queryset):
    response = HttpResponse(content_type='aplication/pdf')
    response['Content-Disposition'] = 'attachment; filename=Expense' + \
        str(datetime.datetime.now())+'.pdf'
    response['Content-Transfer-Encoding'] = 'binary'

    query = Query.objects.get(pk=1) #your query with the database object information

    html_string = render_to_string(
        'pdf_template.html',{'templates': query,'total': 0})
    html = HTML(string=html_string) # .html file route

    result = html.write_pdf()

    with tempfile.NamedTemporaryFile(delete=True) as output:
        output.write(result)
        output.flush()

        output = open(output.name, 'rb')
        response.write(output.read())

    return response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the function ready we can create our HTML file that will be converted. It's up to you where it will be created, the most appropriate thing is to create it inside the template folder inside the app. In the current case, the name of the created file was &lt;strong&gt;pdf_template.html&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T7anD9yg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqooomi36188e030zlfn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T7anD9yg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqooomi36188e030zlfn.png" alt="Image description" width="300" height="120"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;To handle the information in your html file, weasyprint accepts resources like jinja to handle your queries.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://weasyprint.org/"&gt;https://weasyprint.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jinja.palletsprojects.com/en/3.0.x/"&gt;https://jinja.palletsprojects.com/en/3.0.x/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Diary of a developer #0: why development?</title>
      <dc:creator>Felipe Martins</dc:creator>
      <pubDate>Sat, 19 Mar 2022 17:41:41 +0000</pubDate>
      <link>https://dev.to/bielmartin/diary-of-a-developer-0-a-developer-4bha</link>
      <guid>https://dev.to/bielmartin/diary-of-a-developer-0-a-developer-4bha</guid>
      <description>&lt;p&gt;This is a more relaxed post, a presentation for you to know a little about my work and my experiences before my posts, so let's go.&lt;/p&gt;

&lt;p&gt;Not unlike you, I'm a technology lover and since I was 12 I've been working on hardware, luckily there was an electronic waste right next to my house so I don't even need to explain the rest.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S6QfIQcg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51kl5ek7hzg3xtukskth.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S6QfIQcg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51kl5ek7hzg3xtukskth.gif" alt="Image description" width="640" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few years later I ended up moving to another area, still within information technology, the development area. Years of working with hardware made me wonder how combinations of 0 and 1 could transmit information across components, when I realized I was studying binaries, then decimals and so on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JD0hRoW4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3x2eheacdphodm7iaz41.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JD0hRoW4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3x2eheacdphodm7iaz41.jpeg" alt="Image description" width="880" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My first language of study was python, which I even have a special affection for, but everything seemed very complex to me, it was really a new world that every day reveals itself more complex, there is no unique way of programming, despite being part of From an exact science, the way a developer can approach a challenge varies according to their knowledge, time, techniques that are acquired over time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K4D3Z0lH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjivq6gcjk2jmgy48vrg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K4D3Z0lH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjivq6gcjk2jmgy48vrg.png" alt="Image description" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I don't want to linger, I think I gave a good introduction and just like the indices of an array, this is article number #0. In the next few days I will be posting some content that I have already reserved some curiosities, debates, and a little of the day to day of a programmer who seeks to improve his knowledge in his stack.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
