

{"id":53522,"date":"2019-04-08T11:30:25","date_gmt":"2019-04-08T06:00:25","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=53522"},"modified":"2021-06-21T12:19:36","modified_gmt":"2021-06-21T06:49:36","slug":"django-urls-and-urlconf","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/","title":{"rendered":"Django URLs and URLConf &#8211; Learn to Map URL Patterns to View Function in 10 Minutes"},"content":{"rendered":"<p>In the last tutorial, we learned about<a href=\"https:\/\/data-flair.training\/blogs\/django-admin-interface\/\"><strong> Django Admin Interface<\/strong><\/a>, now in this tutorial will introduce you to the concept of URLs in Django and how you can connect different files with your Django Project.<\/p>\n<p>Also, we will learn different ways of connecting our project components with each other, while maintaining the practices of a professional developer.<\/p>\n<h3>What is a URL?<\/h3>\n<p>URL stands for Uniform Resource Locator. It is the address used by your server to search for the right webpage.<\/p>\n<p>All the servers take the URL which you searched in the browser and via that server, provides you the correct result and if they don\u2019t find anything matching the URL, it will show 404 FILE NOT FOUND ERROR.<\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/django-features\/\">Explore Unique Features of Django<\/a><\/strong><\/p>\n<h2>URLs in Django<\/h2>\n<h3>How does Django Server interpret URLs?<\/h3>\n<p>Django interprets URLs in a rather different way, the URLs in Django are in the format of regular expressions, which are easily readable by humans than the traditional URLs of PHP frameworks.<\/p>\n<p><strong>Regular Expressions<\/strong><\/p>\n<p>A Regular Expression also called RegEx is a format for search pattern which is much cleaner and easy to read for the humans and is very logical.<\/p>\n<p>That\u2019s important because it makes the <strong><a href=\"https:\/\/data-flair.training\/blogs\/seo-tutorial\/\">process of SEO<\/a><\/strong> much easier then it would be with the traditional URL approach which contains much more special characters.<\/p>\n<p>We will understand the regular expression along the way in the tutorial.<\/p>\n<h3>How does the URL get searched and the file is delivered?<\/h3>\n<p>When we search for a URL in the URL Bar like this:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/URL.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-53568 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/URL.png\" alt=\"Django URLs &amp; URLConfig - URL\" width=\"441\" height=\"42\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/URL.png 441w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/URL-150x14.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/URL-300x29.png 300w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><\/a><\/p>\n<p>The same URL is passed to the server after DNS connects us to the appropriate server. While your Django-server is running, it will receive the URL and search for the URL in the urls.py file or the value in the <strong>ROOT_URLCONF variable<\/strong>.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/ROOT-URLCONF-Variable.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-53569\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/ROOT-URLCONF-Variable.png\" alt=\"Django URLs &amp; URLConfig - ROOT URLCONF Variable\" width=\"1045\" height=\"354\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/ROOT-URLCONF-Variable.png 1045w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/ROOT-URLCONF-Variable-150x51.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/ROOT-URLCONF-Variable-300x102.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/ROOT-URLCONF-Variable-768x260.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/ROOT-URLCONF-Variable-1024x347.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/ROOT-URLCONF-Variable-520x176.png 520w\" sizes=\"auto, (max-width: 1045px) 100vw, 1045px\" \/><\/a><\/p>\n<p>As from the name, this variable contains the address of the urls.py file. The server will now match the urls from that file.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-in-pycache.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-53576 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-in-pycache.png\" alt=\"Django URLs - urls.py file in pycache\" width=\"238\" height=\"127\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-in-pycache.png 238w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-in-pycache-150x80.png 150w\" sizes=\"auto, (max-width: 238px) 100vw, 238px\" \/><\/a><\/p>\n<p>Your server will now look for the URL patterns inside the urls.py file.<\/p>\n<p>Inside the file, you will find this code and a very useful comment section.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Inside-urlspy-file-.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-53571 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Inside-urlspy-file-.png\" alt=\"Django URLs - Inside urlspy file\" width=\"574\" height=\"227\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Inside-urlspy-file-.png 574w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Inside-urlspy-file--150x59.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Inside-urlspy-file--300x119.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Inside-urlspy-file--520x206.png 520w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/a><\/p>\n<p>This is a list urlpatterns and name is the convention which should not be changed. In this list, we will be adding all the urls and patterns to be available for searching on our website.<\/p>\n<p>In this file, the Django server matches the Regular Expression with the given URL, like \u2018admin\/\u2019 in the path function parameter. Here you may wonder that it&#8217;s not the site URL. Actually, it snips off the part of URL till website and only searches for the remaining part of URL.<\/p>\n<p>Then it redirects the page to the provided webpage or <strong><a href=\"https:\/\/data-flair.training\/blogs\/file-handling-in-python\/\">python file<\/a><\/strong> \u2018admin.site.urls\u2019 in the second parameter, which will finally reach the views like functions and class objects or even another urls will return appropriate template.<\/p>\n<h2>Modifying\u00a0urls.py file<\/h2>\n<p>The urls.py file in Django is like the address book of your Django website. It stores all the web addresses for your website. It connects that to some view component or any other urls-conf file for a certain application.<\/p>\n<h3>Importing the view function<\/h3>\n<p>We will be learning the steps to import the view functions and connecting different url-conf files with the main urls.py file.<\/p>\n<p>A URLconf is similar to a table of contents for our Django-powered web site. It\u2019s a mapping between URL patterns and the <strong><a href=\"https:\/\/data-flair.training\/blogs\/django-views\/\">view functions<\/a><\/strong> that need to be called for those URLs.<\/p>\n<p>First, we will have to import the view function that we want our server to run when the URL is matched. For that, we have to import the function from the views.py file.<\/p>\n<p>In our case, we are assuming it is in the same directory as of the urls.py file. Although if it&#8217;s in another app we will have a different approach.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-53572 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file.png\" alt=\"Django URLs - urls.py file\" width=\"182\" height=\"132\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file.png 182w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-150x109.png 150w\" sizes=\"auto, (max-width: 182px) 100vw, 182px\" \/><\/a><\/p>\n<p>Then just type in this code in views.py file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">from django.http import HttpResponse\r\n\r\ndef index(request):\r\n    html = \u201c\u201d\u201d&lt;h1&gt;Data Flair Django&lt;\/h1&gt;Hello, you just configured you First URL\u201d\u201d\u201d\r\n    return HttpResponse(html)<\/pre>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-dataflair-django.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-53913\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-dataflair-django.png\" alt=\"Output of dataflair django\" width=\"945\" height=\"222\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-dataflair-django.png 945w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-dataflair-django-150x35.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-dataflair-django-300x70.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-dataflair-django-768x180.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-dataflair-django-520x122.png 520w\" sizes=\"auto, (max-width: 945px) 100vw, 945px\" \/><\/a><\/p>\n<p>Then we just have to modify our Django\u00a0urls.py file that\u2019s very easy.<\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/django-mtv-architecture\/\">Understand the components of Django MTV Architecture<\/a><\/strong><\/p>\n<p>For that, we will first import the index function from our view file in the urls.py. Then, in the next step, we can add another element in the list with some parameters.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">from .views import index<\/pre>\n<p>This will import the index function from the views.py file.<\/p>\n<p>Then inside the urlpatterns list, add this item as:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">path(\u201cdataflair\/\u201d, index)<\/pre>\n<p>This function has different parameters for different cases since here we are passing a view function directly as we have imported the same. The first argument here is the URL you are going to search and it can be anything you want, I have kept it like this.<\/p>\n<p>At times, you will need to import the view file itself rather than the function. We will learn that process in upcoming tutorials.<\/p>\n<p><strong>Must Learn<\/strong> &#8211; <strong><a href=\"https:\/\/data-flair.training\/blogs\/django-models\/\">Creating Your First Django Model<\/a><\/strong><\/p>\n<p>Your urls.py file should look like this:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-look.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-53574 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-look.png\" alt=\"Django URLs - urls.py file look\" width=\"565\" height=\"253\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-look.png 565w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-look-150x67.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-look-300x134.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/urlspy-file-look-520x233.png 520w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><\/p>\n<p>Now you just have to start your Django server.<br \/>\nWe all know the command, that is<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">python manage.py runserver<\/pre>\n<p>Then open the browser and search the URL:<\/p>\n<p>localhost:8000\/dataflair\/<\/p>\n<p>This shall give you this output<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Final-Output-of-Dataflair-Django.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-53914\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Final-Output-of-Dataflair-Django.png\" alt=\"Final Output of Dataflair Django\" width=\"1920\" height=\"1030\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Final-Output-of-Dataflair-Django.png 1920w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Final-Output-of-Dataflair-Django-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Final-Output-of-Dataflair-Django-300x161.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Final-Output-of-Dataflair-Django-768x412.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Final-Output-of-Dataflair-Django-1024x549.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Final-Output-of-Dataflair-Django-520x279.png 520w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>That\u2019s it, now practice some more functions to import. Then, you will be able to understand the workflow of the Django Framework more easily.<\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/top-django-books\/\">Explore Django Books to learn Web Development in Django<\/a><\/strong><\/p>\n<h2>Summary<\/h2>\n<p>In this tutorial, we learned how to connect Django views to Django URLs and made a simple webpage based on that.<\/p>\n<p>In further tutorials, we will be learning about page redirect and cookies handling in <strong><a href=\"https:\/\/code.djangoproject.com\/\">Django<\/a><\/strong>. If you have any questions related to Django URLs tutorial, you can ask in the comment section.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1598,&quot;href&quot;:&quot;https:\\\/\\\/code.djangoproject.com&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250925190831\\\/https:\\\/\\\/code.djangoproject.com\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 12:53:13&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-19 14:12:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-13 01:39:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-09 21:42:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-17 18:36:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 19:12:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-10 09:51:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-07 13:06:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-14 16:21:07&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-18 11:25:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-25 07:08:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-09 04:02:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-22 11:38:47&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-29 11:01:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-07-03 05:03:52&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-03 05:03:52&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last tutorial, we learned about Django Admin Interface, now in this tutorial will introduce you to the concept of URLs in Django and how you can connect different files with your Django&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":53577,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19149],"tags":[19422,19420,19423],"class_list":["post-53522","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-django","tag-django-url-mapping","tag-django-urls","tag-using-urlconf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Django URLs and URLConf - Learn to Map URL Patterns to View Function in 10 Minutes - DataFlair<\/title>\n<meta name=\"description\" content=\"Django Urls Tutorial covers the interpretation of urls by Django server, and mapping between URL patterns and view function with the help of url.conf.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Django URLs and URLConf - Learn to Map URL Patterns to View Function in 10 Minutes - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Django Urls Tutorial covers the interpretation of urls by Django server, and mapping between URL patterns and view function with the help of url.conf.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-08T06:00:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-21T06:49:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Django-URLs-and-URLConf.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1201\" \/>\n\t<meta property=\"og:image:height\" content=\"629\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Django URLs and URLConf - Learn to Map URL Patterns to View Function in 10 Minutes - DataFlair","description":"Django Urls Tutorial covers the interpretation of urls by Django server, and mapping between URL patterns and view function with the help of url.conf.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/","og_locale":"en_US","og_type":"article","og_title":"Django URLs and URLConf - Learn to Map URL Patterns to View Function in 10 Minutes - DataFlair","og_description":"Django Urls Tutorial covers the interpretation of urls by Django server, and mapping between URL patterns and view function with the help of url.conf.","og_url":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-04-08T06:00:25+00:00","article_modified_time":"2021-06-21T06:49:36+00:00","og_image":[{"width":1201,"height":629,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Django-URLs-and-URLConf.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Django URLs and URLConf &#8211; Learn to Map URL Patterns to View Function in 10 Minutes","datePublished":"2019-04-08T06:00:25+00:00","dateModified":"2021-06-21T06:49:36+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/"},"wordCount":954,"commentCount":2,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Django-URLs-and-URLConf.jpg","keywords":["Django URL Mapping","Django URLs","Using URLconf"],"articleSection":["Django Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/","url":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/","name":"Django URLs and URLConf - Learn to Map URL Patterns to View Function in 10 Minutes - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Django-URLs-and-URLConf.jpg","datePublished":"2019-04-08T06:00:25+00:00","dateModified":"2021-06-21T06:49:36+00:00","description":"Django Urls Tutorial covers the interpretation of urls by Django server, and mapping between URL patterns and view function with the help of url.conf.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Django-URLs-and-URLConf.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Django-URLs-and-URLConf.jpg","width":1201,"height":629,"caption":"Django URLs and URLConf"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/django-urls-and-urlconf\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Django Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/django\/"},{"@type":"ListItem","position":3,"name":"Django URLs and URLConf &#8211; Learn to Map URL Patterns to View Function in 10 Minutes"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/53522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=53522"}],"version-history":[{"count":11,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/53522\/revisions"}],"predecessor-version":[{"id":54083,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/53522\/revisions\/54083"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/53577"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=53522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=53522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=53522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}