<?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: Arno Pretorius</title>
    <description>The latest articles on DEV Community by Arno Pretorius (@arnopretorius).</description>
    <link>https://dev.to/arnopretorius</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%2F902276%2Feecf473f-826e-40e1-89fd-b0bf294bc507.jpg</url>
      <title>DEV Community: Arno Pretorius</title>
      <link>https://dev.to/arnopretorius</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arnopretorius"/>
    <language>en</language>
    <item>
      <title>My Final dev.to post!</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Tue, 22 Nov 2022 20:41:59 +0000</pubDate>
      <link>https://dev.to/arnopretorius/my-final-devto-post-3p5c</link>
      <guid>https://dev.to/arnopretorius/my-final-devto-post-3p5c</guid>
      <description>&lt;p&gt;I have decided to focus solely on maintaining my own site rather than depending on dev.to as a platform for technical blogging because of various reasons.&lt;/p&gt;

&lt;p&gt;It has been a pleasure writing here on dev.to, and it has proven to be an extremely valuable platform for sharing my knowledge on Django web development and AWS Cloud Computing.&lt;/p&gt;

&lt;p&gt;I will not remove the content already on dev.to.&lt;/p&gt;

&lt;p&gt;Thank you all for the support, it’s been a blast!&lt;/p&gt;

&lt;p&gt;Here we go! Goodbye dev.to!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;All of my future posts, will be available on my new blogging website below:&lt;/strong&gt;&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://www.cloudwithdjango.com/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudwithdjango.com%2Fcontent%2Fimages%2Fsize%2Fw1200%2F2024%2F09%2FALL-YouTube---Banners-1.png" height="450" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://www.cloudwithdjango.com/" rel="noopener noreferrer" class="c-link"&gt;
          Cloud With Django
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Cloud With Django: Your leading resource for mastering AWS cloud computing and Django web development. Access expert-led courses to advance your skills and career in cloud technology and Django. Discover insightful blog posts and book personalised consultations to help you reach your full potential in both Django and cloud computing. Unlock your future with Cloud With Django.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.cloudwithdjango.com%2Fcontent%2Fimages%2Fsize%2Fw256h256%2F2022%2F11%2FIMG1--1--3.png" width="256" height="256"&gt;
        cloudwithdjango.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>angular</category>
    </item>
    <item>
      <title>Django shorts: #5 Useful packages</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Tue, 08 Nov 2022 10:52:32 +0000</pubDate>
      <link>https://dev.to/arnopretorius/django-shorts-5-useful-packages-22dc</link>
      <guid>https://dev.to/arnopretorius/django-shorts-5-useful-packages-22dc</guid>
      <description>&lt;p&gt;&lt;strong&gt;Preface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Django is such a diverse and intricate back-end web framework. One of the best things that we can do with Django is that we can install various packages/apps. These packages and apps help to provide our application with additional out of the box functionality. &lt;/p&gt;




&lt;p&gt;.&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Package #1 - Django REST framework (DRF)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The DRF allows Django developers to build any HTTP-based RestAPI. DRF is applauded for providing developers with potent and flexible tools. It also comes with detailed documentation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/djangorestframework/"&gt;https://pypi.org/project/djangorestframework/&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Package #2 - Celery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Celery is a distributed task queue that can be used to assist Django web applications with multi-threading. In the process Celery also helps to offload work from our apps, since we can send tasks that are time intensive to Celery's task queue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/celery/"&gt;https://pypi.org/project/celery/&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Package #3 - Django channels&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Django channels provides WebSocket async support in Django. It is also highly customizable so it can be used for a variety of use cases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/channels/"&gt;https://pypi.org/project/channels/&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Package #4 - Django-environ&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Although, there are many packages that can be used to help us to configure environment variables within our Django applications. Django-environ is one of the simplest and most effective packages that allows us to do just that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/django-environ/"&gt;https://pypi.org/project/django-environ/&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Package #5 - Django-two-factor-auth&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of my favourite packages. The best part of this package is in the fact that you can configure two factor authentication in multiple ways, not just via a typical token generator.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/django-two-factor-auth/"&gt;https://pypi.org/project/django-two-factor-auth/&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Package #6 - Django-crispy-forms&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want to improve the styling of your user forms, then Django-crispy-forms is an absolute must use. It provides our users with a clean and pleasant form for our users to work with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/django-crispy-forms/"&gt;https://pypi.org/project/django-crispy-forms/&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Package #7 - Django-simple-captcha&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;User forms can be used by bots, therefore it's important to somehow verify that the user submitting the form is indeed a human. A good way to test this is to make use of a simple captcha. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/django-simple-captcha/"&gt;https://pypi.org/project/django-simple-captcha/&lt;/a&gt; &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;That's that! Happy learning!&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final note:&lt;/strong&gt;&lt;br&gt;
For those that are interested in learning more about Django. Feel free to check out my courses below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.cloudwithdjango.com/courses"&gt;Python Django courses&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>django</category>
    </item>
    <item>
      <title>Django shorts: #4 Sending emails</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Tue, 08 Nov 2022 10:00:23 +0000</pubDate>
      <link>https://dev.to/arnopretorius/django-shorts-4-sending-emails-b35</link>
      <guid>https://dev.to/arnopretorius/django-shorts-4-sending-emails-b35</guid>
      <description>&lt;p&gt;&lt;strong&gt;Preface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Django is such a diverse and intricate back-end web framework, that we can utilize it to do a great many things. One of these great things is to use it to send emails.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First of all you need to import the following at the top of your views.py file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.core.mail import send_mail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will allow you to make use of the send_mail function that is already imported with Django. Luckily, this comes built in with Django, so we don’t need to worry about installing any packages with pip.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next you need to simply create a normal view, such as mine below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def email_invoice(request)

    return render(request, 'email-invoice.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the next step, you will need to make use of the send_mail function in your chose view like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def email_invoice(request)

   send_mail('Subject heading here', 'Your main message here', 'from@example.com', ['to@example.com]', fail_silently=False,)

    return render(request, 'email-invoice.html')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s further analyze the send_mail function logic from above…&lt;/p&gt;

&lt;p&gt;send_mail(subject, message, who the email is from, who the email is to, the email will raise an exception if there is any problem)&lt;/p&gt;

&lt;p&gt;Please note the order of the parameters in the parentheses above (left to right):&lt;/p&gt;

&lt;p&gt;1 — Your subject heading&lt;/p&gt;

&lt;p&gt;2 — What is your message&lt;/p&gt;

&lt;p&gt;3 — Who is the email coming from&lt;/p&gt;

&lt;p&gt;4 — Who the email should be sent to&lt;/p&gt;

&lt;p&gt;5 — Raise an exception if there is any problem&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt;&lt;br&gt;
You will then need to make sure that you have configured the below configuration settings in your settings.py file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'me@gmail.com' # - Choose a host email to send from
EMAIL_HOST_PASSWORD = 'app password' # - Your app password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example I’m making use of the GMAIL smtp server. Of course, you can utilize something else such as Amazon SES for example. We also need to configure our email backend accordingly to SMTP.&lt;/p&gt;

&lt;p&gt;The default port will be port 587, this will differ according to various SMTP providers.&lt;/p&gt;

&lt;p&gt;We need to ensure that we use TLS to secure our mail communication.&lt;/p&gt;

&lt;p&gt;The email host user is from where we want the email’s to be send from by default.&lt;/p&gt;

&lt;p&gt;So in this example I want all my default notification emails and email invoices to be sent from a Gmail account.&lt;/p&gt;

&lt;p&gt;Since 2016 the option to turn on less secure apps has been disabled. So, now you will need to generate an APP password on your Gmail account, and use this as your email host password.&lt;/p&gt;

&lt;p&gt;And that’s it! Happy learning!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final note:&lt;/strong&gt;&lt;br&gt;
For those that are interested in learning more about Django. Feel free to check out my courses below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.cloudwithdjango.com/courses"&gt;Python Django courses&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>django</category>
    </item>
    <item>
      <title>Django shorts: #3 Crispy forms</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Sun, 16 Oct 2022 12:16:29 +0000</pubDate>
      <link>https://dev.to/arnopretorius/django-shorts-3-crispy-forms-2nel</link>
      <guid>https://dev.to/arnopretorius/django-shorts-3-crispy-forms-2nel</guid>
      <description>&lt;h2&gt;
  
  
  What are crispy forms?
&lt;/h2&gt;

&lt;p&gt;Crispy forms is a python package which we can implement within our Django web application. It is used to improve the quality and design of our user forms.&lt;/p&gt;

&lt;p&gt;.&lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First of you head over to your terminal and install django-crispy-forms via the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install django-crispy-forms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next you will need to add the django-crispy-forms to our installed apps in settings.py as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSTALLED_APPS = [

'crispy_forms',

]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You also need to be sure that you add the bootstrap crispy template pack under your installed apps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSTALLED_APPS = [

'crispy_forms',

]

CRISPY_TEMPLATE_PACK='bootstrap4'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a basic html page, as follows:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;form method="post"&amp;gt;

    {% csrf_token %}

    {{form}}

    &amp;lt;button type="submit" class="btn btn-primary"&amp;gt; Log in &amp;lt;/button&amp;gt;

&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add the following tag of crispy forms at the top of your html page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!--index.html--&amp;gt;

{% load crispy_forms_tags %}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add the crispy forms filter to your form:&lt;/p&gt;

&lt;p&gt;|crispy&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!--index.html--&amp;gt;

&amp;lt;form method="post"&amp;gt;

    {% csrf_token %}

    {{form|crispy}}

    &amp;lt;button type="submit" class="btn btn-primary"&amp;gt; Log in &amp;lt;/button&amp;gt;

&amp;lt;/form&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;A final note…&lt;/strong&gt;&lt;br&gt;
For those that are interested in learning how to secure their Django web application as well as how to add 2FA, feel free to check out my latest course:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.udemy.com/course/python-django-ultimate-web-security-checklist-2022/?referralCode=1780ED93976EF90F18C4"&gt;Python Django: Ultimate Web Security Checklist- 2022&lt;/a&gt;&lt;/p&gt;

</description>
      <category>django</category>
    </item>
    <item>
      <title>Django shorts: #1 Humanize</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Sun, 09 Oct 2022 10:03:10 +0000</pubDate>
      <link>https://dev.to/arnopretorius/django-shorts-1-humanize-1am</link>
      <guid>https://dev.to/arnopretorius/django-shorts-1-humanize-1am</guid>
      <description>&lt;p&gt;Django comes with a set of pre-built template filters which are used to give a ‘human touch’ to our data. One of the most commonly used template filters in known as the natural time filter.&lt;/p&gt;

&lt;p&gt;What is the ‘natural time filter’ used for?&lt;/p&gt;

&lt;p&gt;The natural time filter can be used to translate time for us in a more readable format.&lt;/p&gt;

&lt;p&gt;In this example we will be translating the 03 August 2019 22:45:47 into 13 seconds ago. The time now is 22:46:00.&lt;/p&gt;

&lt;p&gt;.&lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&lt;br&gt;
You need to add the Django Humanize app to your installed apps, as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSTALLED_APPS = [

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

'django.contrib.humanize', # Django Humanize

 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt;&lt;br&gt;
The next step is to load the humanize template tag in your html template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- index.html --&amp;gt;
{% load humanize %}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt;&lt;br&gt;
Now apply the natural time filter to your code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!-- index.html --&amp;gt;
{% load humanize %}
{% for posted in datePosted %}
 &amp;lt;p&amp;gt; Last posted at: {{ posted.date|naturaltime }}
 {% endfor %}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;A final note…&lt;/strong&gt;&lt;br&gt;
For those that are interested in learning how to secure their Django web application as well as how to add 2FA, feel free to check out my latest course:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.udemy.com/course/python-django-ultimate-web-security-checklist-2022/?referralCode=1780ED93976EF90F18C4"&gt;Python Django: Ultimate Web Security Checklist- 2022&lt;/a&gt;&lt;/p&gt;

</description>
      <category>django</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Django shorts: #2 Environment variables</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Sun, 09 Oct 2022 09:50:20 +0000</pubDate>
      <link>https://dev.to/arnopretorius/django-shorts-2-environment-variables-59ek</link>
      <guid>https://dev.to/arnopretorius/django-shorts-2-environment-variables-59ek</guid>
      <description>&lt;h2&gt;
  
  
  Why do we need to set up environment variables in Django?
&lt;/h2&gt;

&lt;p&gt;As we continue to build our Django web application, we will eventually come to a realization that there is a lot of sensitive information that is stored in our settings.py file. Typical examples of this sensitive information may include API keys and passwords. Upon realizing the need to keep prying eyes from this type of information, you will think, how can I keep everything separate and safe. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.&lt;br&gt;
.&lt;br&gt;
.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First of you head over to your terminal and install django-environ via the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install django-environ
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, be sure to import environ in your settings.py file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# settings.py

import environ
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We now need to define and initialize environ at the top of our settings.py file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# settings.py

import environ


# Define and Initialise environment variables 

env = environ.Env()

environ.Env.read_env()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Be sure to create a .env file within the same directory as your settings.py file.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Declare your environment variable(s) in your .env file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# .env file

THE_SECRET_KEY=g^31535r/g/wd65ognj66=xh7t05$w7q8!0_3zsl#g
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Be sure to add your newly declared environment variable in settings.py, and replace the value according as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# settings.py

SECRET_KEY = env(‘THE_SECRET_KEY’)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note:* You are effectively referencing your environment variable, just within your settings.py file now.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 7 - IMPORTANT:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make sure that upon pushing your code to your git repository that you create a .gitignore file and add your .env file to it. This ensures that no-one will be able to see sensitive information within your .env file.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;A final note…&lt;/strong&gt;&lt;br&gt;
For those that are interested in learning how to secure their Django web application as well as how to add 2FA, feel free to check out my latest course:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.udemy.com/course/python-django-ultimate-web-security-checklist-2022/?referralCode=1780ED93976EF90F18C4"&gt;Python Django: Ultimate Web Security Checklist- 2022&lt;/a&gt;&lt;/p&gt;

</description>
      <category>django</category>
      <category>web</category>
      <category>webdev</category>
    </item>
    <item>
      <title>C# - The benefits and limitations</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Sat, 17 Sep 2022 07:04:31 +0000</pubDate>
      <link>https://dev.to/arnopretorius/c-the-benefits-and-limitations-1kcn</link>
      <guid>https://dev.to/arnopretorius/c-the-benefits-and-limitations-1kcn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to the C# programming language
&lt;/h2&gt;




&lt;p&gt;Developed at Microsoft by Mads Torgensen in 2000. It is a general-purpose and multi-paradigm programming language. It is commonly used for back-end programming, for building games, and especially desktop applications. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;So, what are the benefits and limitations of the C# programming language?&lt;/strong&gt;&lt;br&gt;
. &lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Compilation and execution times are very fast&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scales automatically and it is updateable&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is much safer than C and C++ because pointer types are not allowed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Offers type safety&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is ideal for development in Windows&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Not as flexible as C++&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It can have a steep learning curve&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some errors can be complex in nature, therefore requiring sufficient knowledge and experience&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has a poor x-platform GUI (Graphical User Interface)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Doesn't offer the best performance in terms of application performance benchmarks&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>csharp</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Java: The benefits and limitations</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Sun, 11 Sep 2022 13:58:15 +0000</pubDate>
      <link>https://dev.to/arnopretorius/java-the-benefits-and-limitations-473h</link>
      <guid>https://dev.to/arnopretorius/java-the-benefits-and-limitations-473h</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to the Java programming language
&lt;/h2&gt;

&lt;p&gt;Java is also another popular programming language. It was initially developed in 1995 by James Gosling. Like Python, it can be used for a lot of different tasks. It is especially popular for building web applications that are on an enterprise scale, and in android app development.&lt;/p&gt;




&lt;p&gt;So, what are the benefits and limitations of the Java programming language?&lt;/p&gt;

&lt;p&gt;.&lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Has support for multi-threading&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are a lot of open-source libraries that are available&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is a highly secure programming language, due to its use of a security manager that defines class access&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has automatic memory allocation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is a distributed programming language&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Much slower, than in comparison to C++ and C&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The memory management can be expensive to manage&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Its syntax is very complex and verbose (many words and sentences are complex in its syntax)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No templates available, which prohibit it from developing data structures that are of high quality&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Requires a lot of memory space&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Python: The benefits and limitations</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Sat, 10 Sep 2022 16:45:44 +0000</pubDate>
      <link>https://dev.to/arnopretorius/python-the-benefits-and-limitations-2cel</link>
      <guid>https://dev.to/arnopretorius/python-the-benefits-and-limitations-2cel</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to the Python programming language
&lt;/h2&gt;

&lt;p&gt;It’s one of the most popular programming languages out there at the moment and still growing. Originally founded in 1991 by Guido van Rossum. Python is used in a wide variety of fields, but it’s especially popular for data science and web development.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;So, what are the benefits and limitations of the Python programming language?&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;.&lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is very easy to learn (beginner friendly)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There is a lot of library support&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lots of community support&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open-source (freeware)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Excellent at scaling from simple applications to those that are more complex in nature&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Limitations:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is slower than a lot of languages because it is an interpreted programming language&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not a good language for mobile development and computing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It isn’t good at threading due to the global interpreter lock&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has limitations with database access because its data access layer is not very well developed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Memory consumption is too high, so it’s not a good choice for memory-intensive tasks&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>AWS: Steps to create your account</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Tue, 06 Sep 2022 04:23:41 +0000</pubDate>
      <link>https://dev.to/arnopretorius/aws-steps-to-create-your-account-3e0c</link>
      <guid>https://dev.to/arnopretorius/aws-steps-to-create-your-account-3e0c</guid>
      <description>&lt;h2&gt;
  
  
  What is Amazon Web Services (AWS)?
&lt;/h2&gt;

&lt;p&gt;Amazon Web Services or AWS as it’s commonly known in the tech industry is the world’s most reliable cloud computing platform. It provides hundreds of unique services which are all cloud-based, ranging from databases to virtual servers.&lt;/p&gt;




&lt;h2&gt;
  
  
  Create an AWS account
&lt;/h2&gt;

&lt;p&gt;.&lt;br&gt;
.&lt;br&gt;
.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1:
&lt;/h2&gt;

&lt;p&gt;Click on the following URL:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/free/"&gt;Create a free AWS account&lt;/a&gt; &lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2:
&lt;/h2&gt;

&lt;p&gt;Please proceed to create a free account.&lt;/p&gt;

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




&lt;h2&gt;
  
  
  Step 3:
&lt;/h2&gt;

&lt;p&gt;Please enter your email address as the root user email address. After that you must decide on your AWS account name and verify your email address.&lt;/p&gt;

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




&lt;h2&gt;
  
  
  Step 4:
&lt;/h2&gt;

&lt;p&gt;After you have verified your email address you will be asked to enter additional details. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First of all, you must complete a general sign-up form which will ask you to enter in  a few details, such as your name, address, country etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You must then put a card on file. After you have put your credit card on file you will be charged $1, and then you will be refunded a few minutes after. The point of this is to ensure that you have a working debit/credit card.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You may be asked later in the set-up process to enter a verification code from your phone.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Near the end of this process, please be sure to select the free plan.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 5:
&lt;/h2&gt;

&lt;p&gt;Once you have set-up your account, you may now login to AWS account with your root user account. &lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6:
&lt;/h2&gt;

&lt;p&gt;Upon signing into your AWS account, you will be greeted with the AWS Management Console - and that's that!&lt;/p&gt;

&lt;p&gt;Well done! &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;A final note…&lt;/strong&gt;&lt;br&gt;
For those that are interested in learning Cloud Computing from scratch, feel free to check out my latest course:&lt;/p&gt;




&lt;p&gt;&lt;a href="https://www.udemy.com/course/cloud-computing-on-aws-ultimate-beginners-course-2022/?referralCode=A8F185F6471C6AB608BE"&gt;Cloud Computing on AWS: Ultimate Beginners Course — 2022&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>AWS: The topics that you need to master as a beginner</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Sat, 03 Sep 2022 16:33:22 +0000</pubDate>
      <link>https://dev.to/arnopretorius/aws-the-topics-that-you-need-to-master-as-a-beginner-m29</link>
      <guid>https://dev.to/arnopretorius/aws-the-topics-that-you-need-to-master-as-a-beginner-m29</guid>
      <description>&lt;h2&gt;
  
  
  Preface:
&lt;/h2&gt;

&lt;p&gt;As a beginner to cloud computing, there are a vast amount of topics that you need to master first before further advancing in your cloud computing career.&lt;/p&gt;




&lt;h2&gt;
  
  
  Topics to master as a beginner to cloud computing:
&lt;/h2&gt;




&lt;ul&gt;
&lt;li&gt;&lt;p&gt;General IT concepts (basic networking)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The AWS global infrastructure (Regions, Availability Zones, VPC's (subnets) and Edge Locations)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to create and setup an AWS account&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS Identity and Access Management (IAM)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazon Elastic Compute Cloud (EC2) -&amp;gt; fundamental to understanding how the AWS cloud works&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The concept of scalability and high availability &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cloud storage services (S3, EBS and EFS)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Databases&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic deployment on AWS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS services and content delivery &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The basic concept of containers and serverless computing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The basic concept of cloud monitoring and integration&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The basic concept of security and encryption&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  A final note...
&lt;/h2&gt;

&lt;p&gt;For those that are interested in learning Cloud Computing from scratch, feel free to check out my latest course:&lt;/p&gt;




&lt;p&gt;&lt;a href="https://www.udemy.com/course/cloud-computing-on-aws-ultimate-beginners-course-2022/?referralCode=A8F185F6471C6AB608BE"&gt;Cloud Computing on AWS: Ultimate Beginners Course - 2022 &lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>AWS IAM: Best practices to follow</title>
      <dc:creator>Arno Pretorius</dc:creator>
      <pubDate>Mon, 08 Aug 2022 06:18:43 +0000</pubDate>
      <link>https://dev.to/arnopretorius/aws-iam-best-practices-to-follow-500l</link>
      <guid>https://dev.to/arnopretorius/aws-iam-best-practices-to-follow-500l</guid>
      <description>&lt;h2&gt;
  
  
  What is IAM?
&lt;/h2&gt;

&lt;p&gt;IAM is an AWS service that stands for Identity and Access Management. It is used to define the identity of our users. By default, we are given a root account when we first set up our AWS account. It is through IAM that we can create user accounts for accessing AWS instead and perform certain actions. &lt;/p&gt;




&lt;h2&gt;
  
  
  So, what are the best practices to follow with IAM?
&lt;/h2&gt;

&lt;p&gt;...&lt;/p&gt;




&lt;h2&gt;
  
  
  Tip 1:
&lt;/h2&gt;

&lt;p&gt;Never use the root account, always create a user account and use that account instead. The root account is simply used for account setup, and nothing else. &lt;/p&gt;




&lt;h2&gt;
  
  
  Tip 2:
&lt;/h2&gt;

&lt;p&gt;Enable MFA (Multi-Factor Authentication) for your root account and for your IAM users. An extra layer of security always goes a long way&lt;/p&gt;




&lt;h2&gt;
  
  
  Tip 3:
&lt;/h2&gt;

&lt;p&gt;Create an effective password policy for your users. You can decide on the number of characters that a user must have in their password, how often they must rotate their password, and set up many other characteristics&lt;/p&gt;




&lt;h2&gt;
  
  
  Tip 4:
&lt;/h2&gt;

&lt;p&gt;Never share your user's access and secret access keys with anyone! Each IAM user that you create will come with access keys, be sure to keep it private.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tip 5:
&lt;/h2&gt;

&lt;p&gt;Be sure to add your IAM users to groups, and attach permissions to those groups. You can add permission directly to a user, but this can get chaotic and get disorganized, especially if you have a lot of users. So, be sure to group them accordingly... and assign permissions to those groups. Examples of groups may be "Administrators" or "Developers" or "Managers". &lt;/p&gt;




&lt;p&gt;-&amp;gt;&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://www.cloudwithdjango.com"&gt;https://www.cloudwithdjango.com&lt;/a&gt; &lt;/p&gt;

</description>
      <category>aws</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
