• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mrichnu/ansible-django: The simplest possible ansible playbook to get a Django s ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

mrichnu/ansible-django

开源软件地址:

https://github.com/mrichnu/ansible-django

开源编程语言:


开源软件介绍:

A Simple Ansible Playbook for Django

This project contains the simplest possible ansible playbook to provision a server for a django project and deploy new versions of the project.

Assumptions

This playbook assumes you have created an Ubuntu 14.04 server and have already set up ssh public key authentication on it. Assuming you have provisioned a server from a cloud provider such as AWS or Digital Ocean, you should have downloaded the private key when generating the server, or specified a keypair whose private key you already have saved.

It also assumes you are cool with Postgresql as your database.

How to use

  • Install ansible on your computer (sudo pip install ansible should do the trick).

  • Clone this project.

  • Edit the ansible/hosts file and enter the IP address of the server you are deploying to and edit the path to the private key file.

  • Edit the ansible/vars.yml file and enter values appropriate for your project.

  • Run the playbook:

     cd ansible
     ansible-playbook -i hosts provision.yml
    

That's it! Your project is now up and running and assuming you've set up a DNS record for your server, you can now visit your site.

As you make changes and commit to your django project you'll obviously want to push the new version to production, so to do that without having to run the full playbook, you can run this command (from the ansible directory): ansible-playbook -i hosts deploy.yml

That will check out the latest version of your code, install any new dependencies via pip if necessary, run the migrate and collectstatic django management commands, and restart nginx and gunicorn if necessary.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap