{"id":5278,"date":"2018-07-06T18:19:17","date_gmt":"2018-07-06T14:19:17","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/docker-guide-dockerizing-python-django-application\/"},"modified":"2018-07-06T18:19:17","modified_gmt":"2018-07-06T14:19:17","slug":"docker-guide-dockerizing-python-django-application","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/docker-guide-dockerizing-python-django-application\/","title":{"rendered":"Docker Guide: Dockerizing Python Django Application"},"content":{"rendered":"<p>Docker is an open-source project that provides an open platform for developers and sysadmins to build, package, and run applications anywhere as a lightweight container. Docker automates the deployment of applications inside software containers.<\/p>\n<p>Django is a web application framework written in python that follows the MVC (Model-View-Controller) architecture. It is available for free and released under an open source license. It is fast and designed to help developers get their application online as quickly as possible.<\/p>\n<p>In this tutorial, I will show you step-by-step how to create a docker image for an existing Django application project in Ubuntu 16.04. We will learn about dockerizing\u00a0a python Django application, and then deploy the application as a container to the docker environment using a docker-compose script.<\/p>\n<p>In order to deploy our python Django application, we need additional docker images. We need an\u00a0nginx docker image for the web server and PostgreSQL image for the database.<\/p>\n<h2 id=\"what-we-will-do\">What we will do?<\/h2>\n<ol>\n<li>Install Docker-ce<\/li>\n<li>Install Docker-compose<\/li>\n<li>Configure Project Environment<\/li>\n<li>Build and Run<\/li>\n<li>Testing<\/li>\n<\/ol>\n<h2 id=\"step-install-dockerce\">Step 1 &#8211; Install Docker-ce<\/h2>\n<p>In this tutorial, we will install docker-ce community edition from the docker repository. We will install docker-ce community edition and docker-compose that support compose file version 3.<\/p>\n<p>Before installing docker-ce, install docker dependencies needed using the apt command.<\/p>\n<p class=\"command\">sudo apt install -y \\<br \/>\u00a0\u00a0\u00a0 apt-transport-https \\<br \/>\u00a0\u00a0\u00a0 ca-certificates \\<br \/>\u00a0\u00a0\u00a0 curl \\<br \/>\u00a0\u00a0\u00a0 software-properties-common<\/p>\n<p>Now add the docker key and repository by running commands below.<\/p>\n<p class=\"command\">curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add &#8211;<br \/>sudo add-apt-repository \\<br \/>\u00a0\u00a0 &#8220;deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu \\<br \/>\u00a0\u00a0 $(lsb_release -cs) \\<br \/>\u00a0\u00a0 stable&#8221;<\/p>\n<p><a class=\"fancybox\" id=\"img-1\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application.png\" alt=\"Install Docker-ce\" width=\"500\" height=\"136\" title=\"\"><\/a><\/p>\n<p>Update the repository and install docker-ce.<\/p>\n<p class=\"command\">sudo apt update<br \/>sudo apt install -y docker-ce<\/p>\n<p>After the installation is complete, start the docker service and enable it to launch every time at system boot.<\/p>\n<p class=\"command\">systemctl start docker<br \/>systemctl enable docker<\/p>\n<p>Next, we will add a new user named &#8216;omar&#8217; and add it to the docker group.<\/p>\n<p class=\"command\">useradd -m -s \/bin\/bash omar<br \/>usermod -a -G docker omar<\/p>\n<p><a class=\"fancybox\" id=\"img-2\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-1.png\" alt=\"Start Docker\" width=\"500\" height=\"117\" title=\"\"><\/a><\/p>\n<p>Login as the omar user and run docker command as shown below.<\/p>\n<p class=\"command\">su &#8211; omar<br \/>docker run hello-world<\/p>\n<p>Make sure you get the hello-world message from Docker.<\/p>\n<p><a class=\"fancybox\" id=\"img-3\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-2.png\" alt=\"Check Docker installation\" width=\"500\" height=\"458\" title=\"\"><\/a><\/p>\n<p>Docker-ce installation has been completed.<\/p>\n<h2 id=\"step-install-dockercompose\">Step 2 &#8211; Install Docker-compose<\/h2>\n<p>In this tutorial, we will be using the latest docker-compose support for compose file version 3. We will install docker-compose manually.<\/p>\n<p>Download the latest version of docker-compose using curl command to the &#8216;\/usr\/local\/bin&#8217; directory and make it executable using chmod.<\/p>\n<p>Run commands below.<\/p>\n<p class=\"command\">sudo curl -L https:\/\/github.com\/docker\/compose\/releases\/download\/1.21.0\/docker-compose-$(uname -s)-$(uname -m) -o \/usr\/local\/bin\/docker-compose<br \/>sudo chmod +x \/usr\/local\/bin\/docker-compose<\/p>\n<p>Now check the docker-compose version.<\/p>\n<p class=\"command\">docker-compose version<\/p>\n<p>And make sure you get the latest version of the docker-compose 1.21.<\/p>\n<p><a class=\"fancybox\" id=\"img-4\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-3.png\" alt=\"Install Docker-compose\" width=\"500\" height=\"144\" title=\"\"><\/a><\/p>\n<p>The docker-compose latest version that supports compose file version 3 has been installed.<\/p>\n<h2 id=\"step-configure-project-environment\">Step 3 &#8211; Configure Project Environment<\/h2>\n<p>In this step, we will configure the python Django project environment. We will create new directory &#8216;guide01&#8217; and make it as the main directory for our project files, such as a Dockerfile, Django project, nginx configuration file etc.<\/p>\n<p>Login to the &#8216;omar&#8217; user.<\/p>\n<p class=\"command\">su &#8211; omar<\/p>\n<p>Create new directory &#8216;guide01&#8217; and go to the directory.<\/p>\n<p class=\"command\">mkdir -p guide01<br \/>cd guide01\/<\/p>\n<p>Now inside the &#8216;guide01&#8217; directory, create new directories &#8216;project&#8217; and &#8216;config&#8217;.<\/p>\n<p class=\"command\">mkdir project\/ config\/<\/p>\n<p><strong>Note:<\/strong><\/p>\n<ul>\n<li>Directory &#8216;project&#8217;: All our python Django project files will be placed in that directory.<\/li>\n<li>Directory &#8216;config&#8217;: Directory for the project configuration files, including nginx configuration file, python pip requirements file etc.<\/li>\n<\/ul>\n<h3 id=\"create-a-new-requirementstxt-file\">Create a New requirements.txt file<\/h3>\n<p>Next, create new file &#8216;requirements.txt&#8217; inside the &#8216;config&#8217; directory using vim command.<\/p>\n<p class=\"command\">vim config\/requirements.txt<\/p>\n<p>Paste the configuration below.<\/p>\n<pre class=\"system\">Django==2.0.4\u00a0 <br\/>gunicorn==19.7.0\u00a0 <br\/>psycopg2==2.7.4<\/pre>\n<p>Save and exit.<\/p>\n<h3 id=\"create-the-nginx-virtual-host-file-djangoconf\">Create the Nginx virtual host file django.conf<\/h3>\n<p>Under the config directory, create the &#8216;nginx&#8217; configuration directory and add the virtual host configuration file django.conf.<\/p>\n<p class=\"command\">mkdir -p config\/nginx\/<br \/>vim config\/nginx\/django.conf<\/p>\n<p>Paste the following configuration there.<\/p>\n<pre class=\"system\" readability=\"8\">upstream web {<br\/>\u00a0 ip_hash;<br\/>\u00a0 server web:8000;<br\/>}<p># portal<br\/>server {<br\/>\u00a0 location \/ {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 proxy_pass http:\/\/web\/;<br\/>\u00a0\u00a0\u00a0 }<br\/>\u00a0 listen 8000;<br\/>\u00a0 server_name localhost;<\/p><p>\u00a0 location \/static {\u00a0\u00a0\u00a0 <br\/>\u00a0\u00a0\u00a0 autoindex on;\u00a0\u00a0\u00a0 <br\/>\u00a0\u00a0\u00a0 alias \/src\/static\/;\u00a0\u00a0\u00a0 <br\/>\u00a0 }<br\/>}<\/p><\/pre>\n<p>Save and exit.<\/p>\n<h3 id=\"create-the-dockerfile\">Create the Dockerfile<\/h3>\n<p>Create new &#8216;Dockerfile&#8217; inside the &#8216;guide01&#8217; directory.<\/p>\n<p>Run the command below.<\/p>\n<p class=\"command\">vim Dockerfile<\/p>\n<p>Now paste Dockerfile script below.<\/p>\n<pre class=\"system\" readability=\"9\">FROM python:3.5-alpine<br\/>ENV PYTHONUNBUFFERED 1\u00a0 <p>RUN apk update &amp;&amp; \\<br\/>\u00a0\u00a0\u00a0 apk add --virtual build-deps gcc python-dev musl-dev &amp;&amp; \\<br\/>\u00a0\u00a0\u00a0 apk add postgresql-dev bash<\/p><p>RUN mkdir \/config\u00a0 <br\/>ADD \/config\/requirements.txt \/config\/\u00a0 <br\/>RUN pip install -r \/config\/requirements.txt<br\/>RUN mkdir \/src<br\/>WORKDIR \/src<\/p><\/pre>\n<p>Save and exit.<\/p>\n<p><strong>Note:<\/strong><\/p>\n<p>We want to build the Docker images for our Django project based on Alpine Linux, the smallest size of Linux. Our Django project will run Alpine Linux with python 3.5 installed on top of it and add the postgresql-dev package for the PostgreSQL database support. And then we will install all python packages listed on the &#8216;requirements.txt&#8217; file using python pip command, and create new &#8216;\/src&#8217; for our project.<\/p>\n<h3 id=\"create-dockercompose-script\">Create Docker-compose script<\/h3>\n<p>Create the &#8216;docker-compose.yml&#8217; file under the &#8216;guide01&#8217; directory using\u00a0<a href=\"https:\/\/www.howtoforge.com\/vim-basics\" target=\"_blank\" rel=\"noopener noreferrer\">vim<\/a> command below.<\/p>\n<p class=\"command\">vim docker-compose.yml<\/p>\n<p>Paste the following configuration there.<\/p>\n<pre class=\"system\">version: '3'<br\/>services:<br\/>\u00a0 db:<br\/>\u00a0\u00a0\u00a0 image: postgres:10.3-alpine<br\/>\u00a0\u00a0\u00a0 container_name: postgres01<br\/>\u00a0 nginx:<br\/>\u00a0\u00a0\u00a0 image: nginx:1.13-alpine<br\/>\u00a0\u00a0\u00a0 container_name: nginx01<br\/>\u00a0\u00a0\u00a0 ports:<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 - \"8000:8000\"<br\/>\u00a0\u00a0\u00a0 volumes:<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 - .\/project:\/src<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 - .\/config\/nginx:\/etc\/nginx\/conf.d<br\/>\u00a0\u00a0\u00a0 depends_on:<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 - web<br\/>\u00a0 web:<br\/>\u00a0\u00a0\u00a0 build: .<br\/>\u00a0\u00a0\u00a0 container_name: django01<br\/>\u00a0\u00a0\u00a0 command: bash -c \"python manage.py makemigrations &amp;&amp; python manage.py migrate &amp;&amp; python manage.py collectstatic --noinput &amp;&amp; gunicorn hello_django.wsgi -b 0.0.0.0:8000\"<br\/>\u00a0\u00a0\u00a0 depends_on:<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 - db<br\/>\u00a0\u00a0\u00a0 volumes:<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 - .\/project:\/src<br\/>\u00a0\u00a0\u00a0 expose:<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0 - \"8000\"<br\/>\u00a0\u00a0\u00a0 restart: always<\/pre>\n<p>Save and exit.<\/p>\n<p><strong>Note:<\/strong><\/p>\n<p>With this docker-compose file script, we will create three services. Create the database service named &#8216;db&#8217; using the PostgreSQL alpine Linux, create the &#8216;nginx&#8217; service using the Nginx alpine Linux again, and create our python Django container using the custom docker images generated from our Dockerfile.<\/p>\n<p><a class=\"fancybox\" id=\"img-5\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-4.png\" alt=\"Configure Project Environment\" width=\"500\" height=\"326\" title=\"\"><\/a><\/p>\n<h3 id=\"configure-django-project\">Configure Django project<\/h3>\n<p>Copy your Django project files to the &#8216;project&#8217; directory.<\/p>\n<p class=\"command\">cd ~\/django<br \/>cp -r * ~\/guide01\/project\/<\/p>\n<p>Go to the &#8216;project&#8217; directory and edit the application setting &#8216;settings.py&#8217;.<\/p>\n<p class=\"command\">cd ~\/guide01\/project\/<br \/>vim hello_django\/settings.py<\/p>\n<p><strong>Note:<\/strong><\/p>\n<p>We will deploy simple Django application called &#8216;hello_django&#8217; app.<\/p>\n<p>On the &#8216;ALLOW_HOSTS&#8217; line, add the service name &#8216;web&#8217;.<\/p>\n<pre class=\"system\">ALLOW_HOSTS = ['web']<\/pre>\n<p>Now change the database settings. We will be using the PostgreSQL database that runs as a service named &#8216;db&#8217; with default user and password.<\/p>\n<pre class=\"system\">DATABASES = {\u00a0 <br\/>\u00a0\u00a0\u00a0 'default': {<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 'ENGINE': 'django.db.backends.postgresql_psycopg2',<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 'NAME': 'postgres',<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 'USER': 'postgres',<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 'HOST': 'db',<br\/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 'PORT': 5432,<br\/>\u00a0\u00a0\u00a0 }<br\/>}<\/pre>\n<p>And for the &#8216;STATIC_ROOT&#8217; configuration directory, add this line to the end of the line of the file.<\/p>\n<pre class=\"system\">STATIC_ROOT = os.path.join(BASE_DIR, 'static\/')<\/pre>\n<p>Save and exit.<\/p>\n<p><a class=\"fancybox\" id=\"img-6\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-5.png\" alt=\"Configure Django project\" width=\"500\" height=\"139\" title=\"\"><\/a><\/p>\n<p>Now we&#8217;re ready to build and run the Django project under the docker container.<\/p>\n<h2 id=\"step-build-and-run-the-docker-image\">Step 4 &#8211; Build and Run the Docker image<\/h2>\n<p>In this step, we want to build a Docker image for our Django project using the configuration on the &#8216;guide01&#8217; directory.<\/p>\n<p>Go to the &#8216;guide01&#8217; directory.<\/p>\n<p class=\"command\">cd ~\/guide01\/<\/p>\n<p>Now build the docker images using the docker-compose command.<\/p>\n<p class=\"command\">docker-compose build<\/p>\n<p><a class=\"fancybox\" id=\"img-7\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-6.png\" alt=\"Run docker image\" width=\"500\" height=\"240\" title=\"\"><\/a><\/p>\n<p>Start all services inside the docker-compose script.<\/p>\n<p class=\"command\">docker-compose up -d<\/p>\n<p>Wait for some minutes for Docker to build our Python image and download the nginx and postgresql docker images.<\/p>\n<p><a class=\"fancybox\" id=\"img-8\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-7.png\" alt=\"Use docker-compose to build the image\" width=\"500\" height=\"435\" title=\"\"><\/a><\/p>\n<p>And when it&#8217;s complete, check running container and list docker images on the system using following commands.<\/p>\n<p class=\"command\">docker-compose ps<br \/>docker-compose images<\/p>\n<p>And now you will get three containers running and list of Docker images on the system as shown below.<\/p>\n<p><a class=\"fancybox\" id=\"img-9\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-8.png\" alt=\"docke-compose ps command\" width=\"500\" height=\"251\" title=\"\"><\/a><\/p>\n<p>Our Python Django Application is now running inside the docker container, and docker images for our service have been created.<\/p>\n<h2 id=\"step-testing\">Step 5 &#8211; Testing<\/h2>\n<p>Open your web browser and type the server address with port 8000, mine is:\u00a0<em><strong>http:\/\/ovh01:8000\/<\/strong><\/em><\/p>\n<p>Now you will get the default Django home page.<\/p>\n<p><a class=\"fancybox\" id=\"img-10\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-9.png\" alt=\"Default Django project homepage\" width=\"500\" height=\"288\" title=\"\"><\/a><\/p>\n<p>Next, test the admin page by adding the &#8216;\/admin&#8217; path on the URL.<\/p>\n<p><em><strong>http:\/\/ovh01:8000\/admin\/<\/strong><\/em><\/p>\n<p>And you will see the Django admin login page.<\/p>\n<p><a class=\"fancybox\" id=\"img-11\" href=\"https:\/\/www.howtoforge.com\/images\/docker_guide_dockerizing_python_django_application\/big\/11.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-10.png\" alt=\"Django administration\" width=\"500\" height=\"250\" title=\"\"><\/a><\/p>\n<p>The Dockerizing Python Django Application has been completed successfully.<\/p>\n<h2 id=\"reference\">Reference<\/h2>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdocker-guide-dockerizing-python-django-application%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-11.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdocker-guide-dockerizing-python-django-application%2F&amp;text=Docker+Guide%3A+Dockerizing+Python+Django+Application&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-12.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-13.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fdocker-guide-dockerizing-python-django-application%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/07\/docker-guide-dockerizing-python-django-application-14.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Docker is an open-source project that provides an open platform for developers and sysadmins to build, package, and run applications anywhere as a lightweight container. Docker automates the deployment of applications inside software containers. Django is a web application framework written in python that follows the MVC (Model-View-Controller) architecture. It is available for free and &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-5278","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/5278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=5278"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/5278\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=5278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=5278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=5278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}