Django 部署 - apache mod_wsgi mysql
我没有设置网络服务器的经验,我需要一些关于此设置的指导,任何好的文章将不胜感激。
MySQL 不是强制性的。如果 postgres 或任何其他 django 支持的 DBMS 更容易设置或更高效,那也可以。
I have no experience setting up a web server, i need some guidance for this setup, any good articles would be appreciated.
MySQL is not mandatory. If postgres or any other django-supported DBMS is easier to setup or more efficient, that would do as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您没有提到您是部署到 Linux 还是 Windows,所以我将假设 Linux 作为我的答案。
Jacob Kaplan Moss 去年在 pycon 举办了一次研讨会,视频可在此处观看:
http://ontwik.com/python/django-deployment-workshop-by-jacob-kaplan-moss/
这是一个相当长的视频(3小时),但涵盖了很多主题,并且这是在短时间内学到很多东西的好方法。他在研讨会期间使用的代码可以在 github 上找到:
https://github.com/jacobian/ django-deployment-workshop
如果您更喜欢阅读而不是观看,这里有一篇来自 caktus 组的好文章,描述了它们如何使用 virtualenv、fabric、pip 和 rsync 进行部署。
http: //www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/
最后但并非最不重要的是这里是 django 部署的链接使用 django 官方文档中的 mod_wsgi。
http://docs.djangoproject.com/en/dev/howto/deployment/ modwsgi/
我希望这能让您朝着正确的方向前进。
Since you didn't mention if you were deploying to linux or windows, I'm going to assume linux for my answer.
Jacob Kaplan Moss did a workshop last year at pycon, and the video is available here:
http://ontwik.com/python/django-deployment-workshop-by-jacob-kaplan-moss/
It is a pretty long video (3hrs) but it covers a lot of topics and is a good way to learn a lot in a short amount of time. The code that he used during the workshop is available on github:
https://github.com/jacobian/django-deployment-workshop
If you prefer to read instead of watch, here is a good article from the caktus group, describing how they deploy using virtualenv, fabric, pip, and rsync.
http://www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/
And last but not least here is a link on django deployments with mod_wsgi from the offical django documentation.
http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/
I hope this gets you going in the right direction.
免责声明:如果您对 RTFM 方法不感兴趣:请停止阅读。
对于 Web 服务器来说,在 Linux/Unix< 上安装 Apache 实例实际上非常容易/a> 或 Windows。还处理其他平台上的安装。
Apache 默认配置在大多数(开发)情况下都可以,因此配置 Apache 以与 Django 一起使用只需阅读很棒的 mod_wsgi 官方文档,特别是安装说明 首先,然后与 Django 集成。
关于数据库也很简单。我采用sqlite进行开发(高效,无需安装,无需配置)。对于生产,我可能会再次使用 sqlite 或 Postgres 来处理“高流量”站点。
阅读愉快!
Disclaimer: if you are not interested in a RTFM approach: please stop reading.
For the web server it is actually very easy to have an Apache instance installed on your Linux/Unix or Windows. Installation on other platforms is also treated.
Apache default configuration is OK in the most of (development) cases, so to configure Apache to work with Django is just a matter of reading the awesome official mod_wsgi documentation, in particular installation instructions first and Integration with Django then.
About the database it's also very easy. I'm adopting sqlite for development (efficient, no installation and no configuration). For production I'd probably use sqlite again or Postgres for "high traffic" sites.
Happy reading!