<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Okan Gul on Medium]]></title>
        <description><![CDATA[Stories by Okan Gul on Medium]]></description>
        <link>https://medium.com/@okangul?source=rss-1b7bfe906a05------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*08IhGctgmNSp0aUQ.</url>
            <title>Stories by Okan Gul on Medium</title>
            <link>https://medium.com/@okangul?source=rss-1b7bfe906a05------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 12:50:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@okangul/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When to Use Blank and Null on Django Models]]></title>
            <link>https://medium.com/@okangul/when-to-use-blank-and-null-on-django-models-1a82be103294?source=rss-1b7bfe906a05------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a82be103294</guid>
            <category><![CDATA[django-models]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Okan Gul]]></dc:creator>
            <pubDate>Tue, 07 Dec 2021 02:24:59 GMT</pubDate>
            <atom:updated>2021-12-07T02:24:59.610Z</atom:updated>
            <content:encoded><![CDATA[<p>While defining model fields developers have the option to set blank=True and/or null=True. These by default set False but adjusting these properly can make or break your project flow and object level validation.</p><p>For developers setting these is always a common confusion which as one I had my share of not knowing what to do and just set them both True only to “cover all of the cases” on my mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hhPDF1G2rD27zX6oqPRGAg.jpeg" /></figure><p>While reading Two Scoops of Django form Daniel Audrey Feldroy saw this table that helped me come to my senses with this somehow simple but confusing model setting.</p><p>Yes setting both of them True not a problem, but doing it so by knowing the consequences is the most important part of this. So from now on dear developers when setting your model fields blank True, just know that you are giving your forms ability to post empty string, its very simple! For the null=True case, its mostly to accept null values on database level but using it with some fields is tricky. For file and image fields since Django stores the path in a CharField it’s not suggested. For char based fields its only okay when both blank and unique is true, in that case its only used for validating uniqueness.</p><p>So now we all know :) Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a82be103294" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>