<?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: Abdul Azeez</title>
    <description>The latest articles on DEV Community by Abdul Azeez (@thisisazeez).</description>
    <link>https://dev.to/thisisazeez</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%2F722524%2F57b802bf-1e20-46f9-8de9-aca70db5ddb3.jpeg</url>
      <title>DEV Community: Abdul Azeez</title>
      <link>https://dev.to/thisisazeez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thisisazeez"/>
    <language>en</language>
    <item>
      <title>First Django App For Beginners Part 3(templates &amp; static files)</title>
      <dc:creator>Abdul Azeez</dc:creator>
      <pubDate>Sat, 30 Oct 2021 07:59:02 +0000</pubDate>
      <link>https://dev.to/thisisazeez/first-django-app-for-beginners-part-3templates-static-files-24p5</link>
      <guid>https://dev.to/thisisazeez/first-django-app-for-beginners-part-3templates-static-files-24p5</guid>
      <description>&lt;h6&gt;
  
  
  For this part of tutorial we are going to be building A simple Django Booking(appointment) App!
&lt;/h6&gt;

&lt;p&gt;&lt;strong&gt;Welcome Back!&lt;/strong&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  Let's get started.
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Start by creating a project called appointment&lt;/li&gt;
&lt;li&gt;Also create a app called app&lt;/li&gt;
&lt;li&gt;Register your app in your project folder&lt;/li&gt;
&lt;li&gt;And do your url config.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Pls Get the template folder we are going to be using from&lt;a href="https://github.com/thisisazeez/template"&gt;Link to my Github Profile&lt;/a&gt;
&lt;/h6&gt;

&lt;p&gt;Let's Get Started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Template and Static files Settings.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Step 1: after setting up your django application we will register our template files&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_RNa2jX---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osgq3r94xdbju0b1h28u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_RNa2jX---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osgq3r94xdbju0b1h28u.png" alt="Template Settings" width="800" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Static Files&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c2WLjJPm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hg8u33xgu8rsricrm89d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c2WLjJPm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hg8u33xgu8rsricrm89d.png" alt="Static Settings" width="800" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Urls and Views&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I hope you have already set up your urls if you haven't set it up to see if you can do it if you encounter any error pls comment in the comment section!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;p&gt;1 models.py: &lt;br&gt;
            &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BoQH74YT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yigtaez0muvjdarunqvu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BoQH74YT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yigtaez0muvjdarunqvu.png" alt="models.py" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is models.py:&lt;br&gt;
Models.py is a file that allows us to completely define our database!&lt;/p&gt;

&lt;p&gt;2 views.py:&lt;br&gt;
           &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YMMWeSAz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ss53a4nrfx2lpgqfk0ej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YMMWeSAz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ss53a4nrfx2lpgqfk0ej.png" alt="views.py" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is context in our views.py:&lt;br&gt;
So we imported our models in line 2 of our code and we want to show something from our database so we use context manager to help us render models to view!&lt;/p&gt;

&lt;p&gt;3 urls.py:&lt;br&gt;
          &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1O6tcsjH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00uise11je0ojbcd9ke3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1O6tcsjH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00uise11je0ojbcd9ke3.png" alt="urls.py" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What did we do in urls.py?:&lt;br&gt;
We imported our views file  and used it to create our url&lt;/p&gt;

&lt;p&gt;4 admin.py:&lt;br&gt;
           &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wAInVWLP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjgt1dqy7be527eojvvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wAInVWLP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjgt1dqy7be527eojvvs.png" alt="admin.py" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What just happened in the file:&lt;br&gt;
we imported our model and register it so it can be viewed in the admin site&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Introduction to Django Admin Site *&lt;/em&gt;&lt;br&gt;
What is Django admin?&lt;br&gt;
Django Has a built-in admin site that handles the site management and to log in to the admin site we need to create a superuser to do that we use this command &lt;code&gt;python manage.py createsuperuser&lt;/code&gt; it will throw an error because you haven't make your migrations &lt;br&gt;
to do that we use this command &lt;code&gt;python manage.py makemigrations&lt;/code&gt; the command will initialize your database and then this command &lt;code&gt;python manage.py migrate&lt;/code&gt;to create the necessary tables and columns then you can crate your super user&lt;/p&gt;

&lt;p&gt;now crate your superuser and runserver then go to /admin&lt;/p&gt;

&lt;p&gt;you will discover a page saying login so you enter your superuser credentials and boom a dashboard&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F3Oub7vE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h5rqbh8tgjx5d3wegxn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F3Oub7vE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h5rqbh8tgjx5d3wegxn.png" alt="django admin site" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add some models and play around with it&lt;/strong&gt;&lt;br&gt;
Pls Comment if you encounter any errors&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EEgEVQJ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8d7hr74if6hthe2zeoj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EEgEVQJ9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8d7hr74if6hthe2zeoj.jpg" alt="Catch Ya Later!" width="301" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Play Around With this &lt;strong&gt;Part 4 will contain user authentication and sending mails&lt;/strong&gt; i hope we all have a great understanding of django&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>First Django App For Beginners Part2 (Views &amp; Urls)</title>
      <dc:creator>Abdul Azeez</dc:creator>
      <pubDate>Tue, 26 Oct 2021 20:08:47 +0000</pubDate>
      <link>https://dev.to/thisisazeez/first-django-app-for-beginners-part2-views-urls-33p7</link>
      <guid>https://dev.to/thisisazeez/first-django-app-for-beginners-part2-views-urls-33p7</guid>
      <description>&lt;h1&gt;
  
  
  Welcome Back to part 2 of this tutorial I hope we all have a great understanding on Django.
&lt;/h1&gt;

&lt;h6&gt;
  
  
  We will continue from where we stopped in the last tutorial if you are just joining please checkout part1 of this tutorial &lt;a href="https://dev.to/thisisazeez/first-django-app-for-beginners-part1-setup-installation-3981"&gt;part1 of this tutorial&lt;/a&gt;
&lt;/h6&gt;

&lt;h6&gt;
  
  
  Let's get started!
&lt;/h6&gt;

&lt;h1&gt;
  
  
  What is views in Django?
&lt;/h1&gt;

&lt;p&gt;A view is simple python function that takes a request and return a http response, the response can either be in html, 404, xml, etc.&lt;/p&gt;

&lt;p&gt;What is Urls in Django?&lt;br&gt;
A urls is a web address e.g(&lt;a href="http://www.example.com"&gt;www.example.com&lt;/a&gt;) that uses your view to know what to show the user on a web page&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Before you can start with your views you have to create a urls.py file in your application folder like this below&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;App Forlder Structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/
    __init__.py
    admin.py
    apps.py
    migrations/
        __init__.py
    models.py
    tests.py
    views.py
    urls.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Writing our first view&lt;/strong&gt;&lt;br&gt;
app/views.py&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.shortcuts import render
from django.http import HttpResponse
def home(request):
    return HttpResponse("&amp;lt;h1&amp;gt;A simple views!&amp;lt;/h1&amp;gt;")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Setting up our urls&lt;/strong&gt;&lt;br&gt;
first we have to configure our urls.py in our project folder&lt;br&gt;
project/urls.py&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.contrib import admin
from django.urls import path, include # so we can include our app urls


urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('app.urls')), #here

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

&lt;/div&gt;



&lt;p&gt;Then&lt;br&gt;
app/urls.py&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.urls import path
from . import views # importing the view

urlpatterns = [
    path('', views.home, name="home"),
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simple view and url config&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;We will Look at templates and static directory/files in the next tutorial&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>First Django App For Beginners Part1 (setup &amp; installation)</title>
      <dc:creator>Abdul Azeez</dc:creator>
      <pubDate>Sun, 24 Oct 2021 06:39:47 +0000</pubDate>
      <link>https://dev.to/thisisazeez/first-django-app-for-beginners-part1-setup-installation-3981</link>
      <guid>https://dev.to/thisisazeez/first-django-app-for-beginners-part1-setup-installation-3981</guid>
      <description>&lt;p&gt;What is Django?&lt;br&gt;
Django is a high-level Python web framework that encourages  clean development and fast, with pragmatic design.&lt;/p&gt;

&lt;p&gt;Why Django?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Ridiculously fast.&lt;br&gt;
Django was designed to guide developers take projects from intellection to completion as quickly as possible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reassuringly secure.&lt;br&gt;
Django takes security seriously and helps developers avoid many common security mistakes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exceedingly scalable.&lt;br&gt;
Some of the busiest sites on the web ascendancy Django’s ability to quickly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Before You Start make sure you have python installed on your computer.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You must have Python installed on your system if you don't have check out &lt;a href="https://python.org" rel="noopener noreferrer"&gt;link to python.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's Start!&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Step 1: Installation &lt;code&gt;pip install django&lt;/code&gt;&lt;br&gt;
So step 1, will install django on your system&lt;/p&gt;

&lt;p&gt;Step 2: To start a project use this command &lt;code&gt;django-admin startproject mysite&lt;/code&gt; then &lt;code&gt;cd&lt;/code&gt; to wherever the project folder is in and run this command to create a app &lt;code&gt;python manage.py startapp sites&lt;/code&gt; to create a app &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Project Folder Structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysite/
    manage.py
    mysite/
        __init__.py
        settings.py
        urls.py
        asgi.py
        wsgi.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;App Forlder Structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sites/
    __init__.py
    admin.py
    apps.py
    migrations/
        __init__.py
    models.py
    tests.py
    views.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run your server with this command: &lt;code&gt;python manage.py runserver&lt;/code&gt;&lt;br&gt;
You will see a success page like this:&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%2Fuploads%2Farticles%2Fkz652dfwtmg10wfm5oge.jpg" 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%2Fuploads%2Farticles%2Fkz652dfwtmg10wfm5oge.jpg" alt="Success Page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;for you to make changes in your app folder and for it to work you will have to register your app inside your settings.py like this below&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Line 34 in your settings.py file&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'your_app_name_here', # your app(s) goes inside this list
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;h1&gt;
  
  
  Part two will contain views and urls
&lt;/h1&gt;
&lt;/blockquote&gt;

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