{"id":993,"date":"2020-02-19T12:06:07","date_gmt":"2020-02-19T06:36:07","guid":{"rendered":"http:\/\/blog.nuventure.in\/?p=993"},"modified":"2020-02-21T11:15:35","modified_gmt":"2020-02-21T05:45:35","slug":"auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd","status":"publish","type":"post","link":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/","title":{"rendered":"Auto Deploying a Django App using Capistrano with GitLab CI\/CD"},"content":{"rendered":"\n<p>Yes, you read that right. We are using Capistrano &#8211; a very popular application deployment tool that is written in Ruby to deploy a Python Django app. In fact, you can deploy any application written in any language using Capistrano. We have been using Capistrano to deploy Rails apps for a very long time and has been the obvious tool of choice for deployments. <\/p>\n\n\n\n<p>We recently moved our entire code base to GitLab and we really wanted to leverage the CI-CD capabilities that GitLab provided out of the box. Some of our apps are built and deployed using Docker, which can be easily deployed using GitLab CI-CD but deploying Django wasn\u2019t pretty straight forward, and that\u2019s how we ended up using Capistrano. <\/p>\n\n\n\n<p><strong>1. Install bundler<\/strong><\/p>\n\n\n\n<p>Install bundler if you don\u2019t have it yet.<\/p>\n\n\n\n<p><code>gem install bundler<\/code><\/p>\n\n\n\n<p><strong>2. Add Gemfile<\/strong><\/p>\n\n\n\n<p>We will add a Gemfile to specify the gems we will need. Mostly we would need only the Capistrano gem, but I needed the <code>ed25519<\/code> gem as well, as I am using a ed25519 SSH key.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsource &quot;https:\/\/rubygems.org&quot;\n\ngit_source(:github) {|repo_name| &quot;https:\/\/github.com\/#{repo_name}&quot; }\n\ngem &quot;capistrano&quot;, &#039;~&gt; 3.11.2&#039;\ngem &#039;ed25519&#039;, &#039;&gt;= 1.2&#039;, &#039;&lt; 2.0&#039;\ngem &#039;bcrypt_pbkdf&#039;, &#039;&gt;= 1.0&#039;, &#039;&lt; 2.0&#039;\n<\/pre><\/div>\n\n\n<p><strong>3. Do bundle install<\/strong><\/p>\n\n\n\n<p><code>bundle install<\/code><\/p>\n\n\n\n<p>This will install all the required gems including Capistrano.<\/p>\n\n\n\n<p><strong>4. Initiate Capistrano on the project<\/strong><\/p>\n\n\n\n<p><code>bundle exec cap install<\/code><\/p>\n\n\n\n<p>This command would create a few files inside your project directory, with some boilerplate code for deploying your code. You basically have to tweak them as per your requirements.<\/p>\n\n\n\n<p>Few files that this would create are:<\/p>\n\n\n\n<ul><li><code>Capfile<\/code> &#8211; main Capistrano file<\/li><li><code>config\/deploy.rb<\/code> &#8211; main deploy script<\/li><li><code>config\/deploy\/staging.rb<\/code> &#8211; staging specific Capistrano directives <\/li><li><code>config\/deploy\/production.rb<\/code> &#8211; production specific<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>5. Tweak Capistrano<\/strong><\/p>\n\n\n\n<p>Now, all you need to do is, modify these files to tell Capistrano where to find your project code (Git repo), server details, where you want to upload the files on the server and what files need symlinked etc.<\/p>\n\n\n\n<p>Here is what ours look like for deploying a Django app that uses nginx, gunicorn and celery stack.<\/p>\n\n\n\n<p><code>Capfile<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# Load DSL and set up stages\nrequire &quot;capistrano\/setup&quot;\n\n# Include default deployment tasks\nrequire &quot;capistrano\/deploy&quot;\n\nrequire &quot;capistrano\/scm\/git&quot;\ninstall_plugin Capistrano::SCM::Git\n<\/pre><\/div>\n\n\n<p><code>config\/deploy.rb<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nlock &quot;~&gt; 3.11.2&quot;\n\nset :application, &quot;ApplicationName&quot;\nset :repo_url, &quot;git@gitlab.com:group\/sub-group\/app.git&quot;\nset :keep_releases, 10\n\nappend :linked_files, &quot;app_name\/local_settings.py&quot; # could be .env or any file you probably use for config variables\nappend :linked_dirs, &quot;media&quot;\n\nset :deploy_to, &quot;\/var\/www\/app_name&quot;\nset :ssh_options, forward_agent: true\n\nnamespace :deploy do\n\n  desc &quot;Run post-deploy actions (migrate and collect static)&quot;\n  task :post_deploy do\n    invoke &#039;deploy:install_deps&#039;\n    invoke &#039;deploy:migrate&#039;\n    invoke &#039;deploy:collect_static&#039;\n    invoke &#039;deploy:restart&#039;\n  end\n\n  desc &quot;Install dependencies&quot;\n  task :install_deps do\n    on roles(:app), in: :sequence, wait: 5 do\n      within release_path do\n        execute(&quot;source #{fetch :venv_path}\/bin\/activate&quot;)\n        execute :pip, :install, &#039;-r&#039;, &#039;requirements.txt&#039;\n      end\n    end\n  end\n\n  desc &quot;Migrate database&quot;\n  task :migrate do\n    on roles(:app), in: :sequence, wait: 5 do\n      within release_path do\n        execute :python, &#039;manage.py&#039;, &#039;migrate&#039;, &#039;--no-input&#039;\n      end\n    end\n  end\n\n  desc &quot;Collect static&quot;\n  task :collect_static do\n    on roles(:app), in: :sequence, wait: 5 do\n      within release_path do\n        execute :python, &#039;manage.py&#039;, &#039;collectstatic&#039;, &#039;--no-input&#039;\n      end\n    end\n  end\n\n  desc &quot;Restart Gunicorn&quot;\n  task :restart do\n    on roles(:app), in: :sequence, wait: 5 do\n      execute :sudo, :service, &#039;gunicorn&#039;, :restart\n    end\n  end\nend\n\nafter &#039;deploy:finished&#039;, &#039;deploy:post_deploy&#039;\n<\/pre><\/div>\n\n\n<p><code>config\/deploy\/staging.rb<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nserver &quot;myapp.com&quot;, user: &quot;username&quot;, roles: %w{app db web}\nset :deploy_user, &#039;username&#039;\n\nset :branch, &quot;staging&quot;\nset :stage, :staging\n\nset :venv_path, &quot;\/home\/username\/venvs\/app-name&quot;\nSSHKit.config.command_map&#x5B;:python] = &quot;#{fetch :venv_path}\/bin\/python&quot;\nSSHKit.config.command_map&#x5B;:pip] = &quot;#{fetch :venv_path}\/bin\/pip&quot;\n<\/pre><\/div>\n\n\n<p><code>config\/deploy\/production.rb<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nserver &quot;myapp.com&quot;, user: &quot;username&quot;, roles: %w{app db web}\nset :deploy_user, &#039;username&#039;\n\nset :branch, &quot;master&quot;\nset :stage, :production\n\nset :venv_path, &quot;\/home\/username\/venvs\/app-name&quot;\nSSHKit.config.command_map&#x5B;:python] = &quot;#{fetch :venv_path}\/bin\/python&quot;\nSSHKit.config.command_map&#x5B;:pip] = &quot;#{fetch :venv_path}\/bin\/pip&quot;\n<\/pre><\/div>\n\n\n<p><strong>6. Ready to deploy<\/strong><\/p>\n\n\n\n<p>You need to make sure that the directory mentioned in the <code>deploy_to<\/code> directive has been created and has the required file permissions.<\/p>\n\n\n\n<p>Now, lets check if everything is in order. The following command would check if Capistrano can reach your git repo, SSH to server and verify folder permissions.<\/p>\n\n\n\n<p><code>bundle exec cap staging deploy:check<\/code><\/p>\n\n\n\n<p>At this point, you could simply, run a deployment to your staging or production servers using the following commands, respectively.<\/p>\n\n\n\n<p><code>bundle exec cap staging deploy<\/code><\/p>\n\n\n\n<p><code>bundle exec cap production deploy<\/code><\/p>\n\n\n\n<p>More commands are available:<\/p>\n\n\n\n<p><code>bundle exec cap -T<\/code><\/p>\n\n\n\n<p><strong>7. Auto deploy using GitLab CI\/CD<\/strong><\/p>\n\n\n\n<p>Now that we can run deployments from your local machine, create a  <code>.gitlab-ci.yml<\/code>     file on the root of your project directory to tell GitLab to auto deploy your app.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nimage: ruby:2.6\n\nstages:\n  - deploy\n\ndeploy_staging:\n  stage: deploy\n  environment:\n    name: staging\n    url: https:\/\/$STAGING_HOST\n  before_script:\n    - &#039;which ssh-agent || ( apt-get update -y &amp;&amp; apt-get install openssh-client git -y )&#039;\n    - eval $(ssh-agent -s)\n    - echo &quot;$DEPLOY_PRIVATE_KEY&quot; | base64 -d | ssh-add -\n    - mkdir -p ~\/.ssh\n    - chmod 700 ~\/.ssh\n    - ssh-keyscan $STAGING_HOST &gt;&gt; ~\/.ssh\/known_hosts\n    - chmod 644 ~\/.ssh\/known_hosts\n    - &#039;&#x5B;&#x5B; -f \/.dockerenv ]] &amp;&amp; echo -e &quot;Host *\\n\\tStrictHostKeyChecking no\\n\\n&quot; &gt; ~\/.ssh\/config&#039;\n    - git config --global user.email &quot;you@example.com&quot;\n    - git config --global user.name &quot;Name&quot;\n    - gem install bundler\n    - bundle install\n  script:\n    - bundle exec cap staging deploy\n  only:\n    - staging\n\ndeploy_production:\n  stage: deploy\n  when: manual\n  environment:\n    name: production\n    url: https:\/\/$PRODUCTION_HOST\n  before_script:\n    - &#039;which ssh-agent || ( apt-get update -y &amp;&amp; apt-get install openssh-client git -y )&#039;\n    - eval $(ssh-agent -s)\n    - echo &quot;$DEPLOY_PRIVATE_KEY&quot; | base64 -d | ssh-add -\n    - mkdir -p ~\/.ssh\n    - chmod 700 ~\/.ssh\n    - ssh-keyscan $PRODUCTION_HOST &gt;&gt; ~\/.ssh\/known_hosts\n    - chmod 644 ~\/.ssh\/known_hosts\n    - &#039;&#x5B;&#x5B; -f \/.dockerenv ]] &amp;&amp; echo -e &quot;Host *\\n\\tStrictHostKeyChecking no\\n\\n&quot; &gt; ~\/.ssh\/config&#039;\n    - git config --global user.email &quot;you@example.com&quot;\n    - git config --global user.name &quot;Name&quot;\n    - gem install bundler\n    - bundle install\n  script:\n    - bundle exec cap production deploy\n  only:\n    - master\n<\/pre><\/div>\n\n\n<p>Head to Settings -&gt; CI\/CD under your project in GitLab and add the following under Variables.<\/p>\n\n\n\n<ul><li><code>DEPLOY_PRIVATE_KEY<\/code> You need to generate a new SSH key pair and hash the private key using base64, and then copy the private key as the value here. Add the public key to your servers&#8217; authorized keys file. <\/li><li><code>PRODUCTION_HOST<\/code> &#8211; domain or IP of your app. e.g. www.example.com<\/li><li><code>STAGING_HOST<\/code><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1984\" height=\"980\" src=\"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Screenshot-2020-02-10-at-1.27.26-PM.png\" alt=\"\" class=\"wp-image-994\"\/><\/figure>\n\n\n\n<p>Now, that we have created the Gitlab CI file, try pushing to your repo, and Gitlab should pick it up and start deploying to your server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yes, you read that right. We are using Capistrano &#8211; a very popular application deployment tool that is written in Ruby to deploy a Python Django app. In fact, you can deploy any application written in any language using Capistrano. We have been using Capistrano to deploy Rails apps for a very long time and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1024,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[27,26,18,20,95],"tags":[124,121,122,123,33,16,43,125],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Nuventure Blog Auto Deploying a Django App using Capistrano with GitLab CI\/CD -<\/title>\n<meta name=\"description\" content=\"Nuventure Blog Yes, you read that right. We are using Capistrano - a very popular application deployment tool that is written in Ruby to deploy a Python Django app. In\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nuventure Blog Auto Deploying a Django App using Capistrano with GitLab CI\/CD -\" \/>\n<meta property=\"og:description\" content=\"Nuventure Blog Yes, you read that right. We are using Capistrano - a very popular application deployment tool that is written in Ruby to deploy a Python Django app. In\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/\" \/>\n<meta property=\"og:site_name\" content=\"Nuventure Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nuventureco\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-19T06:36:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-02-21T05:45:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tinu Cleatus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nuventureco\" \/>\n<meta name=\"twitter:site\" content=\"@nuventureco\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tinu Cleatus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/\"},\"author\":{\"name\":\"Tinu Cleatus\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#\/schema\/person\/92ee1865fc62f5f812a01ebc360befdb\"},\"headline\":\"Auto Deploying a Django App using Capistrano with GitLab CI\/CD\",\"datePublished\":\"2020-02-19T06:36:07+00:00\",\"dateModified\":\"2020-02-21T05:45:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/\"},\"wordCount\":512,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg\",\"keywords\":[\"capistrano\",\"deploy\",\"django\",\"gitlab\",\"linux\",\"python\",\"ruby\",\"servers\"],\"articleSection\":[\"Linux\",\"Programming\",\"Python\",\"Ruby\",\"Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/\",\"url\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/\",\"name\":\"Nuventure Blog Auto Deploying a Django App using Capistrano with GitLab CI\/CD -\",\"isPartOf\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg\",\"datePublished\":\"2020-02-19T06:36:07+00:00\",\"dateModified\":\"2020-02-21T05:45:35+00:00\",\"description\":\"Nuventure Blog Yes, you read that right. We are using Capistrano - a very popular application deployment tool that is written in Ruby to deploy a Python Django app. In\",\"breadcrumb\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#primaryimage\",\"url\":\"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg\",\"contentUrl\":\"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/nuventureconnect.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Auto Deploying a Django App using Capistrano with GitLab CI\/CD\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#website\",\"url\":\"https:\/\/nuventureconnect.com\/blog\/\",\"name\":\"Nuventure Blog\",\"description\":\"Knowledge.transmit!\",\"publisher\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nuventureconnect.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#organization\",\"name\":\"Nuventure Connect Private Limited\",\"url\":\"https:\/\/nuventureconnect.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2023\/03\/logo-main-with-cartion-1.webp\",\"contentUrl\":\"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2023\/03\/logo-main-with-cartion-1.webp\",\"width\":200,\"height\":89,\"caption\":\"Nuventure Connect Private Limited\"},\"image\":{\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/nuventureco\/\",\"https:\/\/x.com\/nuventureco\",\"https:\/\/www.instagram.com\/nuventure\/\",\"https:\/\/in.linkedin.com\/company\/nuventure\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#\/schema\/person\/92ee1865fc62f5f812a01ebc360befdb\",\"name\":\"Tinu Cleatus\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nuventureconnect.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d4651d73eeb12d32186df9b61b4b1827?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d4651d73eeb12d32186df9b61b4b1827?s=96&r=g\",\"caption\":\"Tinu Cleatus\"},\"url\":\"https:\/\/nuventureconnect.com\/blog\/author\/tinu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Nuventure Blog Auto Deploying a Django App using Capistrano with GitLab CI\/CD -","description":"Nuventure Blog Yes, you read that right. We are using Capistrano - a very popular application deployment tool that is written in Ruby to deploy a Python Django app. In","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:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/","og_locale":"en_US","og_type":"article","og_title":"Nuventure Blog Auto Deploying a Django App using Capistrano with GitLab CI\/CD -","og_description":"Nuventure Blog Yes, you read that right. We are using Capistrano - a very popular application deployment tool that is written in Ruby to deploy a Python Django app. In","og_url":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/","og_site_name":"Nuventure Blog","article_publisher":"https:\/\/www.facebook.com\/nuventureco\/","article_published_time":"2020-02-19T06:36:07+00:00","article_modified_time":"2020-02-21T05:45:35+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg","type":"image\/jpeg"}],"author":"Tinu Cleatus","twitter_card":"summary_large_image","twitter_creator":"@nuventureco","twitter_site":"@nuventureco","twitter_misc":{"Written by":"Tinu Cleatus","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#article","isPartOf":{"@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/"},"author":{"name":"Tinu Cleatus","@id":"https:\/\/nuventureconnect.com\/blog\/#\/schema\/person\/92ee1865fc62f5f812a01ebc360befdb"},"headline":"Auto Deploying a Django App using Capistrano with GitLab CI\/CD","datePublished":"2020-02-19T06:36:07+00:00","dateModified":"2020-02-21T05:45:35+00:00","mainEntityOfPage":{"@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/"},"wordCount":512,"commentCount":0,"publisher":{"@id":"https:\/\/nuventureconnect.com\/blog\/#organization"},"image":{"@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#primaryimage"},"thumbnailUrl":"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg","keywords":["capistrano","deploy","django","gitlab","linux","python","ruby","servers"],"articleSection":["Linux","Programming","Python","Ruby","Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/","url":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/","name":"Nuventure Blog Auto Deploying a Django App using Capistrano with GitLab CI\/CD -","isPartOf":{"@id":"https:\/\/nuventureconnect.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#primaryimage"},"image":{"@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#primaryimage"},"thumbnailUrl":"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg","datePublished":"2020-02-19T06:36:07+00:00","dateModified":"2020-02-21T05:45:35+00:00","description":"Nuventure Blog Yes, you read that right. We are using Capistrano - a very popular application deployment tool that is written in Ruby to deploy a Python Django app. In","breadcrumb":{"@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#primaryimage","url":"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg","contentUrl":"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2020\/02\/Django-App.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/nuventureconnect.com\/blog\/2020\/02\/19\/auto-deploying-a-django-app-using-capistrano-with-gitlab-ci-cd\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nuventureconnect.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Auto Deploying a Django App using Capistrano with GitLab CI\/CD"}]},{"@type":"WebSite","@id":"https:\/\/nuventureconnect.com\/blog\/#website","url":"https:\/\/nuventureconnect.com\/blog\/","name":"Nuventure Blog","description":"Knowledge.transmit!","publisher":{"@id":"https:\/\/nuventureconnect.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nuventureconnect.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/nuventureconnect.com\/blog\/#organization","name":"Nuventure Connect Private Limited","url":"https:\/\/nuventureconnect.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nuventureconnect.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2023\/03\/logo-main-with-cartion-1.webp","contentUrl":"https:\/\/nuventureconnect.com\/blog\/wp-content\/uploads\/2023\/03\/logo-main-with-cartion-1.webp","width":200,"height":89,"caption":"Nuventure Connect Private Limited"},"image":{"@id":"https:\/\/nuventureconnect.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/nuventureco\/","https:\/\/x.com\/nuventureco","https:\/\/www.instagram.com\/nuventure\/","https:\/\/in.linkedin.com\/company\/nuventure"]},{"@type":"Person","@id":"https:\/\/nuventureconnect.com\/blog\/#\/schema\/person\/92ee1865fc62f5f812a01ebc360befdb","name":"Tinu Cleatus","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nuventureconnect.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d4651d73eeb12d32186df9b61b4b1827?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d4651d73eeb12d32186df9b61b4b1827?s=96&r=g","caption":"Tinu Cleatus"},"url":"https:\/\/nuventureconnect.com\/blog\/author\/tinu\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/posts\/993"}],"collection":[{"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/comments?post=993"}],"version-history":[{"count":7,"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/posts\/993\/revisions"}],"predecessor-version":[{"id":1002,"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/posts\/993\/revisions\/1002"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/media\/1024"}],"wp:attachment":[{"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/media?parent=993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/categories?post=993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nuventureconnect.com\/blog\/wp-json\/wp\/v2\/tags?post=993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}