<?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: Katie Clark</title>
    <description>The latest articles on DEV Community by Katie Clark (@kathryn0908).</description>
    <link>https://dev.to/kathryn0908</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%2F398613%2F3a4250b5-1f3a-48d2-adbd-f88a331e1436.jpeg</url>
      <title>DEV Community: Katie Clark</title>
      <link>https://dev.to/kathryn0908</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kathryn0908"/>
    <language>en</language>
    <item>
      <title>Django JWT Auth </title>
      <dc:creator>Katie Clark</dc:creator>
      <pubDate>Tue, 18 Aug 2020 22:48:25 +0000</pubDate>
      <link>https://dev.to/kathryn0908/django-jwt-auth-2140</link>
      <guid>https://dev.to/kathryn0908/django-jwt-auth-2140</guid>
      <description>&lt;p&gt;We've made it! Now that your DB is set up(for the most part). I'm going to dive into Django Auth.&lt;/p&gt;

&lt;p&gt;First, you will need to install rest framework simple jwt:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pSlf8aWd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zbpbp5aqu7hb3tbjcdzu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pSlf8aWd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zbpbp5aqu7hb3tbjcdzu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you are going to make two directories for your seed.py file. These will need to be located in your app folder:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PkVwX2oa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qojehyjjicid2z70wbiu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PkVwX2oa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qojehyjjicid2z70wbiu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For now, that is all we will be doing with the seed.py. &lt;/p&gt;

&lt;p&gt;You will need to include 'auth' in your admin(project folder) urls like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nqjD6grJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vfmrbj3a2h9y4pzdh70q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nqjD6grJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vfmrbj3a2h9y4pzdh70q.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next is Permissions classes, these essentially outline what data your end users can access. There are a few different permissions classes and I will go over the most popular ones:&lt;/p&gt;

&lt;p&gt;If this is an at-home project/test environment, you may be interested in AllowAny (this basically alleviates all the permissions for a specific class).&lt;br&gt;
ReadOnly allows for the user to access the data, but not change the information and IsAuthenticated allows the user to access and change the data, as long as they've been authenticated. There is the option to have ReadOnly and IsAuthenticated together, since you will want to authorize most of your end users and just allow them to view the data. &lt;/p&gt;

&lt;p&gt;You can have a global permissions class listed in your settings.py and then have custom permissions in your views(maybe you want most models to have authentication, but a few classes to have no authentication)!&lt;/p&gt;

&lt;p&gt;If you want default global permissions classes you add them in your settings.py like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FDMjybpO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w3p6f0qsaomf471yzeuo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FDMjybpO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w3p6f0qsaomf471yzeuo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, for custom permissions in your views, you will need to import permissions and include the permissions class in the specified model's view:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_9pQkWOz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0u9w0cthh4zxx1954vrj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_9pQkWOz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0u9w0cthh4zxx1954vrj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I chose AllowAny for mine, but use whatever works best for your project. &lt;/p&gt;

&lt;p&gt;You will need to update your CORS permissions in settings.py, this will determine which sites are allowed to access your backend data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lSPYlUWI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iy1cnr1lvmy5n4i0mq0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lSPYlUWI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iy1cnr1lvmy5n4i0mq0z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next you will want to add the Token and Refresh Views in the project folder in the urls.py file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QXyPvjxh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/et65vcn6dmy2druiq79i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QXyPvjxh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/et65vcn6dmy2druiq79i.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The TokenPairView brings in JWT and Refresh tokens, refresh is used if JWT is expired. That way, the user does not have to re-login. The JWT Token expires relatively quickly, in order to change the token lifetime you can update it in settings.py:&lt;/p&gt;

&lt;p&gt;First, import timedelta at the top of your settings.py:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MEVSvtdr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5qr8umnipwryu73170up.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MEVSvtdr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5qr8umnipwryu73170up.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then update this below in your settings.py file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gqX8nKmr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dbdb11o1r16qevlfwbms.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gqX8nKmr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dbdb11o1r16qevlfwbms.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once that is completed, you will want to start seeding data to confirm your permissions and auth tokens are working! My next blog will go into Admin View and checking Tokens in Postman.&lt;/p&gt;

&lt;p&gt;If you are seeding from an external API, check out this great blog: &lt;br&gt;
&lt;a href="https://medium.com/@chilinski.a/how-to-seed-a-django-api-with-data-from-an-external-api-b577b6e6ad54"&gt;https://medium.com/@chilinski.a/how-to-seed-a-django-api-with-data-from-an-external-api-b577b6e6ad54&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;If you had followed this blog previously/did not create your User model first that points to the Django Auth. Follow these steps!&lt;/p&gt;

&lt;p&gt;These next steps should ONLY be used if you are in the early development stages and NOT in production. &lt;/p&gt;

&lt;p&gt;First, you will need to delete all your migration files in the migrations folder-- except the init__py and pycache folder.&lt;/p&gt;

&lt;p&gt;Delete your dbsqlite3.&lt;/p&gt;

&lt;p&gt;Re-run your migrations:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qVRcI5Vw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/j2bxbp01rcqpev68n2wk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qVRcI5Vw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/j2bxbp01rcqpev68n2wk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Thanks for reading! &lt;/p&gt;

&lt;p&gt;Note: Throughout this process, it is a good idea to continually run your server to confirm that everything is working! It makes it much easier to debug, one at a time instead of having multiple errors once your are ready to run your server!&lt;/p&gt;

&lt;p&gt;Additionally, pushing your Django Repo to Github-- be sure to encrypt your SECRET_KEY in your settings.py file in a .env file and then include the .env in your .gitignore file.&lt;/p&gt;

&lt;p&gt;In order to access stored information in your .env file, you will need to install the python-decouple package and import it into your settings.py file. &lt;/p&gt;

&lt;p&gt;To install:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--shH6wDkn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6psrygqj0rzjj0lb137n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--shH6wDkn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6psrygqj0rzjj0lb137n.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To import:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bxh4lDA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9jucmu2e06l4fnjfn9qq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bxh4lDA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9jucmu2e06l4fnjfn9qq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;updated SECRET_KEY:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qewUNjiJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/92fh2h0tbkm1ian1m32t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qewUNjiJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/92fh2h0tbkm1ian1m32t.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Be on the look out for the next installment in this series where I will be creating a custom User model, using Admin View and Postman to check CRUD and auth tokens!&lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>security</category>
      <category>django</category>
      <category>python</category>
    </item>
    <item>
      <title>Job Searching? 3 Tips on how to make your Github standout.</title>
      <dc:creator>Katie Clark</dc:creator>
      <pubDate>Tue, 11 Aug 2020 18:00:13 +0000</pubDate>
      <link>https://dev.to/kathryn0908/job-searching-3-tips-on-how-to-make-your-github-standout-97p</link>
      <guid>https://dev.to/kathryn0908/job-searching-3-tips-on-how-to-make-your-github-standout-97p</guid>
      <description>&lt;p&gt;Recently, I attended a webinar on 'What Makes a Strong Github?' and was compelled to share some of the information I felt most useful to other job seekers.&lt;/p&gt;

&lt;p&gt;1:Git commit, at least once per day. &lt;/p&gt;

&lt;p&gt;I know, maybe this is obvious, but it's so important. Potential employers will be looking at your activity and can see how often you commit and code. Even if you are working on some local project, always create a repository and commit! I created a repo for my CodeWars exercises, that way I am practicing and can also get my commits in.&lt;/p&gt;

&lt;p&gt;2:ReadMe's and Pinned Projects are essential!&lt;/p&gt;

&lt;p&gt;Make sure that your Pinned Projects are projects you are proud of because employers will look at those first! If they are just labs or minor exercises it will not look as professional and will not showcase your work effectively. Always put your completed projects in the Pinned section. That brings me to ReadMe's-- if you are a full stack dev be sure to link your backend repo in your frontend ReadMe and vice versa. This will be helpful when employers look to get the full scope of your project. Additionally, always include screenshots/demo video in your ReadMe. People are visual and if you are a full stack or frontend dev, this can be extremely influential on the employer and a great chance to show off your work!&lt;/p&gt;

&lt;p&gt;3:Remember to remove your console.logs! &lt;/p&gt;

&lt;p&gt;Wow, why did I not realize this? In my mind I thought "oh, yeah, look I'm checking my work!". Nope, employers see this as messy code. Same with indentation, always make sure that your code is clean before you commit! Best practices is to get a linter for your source-code editor!&lt;/p&gt;

&lt;p&gt;Here is the full video, there's a wealth of good information in here! &lt;a href="https://www.youtube.com/watch?v=jUYQPI2RUpw&amp;amp;feature=youtu.be"&gt;https://www.youtube.com/watch?v=jUYQPI2RUpw&amp;amp;feature=youtu.be&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Happy committing!&lt;/p&gt;

</description>
      <category>github</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Step by Step Guide on how to set up a Django database Pt.2(Model, View and Serializer)</title>
      <dc:creator>Katie Clark</dc:creator>
      <pubDate>Wed, 29 Jul 2020 01:24:36 +0000</pubDate>
      <link>https://dev.to/kathryn0908/step-by-step-guide-on-how-to-set-up-a-django-database-pt-2-model-view-and-serializer-3kj1</link>
      <guid>https://dev.to/kathryn0908/step-by-step-guide-on-how-to-set-up-a-django-database-pt-2-model-view-and-serializer-3kj1</guid>
      <description>&lt;h2&gt;
  
  
  Welcome back! Here's part 2 of my How-to set up a Django database:
&lt;/h2&gt;

&lt;p&gt;WARNING/EDIT: If you are creating a Database with Users/Auth, you will need to do these steps, BEFORE migrating for the first time! If you have already gone too far, I will show how to remedy this in my Django Auth Blog.&lt;/p&gt;

&lt;p&gt;Directly from Django Docs:&lt;br&gt;
Due to limitations of Django’s dynamic dependency feature for swappable models, the model referenced by AUTH_USER_MODEL must be created in the first migration of its app (usually called 0001_initial); otherwise, you’ll have dependency issues.&lt;/p&gt;

&lt;p&gt;You will need to put this in your Settings.py in your Project Folder. It should be AUTH_USER_MODEL = [your_app_name.user]:&lt;/p&gt;

&lt;p&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%2Fatikwev4bpkzjlteqfmz.png" 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%2Fatikwev4bpkzjlteqfmz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally, add this to your Models(You can customize further later on, I will be going into detail in my Django Auth installment):&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%2Fe5rn8zmuly55le9v0euy.png" 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%2Fe5rn8zmuly55le9v0euy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, you will need to register your user model in your Admin.py:&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%2Farakdcczqtwegg2iv2yf.png" 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%2Farakdcczqtwegg2iv2yf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;For starters, let's make sure that the file structure you have is correct. You will need to have the master folder contain the src and venv folders, within the src folder you should have the  manage.py, project and app folders. Like this:&lt;/p&gt;

&lt;p&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%2Fwu2xv50913b74tbi1uin.png" 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%2Fwu2xv50913b74tbi1uin.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have confirmed your file structure is correct- Django is VERY particular and you need to have it set up in a way that enables you to run the manage.py and have access to your project/app folders- we can start on the first aspect, the Model!&lt;/p&gt;

&lt;p&gt;Important Note: Django's syntax is built around indentation. There is no curly braces or 'end'. You need to make sure that your classes and methods are indented correctly in order for them to run. &lt;/p&gt;

&lt;p&gt;Go to your models.py in your app folder. There we will be writing the classes and their correlating fields (basically columns that will be storing information in your Database). For my Model, I included a created_at field where it is using a time stamp. At the top of my file, I included:&lt;br&gt;
from django.utils import timezone&lt;br&gt;
import datetime&lt;/p&gt;

&lt;p&gt;This is only needed if you would like to include DateTime.&lt;/p&gt;

&lt;p&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%2Fxc4g88bk3cyiazs4vl0r.png" 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%2Fxc4g88bk3cyiazs4vl0r.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Model, in addition to the fields you will need to add the data type that the information will be stored in. The most common is CharField, which requires a max_length attribute. &lt;/p&gt;

&lt;p&gt;TextField is for much longer text, like paragraphs. It will still store TextField as a string, but does not need any attributes. &lt;/p&gt;

&lt;p&gt;Finally, the DateTime field includes auto_now_add:True, which means the time stamp will be added automatically at creation. The null=True is set in the event the created_at is not existent, it will still create the instance. Finally, the blank=True means that is can be left blank and not required in your admin or custom forms. &lt;/p&gt;

&lt;p&gt;Next, go to your admin.py file and register your models:&lt;/p&gt;

&lt;p&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%2F8cmesn2w7l5ypt56bl6z.png" 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%2F8cmesn2w7l5ypt56bl6z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once that is completed, the next step is to create the Serializer! In your command line, cd into your app folder and create a serializers.py file. Run: touch serializers.py. Then, cd back into your src folder when you are done and create your serializer:&lt;/p&gt;

&lt;p&gt;The Serializer includes just the models and fields, there are additional attributes that can be added to customize your Serializer. One note is that Django does not automatically create an id(the Primary Key) for each instance, instead it leaves it open for customization. I included an id, because I like to have that field as my Primary Key, but it is completely up to you!&lt;/p&gt;

&lt;p&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%2Fefl2mp91m0okg6nfnwzu.png" 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%2Fefl2mp91m0okg6nfnwzu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next we have the View! The view determines how the class will be displayed. You will need to include the queryset and serializer_class(this will provide the information needed to render the data). Also, be sure to import the models and serializers into your view file:&lt;/p&gt;

&lt;p&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%2Fay77q7xma8xm0wulvxud.png" 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%2Fay77q7xma8xm0wulvxud.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, we will need to create routes for our views! This is done in both the urls.py files in your app and project folders. &lt;/p&gt;

&lt;p&gt;First, in your app folder register your router. There will be a router.register for each model you have:&lt;/p&gt;

&lt;p&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%2Fwofze1bdxgeko3gck2ne.png" 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%2Fwofze1bdxgeko3gck2ne.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, go into your urls.py in your project folder and include the urls from your app:&lt;/p&gt;

&lt;p&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%2Ffqcmkhlsgnmic8renlvg.png" 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%2Ffqcmkhlsgnmic8renlvg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hooray! Everything is set up! Be sure to run your server and check your Admin site to confirm everything is showing and perform your CRUD operations!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Be on the Look Out for my next installment in this series: Django Auth&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Feel free to check out my github repo: &lt;a href="https://github.com/kathryn0908/django_blog" rel="noopener noreferrer"&gt;https://github.com/kathryn0908/django_blog&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
    </item>
    <item>
      <title>Step by Step Guide on how to set up a Django Database</title>
      <dc:creator>Katie Clark</dc:creator>
      <pubDate>Mon, 20 Jul 2020 23:23:43 +0000</pubDate>
      <link>https://dev.to/kathryn0908/step-by-step-guide-on-how-to-set-up-a-django-database-2fgn</link>
      <guid>https://dev.to/kathryn0908/step-by-step-guide-on-how-to-set-up-a-django-database-2fgn</guid>
      <description>&lt;p&gt;For my Capstone project with Flatiron Bootcamp one of the requirements was learning a new technology. Since I have an affinity for backend data I wanted to take a stab at Django. While researching I noticed a lack of step-by-step guides and thought I'd write one!&lt;/p&gt;

&lt;p&gt;To start off you will need to download django and pip(which is a package management system for django). If you are a Mac user, like myself, you will already have python installed. Make sure you have the most recent version of python before starting your project! &lt;/p&gt;

&lt;p&gt;Additionally, you will need to install pip3. Run: install pip3.&lt;/p&gt;

&lt;p&gt;Once you have confirmed you have the most recent version of python and pip, create a directory for your project. Once in your project, there are several commands you will need to execute. &lt;/p&gt;

&lt;p&gt;You will need to first create a venv, which stands for virtual environment. This ensures that any changes made to your website won't affect other websites you're developing. You will want to create the venv with the most recent version of pip, pip3. Run: pip3 install virtualenv.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--64tKeYyA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vggz5svdwem13qd64z5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--64tKeYyA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vggz5svdwem13qd64z5i.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once completed, I ran an additional code snippet to change the name python3 to just python in the venv. When running commands you must have python included prior to your command. You will see what I'm talking about later in this guide. Run: virtualenv --python=python3 venv.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_oFLqabO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/x8wszn8hdwlkwy5isny3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_oFLqabO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/x8wszn8hdwlkwy5isny3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating your venv and renaming python3 to python, you will need to activate your venv. When it's installed, it includes a bin folder that you need to activate. Run: source venv/bin/activate. Once activated, it should look like this, where it has (venv) before the command line:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wpLmv1Dr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/f532lfvrbqbf8vcvx67t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wpLmv1Dr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/f532lfvrbqbf8vcvx67t.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, you will want to install Django in your venv. Run: pip install django.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LOgSS1sK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uvv4jymfkrgv3vavnw5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LOgSS1sK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uvv4jymfkrgv3vavnw5e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then install the django restframework:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gXQoc1Q1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hr5ywfpiu5hhjkr0i3in.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gXQoc1Q1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hr5ywfpiu5hhjkr0i3in.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once these steps are completed, you can create your project folder. Run: django-admin startproject [your_project_name].&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hBCIdgcE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/afp7m35cc8erbstw6jwv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hBCIdgcE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/afp7m35cc8erbstw6jwv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your file structure should now look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wt6KZ95M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gqc0v0aedbtxnusfovod.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wt6KZ95M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gqc0v0aedbtxnusfovod.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;cd into your new project folder and rename the folder src:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FKN2gbiK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7fn1j747yxxceqg3f8hn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FKN2gbiK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7fn1j747yxxceqg3f8hn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;cd into your src folder once it has been renamed.&lt;/p&gt;




&lt;p&gt;WARNING/EDIT: If you are creating a Database with Users/Auth, you will need to do these steps, BEFORE migrating for the first time! If you have already gone too far, I will show how to remedy this in my Django Auth Blog.&lt;/p&gt;

&lt;p&gt;Directly from Django Docs:&lt;br&gt;
Due to limitations of Django’s dynamic dependency feature for swappable models, the model referenced by AUTH_USER_MODEL must be created in the first migration of its app (usually called 0001_initial); otherwise, you’ll have dependency issues.&lt;/p&gt;

&lt;p&gt;You will need to put this in your Settings.py in your Project Folder. It should be AUTH_USER_MODEL = [your_app_name.user]:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dUfuGwFz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/atikwev4bpkzjlteqfmz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dUfuGwFz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/atikwev4bpkzjlteqfmz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally, add this to your Models(You can customize further later on, I will be going into detail in my Django Auth installment):&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FviSnM6F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e5rn8zmuly55le9v0euy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FviSnM6F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e5rn8zmuly55le9v0euy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, you will need to register your user model in your Admin.py:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S66EvOgm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/arakdcczqtwegg2iv2yf.png" alt="Alt Text"&gt;
&lt;/h2&gt;

&lt;p&gt;Ok...back to the standard set up....&lt;/p&gt;

&lt;p&gt;Once you are in your project src folder, you will need to run: python manage.py migrate. This will migrate over all of the Django admin and user information that comes pre-packaged with Django!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SHFmjcFL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iie4ye6cxn608zze7okh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SHFmjcFL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iie4ye6cxn608zze7okh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, create a super user- this will be your admin information for you to access and change your backend data on the web browser. Run: python manage.py createsuperuser. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IT677sO2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6rij2izonly2uvqiyiy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IT677sO2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6rij2izonly2uvqiyiy1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will prompt for a user, email and password. The email is optional.Once completed the terminal will say: SuperUser created successfully. &lt;/p&gt;

&lt;p&gt;To confirm, run: python manage.py runserver click on the localhost site provided in the terminal and login using the credentials you just made!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fd91psVc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bez0vyxp07sa9y4lrx5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fd91psVc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bez0vyxp07sa9y4lrx5w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, you can start your app! Run: python manage.py startapp [app_name]. This is where you will begin to use python manage.py at the beginning of each command you run. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---6LHP2_W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/s0iw4zncie66i7kfr2h9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---6LHP2_W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/s0iw4zncie66i7kfr2h9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your file structure should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cc_1XGPv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/u6754wn7856pl4yxjjb8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cc_1XGPv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/u6754wn7856pl4yxjjb8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install cors headers using: pip install django-cors-headers. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GmBQOvTQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nf1xbbusomy0rm2q18t2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GmBQOvTQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nf1xbbusomy0rm2q18t2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once your app is created, be sure to add your app name, rest framework and cors headers to the list of installed apps in settings.py.&lt;/p&gt;

&lt;p&gt;Include cors headers information in your middleware in settings.py:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YU6zfRoM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8hyl6nie9vjfzzq3bdh7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YU6zfRoM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8hyl6nie9vjfzzq3bdh7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once that is completed the fundamentals of your django database are set up! This is part 1 of (at least) 2 blogs I will be creating to show how to set up and create your Django DB. &lt;/p&gt;

&lt;p&gt;EDIT/TIP: You may want to name your app folder with additional clarification such as: [app_name_app]. In order to differentiate between the project and app folders. You will always need to run commands from your project folder in order to access the manage.py file, so it helps to have a distinction between the two!&lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
    </item>
    <item>
      <title>Tips and Tricks on how to be a better coder.</title>
      <dc:creator>Katie Clark</dc:creator>
      <pubDate>Tue, 07 Jul 2020 16:55:52 +0000</pubDate>
      <link>https://dev.to/kathryn0908/tips-and-tricks-on-how-to-be-a-better-coder-1ko3</link>
      <guid>https://dev.to/kathryn0908/tips-and-tricks-on-how-to-be-a-better-coder-1ko3</guid>
      <description>&lt;p&gt;I decided to write this is order to give some perspective and hopefully some advice new coders. Learning at a bootcamp is no cakewalk, that's why they call them bootcamps. And I have to say it was nothing like any educational experience I have had in my life. The amount of material you need to pick up and practically master, in a matter of months, is vast and can be daunting at times. It took me awhile to adjust and, in turn be a better coder. Here's a few tips I've learned along the way:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GET GOOD SLEEP - sounds obvious, right? But the truth is, when you are in the trenches you want to capitalize on your time as much as possible. A lot of students, and coders in general, will code into the night and try to squeeze out their last bit of motivation. Here's the deal though, for every hour you stay up trying to get something done-- the higher chance you are going to fall into an error pit(especially for newbies). What's an error pit? An error pit is when something goes wrong, you can't figure out what it is and instead of doing the work you wanted to get done, you are stuck trying to solve the error FOR HOURS. Most of the time, it's a relatively easy fix, but your brain is tired and it makes it that much harder to solve. Your adrenaline is pumping because you think you've 'broke' your project, which causes more stress than is needed. This has been an experience of me and other's in my cohort. The thing is, after a night of sleep, they solve the problem in a matter of minutes. Another, aspect of this is when you don't get good sleep your problem solving skills greatly suffer. I have had a few times where I didn't sleep as well as I liked and I could tell my productivity when down significantly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Tip: A great way to solve this that has worked for me, is to give yourself a schedule. Only allow yourself to work 9 hours per day. I have a set time that I do not continue coding after 7pm. After 7pm, my brain starts to get tired and I never get what I want done. Instead, I relax, get a good night's sleep and start out again at 9am.&lt;/p&gt;

&lt;p&gt;2)Exercise, exercise, exercise. It seriously amazes me how much more productive I am when I do between 15-30min of exercise per day. Something about getting your blood pumping and your brain and body alert sets your pace for the day. Additionally, the endorphin rush is especially helpful when running into problems(which I will explain more in my next point).&lt;/p&gt;

&lt;p&gt;Tip: I do want to say, if you are not the exercise type- try walking! It's a great way to get out, get some vitamin D and still refreshes you to code!&lt;/p&gt;

&lt;p&gt;3) Mindset is everything when it comes to coding(queue good sleep and exercise). I've gotten to the point in coding where error messages, excite me. It sounds masochistic, but the truth is, it's a learning experience! Having a positive mindset will take you miles in coding. You need to have grit, enjoy working through obstacles, and solving problems because these are the personality building blocks of a proficient coder. If you can take a problem head-on and enjoy it for what it is, you are in the right field!&lt;/p&gt;

&lt;p&gt;Tip: Being positive will always set you on the right foot. For me, it enables me to actually solve the problem faster. Being able to get excited and learn how to fix something enables better problem solving and better results. When someone get's stressed about an issue, hormones that can affect you negatively set in, you can actually hurt your ability to solve the problem and you have a bad experience overall.&lt;/p&gt;

&lt;p&gt;I understand, yes these tips seem obvious--right? The reason why I wanted to write this is because despite it being obvious, we all fall into these pitfalls from time to time and it's especially helpful for new coders to take these tips to heart. Hope these help!&lt;/p&gt;

</description>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Multi-Relational Models in Ruby, how to use 'includes' to your advantage.</title>
      <dc:creator>Katie Clark</dc:creator>
      <pubDate>Tue, 30 Jun 2020 16:26:40 +0000</pubDate>
      <link>https://dev.to/kathryn0908/multi-relational-models-in-ruby-how-to-use-includes-to-your-advantage-2pah</link>
      <guid>https://dev.to/kathryn0908/multi-relational-models-in-ruby-how-to-use-includes-to-your-advantage-2pah</guid>
      <description>&lt;p&gt;For my Charity Organizer project, that I completed through Flatiron's Coding Bootcamp, I truly learned the in's and out's of Ruby's relationship models. The project involved four relational tables: User, Charity, Favorites and Donations. At the time, I thought 'yes it's one more than usual, but how crazy can it get?'. Right?, Wrong. I searched high and low through Google and even had an instructor help me determine what the correct syntax was for connecting one of my models. I wanted to share with you my findings so that hopefully, in the future, this will help someone much faster than the hour+ of digging I needed to do for a simple line of code.&lt;/p&gt;

&lt;p&gt;First, I'm going to show you my models to better explain the relationships between all of the classes.&lt;/p&gt;

&lt;p&gt;User:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tpirmstz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/env9rvfsiqwyncyarlgn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tpirmstz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/env9rvfsiqwyncyarlgn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Charity:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--clt_iKI2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4bmmurjncht4wodai3sp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--clt_iKI2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4bmmurjncht4wodai3sp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Favorite:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xd8QN5-k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hclt978bdc5hky7i7ql9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xd8QN5-k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hclt978bdc5hky7i7ql9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Donation:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xd8QN5-k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hclt978bdc5hky7i7ql9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xd8QN5-k--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hclt978bdc5hky7i7ql9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The User and Charity models have slightly more complex relationships than I had encountered before, which made it difficult when determining how to use 'includes' in my Controllers. Specifically, my Favorites Controller. I wanted a user to be able to create a Favorite of a Charity and then add/post donations to said Charity on their own personal page. This became difficult because Favorites and Donations are not linked in any direct way, so it was not just a simple 'includes' statement. I had to include the Charity class and through the Favorites class, access the Donations class. Which I thought would be simple to find information on, right? I mean how many large-scale corporations have multi-relational databases, if not all? This proved more difficult than I had anticipated and after an hour of searching(and really only playing around with the syntax), this is what finally worked:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RS5T4P_9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cfose7yxnr7cevlnixaz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RS5T4P_9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cfose7yxnr7cevlnixaz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally, this is what I used for my Charities Controller:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lhk37otx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yx5udib96mg3qtvdcufo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lhk37otx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yx5udib96mg3qtvdcufo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This finally enabled me to access the props in my frontend React application and made my project work! I hope this helps any of you in the future in connecting multiple databases using Rails. Happy coding!&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Optimistic Rendering...what is it and why is it important?</title>
      <dc:creator>Katie Clark</dc:creator>
      <pubDate>Mon, 01 Jun 2020 17:17:02 +0000</pubDate>
      <link>https://dev.to/kathryn0908/optimistic-rendering-what-is-it-and-why-is-it-important-21h3</link>
      <guid>https://dev.to/kathryn0908/optimistic-rendering-what-is-it-and-why-is-it-important-21h3</guid>
      <description>&lt;p&gt;Optimistic Rendering. I had heard it a few times early on in my quest to becoming a full-stack developer, but did not recognize the importance and influence it has throughout frontend and full-stack development. Why is it so important? As soon as I discovered what exactly Optimistic rendering was, the relevance became clear. To better understand Optimistic rendering, I want to also explain its counterpart, Pessimistic rendering. Pessimistic rendering is the opposite of Optimistic rendering and is considered to be "expensive". &lt;/p&gt;

&lt;p&gt;Well, what is "expensive"? And what does that even mean?&lt;/p&gt;

&lt;p&gt;Essentially, what Optimistic vs. Pessimistic rendering boil down to is whether or not events on a page happen before or after they fetch information to and from the database. &lt;/p&gt;

&lt;p&gt;Optimistic is before, Pessimistic is after. The reason that Pessimistic is so "expensive" is because rendering content that first must be stored in the backend and then retrieved back to the frontend can take a long time, in an end-user's eyes. Most websites use Optimistic rendering because it enables the user to see their results fast. Fetching pessimistically to the backend first can leave the website open to potential vulnerabilities. Especially in the event that something on the backend happens to misfire or take longer than expected. &lt;/p&gt;

&lt;p&gt;In our current world, especially in the context of the internet, people consume things quickly and expect instantaneous feedback. According to Kissmetrics, 47 percent of visitors expect a website to load in less than 2 seconds, and 40 percent of visitors will leave the website if the loading process takes more than 3 seconds. This is the instance where something can become "expensive", you want end users to be engaged and stay on your site for as long as possible. Losing users at a fast rate can be damaging to your companies long-term success, which is why Optimistic Rendering is now the status quo for front-end web development. &lt;/p&gt;

&lt;p&gt;Now, for the "how". Because Optimistic rendering sends the fetch after the event, the code in javaScript looks something like this: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WCGFRXWj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m6mp6z4doktiocdzxo2j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WCGFRXWj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m6mp6z4doktiocdzxo2j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is in vanilla JS. I created an update eventListener that uses FormData to get the information input by the user once the form has been submitted. By adding the fetch call to the end and adding the event.preventDefault(), which enables the update to be made without reloading the page, this optimizes the user's experience and facilitates longer engagement.&lt;/p&gt;

&lt;p&gt;source for statistics on user engagement:websitemagazine.com/blog/5-reasons-visitors-leave-your-website&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
