从运行服务器迁移到生产服务器
我对编程很陌生,我的所有开发都是使用 textmate 和终端在本地运行服务器上进行的。我写了一个有几百个的小应用程序,我想将它推送到 EC2 服务器。我对“开发工具”的唯一了解是 Django 的本地运行服务器、TextMate 和 Terminal。
我应该学习哪些工具或程序才能拥有有效的工作流程?为此我是否应该使用某种 IDE 而不是 TextMate?我主要关心的是能够在本地运行服务器上进行开发,然后轻松地将其推送到我的生产服务器。
I am quite new to programming, and all of my development has been on my local runserver using textmate and terminal. I have written a small app with a few hundred and I'd like to push it to an EC2 server. My only knowledge in terms of 'developing tools' is Django's local runserver, TextMate and Terminal.
What tools or programs should I look into learning to be able to have an effective workflow?Should I be using some sort of IDE over TextMate for this? My main concerns are being able to develop on my local runserver and then painlessly push that to my production server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如@isbadawi所说,使用Fabric。它比仅使用终端更好,因为您可以自动化操作。就部署而言,您可以将其简化为:
fab -H your.host.com deploy
。在您编写命令的文件中,可能会出现一个简单的命令:到目前为止正如一些更一般的提示:
local_settings.py
作为构建的一部分如果您真的很想去轻松地,查看 Django 托管服务,例如 Gondor 或 Ep.io。这些客户端将具有您可以伪轻松地部署到的客户端,尽管您必须更改自己的一些设置以更好地匹配它们,因为部署 Django 应用程序的方法有很多。
更新:Ep.io 不再作为托管服务开展业务。我的新选择是 Heroku。
更新 2: 我曾经在部署中链接
local_settings.py
,但现在我倾向于使用DJANGO_SETTINGS_MODULE
配置变量。请参阅 rdegge 的“django-skel”设置,了解一个好方法做这个。As @isbadawi said, use Fabric. It's better than just using the terminal because you can automate things. As far as deployments go, you can simplify it down to:
fab -H your.host.com deploy
. Inside the file you write commands, a simple one might go:As far as some more general tips go:
local_settings.py
as part of the buildIf you're really going for painless, look into Django hosting services like Gondor or Ep.io. Those will have clients that you can just deploy to pseudo-painlessly, although you will have to change some settings on your side to match theirs better, as there are many many ways to deploy a Django app.
Update: Ep.io is no longer in business as a hosting service. My new go-to is Heroku.
Update 2: I used to link
local_settings.py
in deployments, but now I'm leaning towards using theDJANGO_SETTINGS_MODULE
config variable. See rdegge's "django-skel" settings for a good way to do this.诸如 git 或 Mercurial 之类的 DVCS 允许您在本地开发和测试,然后将更改推送到远程系统以进行登台和生产。
A DVCS such as git or Mercurial will allow you to develop and test locally, and then push the changes to a remote system for staging and production.