{"id":5535,"date":"2022-11-15T01:17:57","date_gmt":"2022-11-15T01:17:57","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=5535"},"modified":"2023-11-01T00:20:13","modified_gmt":"2023-11-01T00:20:13","slug":"getting-started-with-django","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/django-tutorial\/getting-started-with-django\/","title":{"rendered":"Getting Started with Django"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to create a new Django project, understand the project structure, and launch the Django web app from a web browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='django-overview'>Django overview <a href=\"#django-overview\" class=\"anchor\" id=\"django-overview\" title=\"Anchor for Django overview\">#<\/a><\/h2>\n\n\n\n<p>Django is a <a href=\"https:\/\/www.djangoproject.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python web framework<\/a> that includes a set of components for solving common web development problems.<\/p>\n\n\n\n<p>Django allows you to rapidly develop web applications with less code by taking advantage of its framework.<\/p>\n\n\n\n<p>Django follows the DRY (don&#8217;t repeat yourself) principle, which allows you to maximize the code reusability.<\/p>\n\n\n\n<p>Django uses the MVT (Model-View-Template) pattern, which is slightly similar to the MVC (Model-View-Controller) pattern.<\/p>\n\n\n\n<p>The MVT pattern consists of three main components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Model &#8211; defines the data or contains the logic that interacts with the data in the database.<\/li>\n\n\n\n<li>View &#8211; communicates with the database via model and transfers data to the template for representing the data.<\/li>\n\n\n\n<li>Template &#8211; defines the template for displaying the data in the web browser.<\/li>\n<\/ul>\n\n\n\n<p>The Django framework itself acts as a controller. The Django framework uses URL patterns that send the request to an appropriate view.<\/p>\n\n\n\n<p>If you are familiar with MVC, the following are equivalent:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Template (T) is equivalent to View (V) in MVC<\/li>\n\n\n\n<li>View (V) is equivalent to Controller (C) in MVC<\/li>\n\n\n\n<li>Model (M) is equivalent to Model (M) in MVC<\/li>\n<\/ul>\n\n\n\n<p>In practice, you&#8217;ll often work with models, views, templates, and URLs in the Django application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='django-architecture'>Django architecture <a href=\"#django-architecture\" class=\"anchor\" id=\"django-architecture\" title=\"Anchor for Django architecture\">#<\/a><\/h2>\n\n\n\n<p>The following picture shows how Django manages the HTTP request\/response cycle using its components:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/Getting-Started-with-Django-django-framework.svg\" alt=\"\" class=\"wp-image-5536\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, a web browser requests a page specified by a URL from a web server. The web server passes the HTTP request to Django.<\/li>\n\n\n\n<li>Second, Django matches the URL with URL patterns to find the first match.<\/li>\n\n\n\n<li>Third, Django calls the View that corresponds to the matched URL.<\/li>\n\n\n\n<li>Fourth, the view uses a model to retrieve data from the database.<\/li>\n\n\n\n<li>Fifth, the model returns data to the view.<\/li>\n\n\n\n<li>Finally, the view renders a template and returns it as an HTTP response.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='creating-a-virtual-environment'>Creating a virtual environment <a href=\"#creating-a-virtual-environment\" class=\"anchor\" id=\"creating-a-virtual-environment\" title=\"Anchor for Creating a virtual environment\">#<\/a><\/h2>\n\n\n\n<p>A virtual environment creates an isolated environment that consists of an independent set of Python packages. <\/p>\n\n\n\n<p>By using virtual environments, you can have multiple projects that use different versions of Django. Also, when moving the project to a different server, you can install all the dependent packages of the project using a single <code>pip<\/code> command.<\/p>\n\n\n\n<p>The following steps show you how to create a virtual environment for a Django project using the <a href=\"https:\/\/www.pythontutorial.net\/python-basics\/python-virtual-environments\/\">built-in venv<\/a> module:<\/p>\n\n\n\n<p>First, create a new directory <code>django-playground<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">mkdir django-playground<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, navigate to the <code>django-playground<\/code> directory:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">cd django-playground<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, create a new virtual environment using the <code>venv<\/code> module:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">python -m venv venv<\/code><\/span><\/pre>\n\n\n<p>Fourth, activate the virtual environment:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">venv\\scripts\\activate<\/code><\/span><\/pre>\n\n\n<p>The terminal will show the following:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">(venv) D:\\django-playground&gt;<\/code><\/span><\/pre>\n\n\n<p>Note that you can deactivate the virtual environment using the <code>deactivate<\/code> command:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">deactivate<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='install-the-django-package'>Install the Django package <a href=\"#install-the-django-package\" class=\"anchor\" id=\"install-the-django-package\" title=\"Anchor for Install the Django package\">#<\/a><\/h2>\n\n\n\n<p>Since Django is a third-party package, you need to install it by following these steps:<\/p>\n\n\n\n<p>First, issue the following <code>pip<\/code> command to install the Django package:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">pip install django<\/code><\/span><\/pre>\n\n\n<p>Second, check the Django version:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">python -m django --version<\/code><\/span><\/pre>\n\n\n<p>It&#8217;ll show something like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\">4<span class=\"hljs-selector-class\">.1<\/span><span class=\"hljs-selector-class\">.1<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Notice that you likely see a higher version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='exploring-django-commands'>Exploring Django commands <a href=\"#exploring-django-commands\" class=\"anchor\" id=\"exploring-django-commands\" title=\"Anchor for Exploring Django commands\">#<\/a><\/h2>\n\n\n\n<p>Django comes with a command-line utility program called <code>django-admin<\/code> that manages administrative tasks such as creating a new project and running the Django development server.<\/p>\n\n\n\n<p>To list all available Django commands, you execute the following <code>django-admin<\/code> command like this:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">django-admin<\/code><\/span><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">Type 'django-admin help &lt;subcommand&gt;' for help on a specific subcommand.\n\nAvailable subcommands:\n\n&#91;django]\n    check\n    compilemessages\n    createcachetable\n    dbshell\n    diffsettings\n    dumpdata\n    flush\n    inspectdb\n    loaddata\n    makemessages\n    makemigrations\n    migrate\n    optimizemigration\n    runserver\n    sendtestemail\n    shell\n    showmigrations\n    sqlflush\n    sqlmigrate\n    sqlsequencereset\n    squashmigrations\n    startapp\n    startproject\n    test\n    testserver<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>For now, we&#8217;re interested in the <code>startproject<\/code> command that creates a new Django project. The following <code>startproject<\/code> command creates a new project called <code>django_project<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">django-admin startproject django_project<\/code><\/span><\/pre>\n\n\n<p>This command creates a <code>django_project<\/code> directory. <\/p>\n\n\n\n<p>Let&#8217;s explore the project structure:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">cd django_project<\/code><\/span><\/pre>\n\n\n<p>The following shows the <code>django_project<\/code> structure:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">\u251c\u2500\u2500 django_project\n| \u251c\u2500\u2500 asgi.py\n| \u251c\u2500\u2500 settings.py\n| \u251c\u2500\u2500 urls.py\n| \u251c\u2500\u2500 wsgi.py\n| \u2514\u2500\u2500 __init__.py\n\u2514\u2500\u2500 manage.py<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Here&#8217;s a quick overview of each file in the Django project:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>manage.py<\/code> is a command-line program that you use to interact with the project like starting a development server and making changes to the database.<\/li>\n<\/ul>\n\n\n\n<p>The <code>django_project<\/code> is a Python package that consists of the following files:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>__init__.py<\/code> &#8211; is an empty file indicating that the <code>django_project<\/code> directory is a package.<\/li>\n\n\n\n<li><code>settings.py<\/code> &#8211; contains the project settings such as installed applications, database connections, and template directories.<\/li>\n\n\n\n<li><code>urls.py<\/code> &#8211; stores a list of routes that map URLs to views.<\/li>\n\n\n\n<li><code>wsgi.py<\/code> &#8211; contains the configurations that run the project as a web server gateway interface (WSGI) application with WSGI-compatible web servers.<\/li>\n\n\n\n<li><code>asgi.py<\/code> &#8211; contains the configurations that run the project as an asynchronous web server gateway interface (AWSGI) application with AWSGI-compatible web servers.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='running-the-django-development-server'>Running the Django development server <a href=\"#running-the-django-development-server\" class=\"anchor\" id=\"running-the-django-development-server\" title=\"Anchor for Running the Django development server\">#<\/a><\/h2>\n\n\n\n<p>Django comes with a built-in web server that allows you to quickly run your Django project for development purposes.<\/p>\n\n\n\n<p>The Django development web server will continuously check for code changes and reload the project automatically. However, you still need to restart the web server manually in some cases such as adding new files to the project.<\/p>\n\n\n\n<p>To run the Django development server, you use the <code>runserver<\/code> command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">python<\/span> <span class=\"hljs-selector-tag\">manage<\/span><span class=\"hljs-selector-class\">.py<\/span> <span class=\"hljs-selector-tag\">runserver<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext shcb-code-table\"><span class='shcb-loc'><span>Watching for file changes with StatReloader\n<\/span><\/span><span class='shcb-loc'><span>Performing system checks...\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><span class='shcb-loc'><span>System check identified no issues (0 silenced).\n<\/span><\/span><span class='shcb-loc'><span>...\n<\/span><\/span><span class='shcb-loc'><span>Django version 4.1.1, using settings 'django_project.settings'\n<\/span><\/span><mark class='shcb-loc'><span>Starting development server at http:\/\/127.0.0.1:8000\/\n<\/span><\/mark><span class='shcb-loc'><span>Quit the server with CTRL-BREAK.\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Once the server is up and running, you can open the web app using the URL listed in the output. Typically, the URL is something like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">http:<span class=\"hljs-comment\">\/\/127.0.0.1:8000\/<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, you can copy and paste the URL to a web browser. It should show the following webpage:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"604\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-1024x604.png\" alt=\"\" class=\"wp-image-5537\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-1024x604.png 1024w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-300x177.png 300w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-768x453.png 768w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started.png 1530w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The <code>urls.py<\/code> contains a default route that maps <code>\/admin<\/code> path with the <code>admin.site.urls<\/code> view:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-keyword\">from<\/span> django.contrib <span class=\"hljs-keyword\">import<\/span> admin\n<span class=\"hljs-keyword\">from<\/span> django.urls <span class=\"hljs-keyword\">import<\/span> path\n\nurlpatterns = &#91;\n    path(<span class=\"hljs-string\">'admin\/'<\/span>, admin.site.urls),\n]<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To open the <a href=\"https:\/\/www.pythontutorial.net\/django-tutorial\/django-admin-page\/\">admin page<\/a>, you use the following URL:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">http:<span class=\"hljs-comment\">\/\/127.0.0.1:8000\/admin<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>It&#8217;ll show a login page:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"589\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-login-1024x589.png\" alt=\"django getting started - login\" class=\"wp-image-5540\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-login-1024x589.png 1024w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-login-300x173.png 300w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-login-768x442.png 768w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2022\/11\/django-getting-started-login.png 1203w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='stop-the-django-development-server'>Stop the Django development server <a href=\"#stop-the-django-development-server\" class=\"anchor\" id=\"stop-the-django-development-server\" title=\"Anchor for Stop the Django development server\">#<\/a><\/h2>\n\n\n\n<p>To stop the Django development server, you open the terminal and press the Ctrl-C (or Command-C)  <em>twice<\/em>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='create-requirements-txt-file'>Create requirements.txt file <a href=\"#create-requirements-txt-file\" class=\"anchor\" id=\"create-requirements-txt-file\" title=\"Anchor for Create requirements.txt file\">#<\/a><\/h2>\n\n\n\n<p>The <code>requirements.txt<\/code> file contains all dependencies for a specific Django project. It also contains the dependencies of dependencies. <\/p>\n\n\n\n<p>To create a <code>requirements.txt<\/code> file, you run the following <code>pip<\/code> command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">pip freeze &gt; requirements.txt<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When you move the project to a new server e.g., a test or production server, you can install all the dependencies used by the current Django project using the following <code>pip<\/code> command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\">pip install -r requirements.txt<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"note\"><a href=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/01\/django_project.zip\" target=\"_blank\" rel=\"noreferrer noopener\">Download the Django Project source code<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Django is a Python web framework that allows you to rapidly develop web applications.<\/li>\n\n\n\n<li>Django uses the MVT (Model-View-Template) pattern, which is similar to the MVC (Model-View-Controller) pattern.<\/li>\n\n\n\n<li>Use the <code>django-admin startproject new_project<\/code> command to create a new project.<\/li>\n\n\n\n<li>Use the <code>python manage.py runserver<\/code> command to run the project using the Django development web server.<\/li>\n\n\n\n<li>Press Ctrl-C (or Cmd-C) to stop the Django development web server.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"5535\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/django-tutorial\/getting-started-with-django\/\"\n\t\t\t\tdata-post-title=\"Getting Started with Django\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"5535\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/django-tutorial\/getting-started-with-django\/\"\n\t\t\t\tdata-post-title=\"Getting Started with Django\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to create a new Django project, understand the project structure, and launch the Django web app from a web browser.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5531,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5535","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/5535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=5535"}],"version-history":[{"count":0,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/5535\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/5531"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=5535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}