我习惯用php和mysql为nginx设置服务器。我明白这一点就好了。但我对从哪里开始 django 感到非常困惑。顺便说一句,我对 python 一无所知。
我正在运行 ubuntu 10.04
Python 已经安装了(不过不确定是什么版本。我读到我需要少于 3 个或其他版本)
所以首先,如何让 fastcgi 运行并使用 python?我知道 nginx 运行后如何传递给它。
我还读到了一些关于需要“flup”的内容。我该如何安装它?
那么 python 文件去了哪里呢?我想我看到了一些关于生成某种骨架设置的东西?也许我错了。
也许给我指出一个超级简化的教程或其他东西 - 不是 django 网站上的说明 - 我只是不明白。
I'm used to setting up a server for nginx with php and mysql. I understand that just fine. But I'm extremely confused at where to even start with django. I know nothing about python by the way.
I'm running ubuntu 10.04
Python is already installed (not sure what version though. I read I need less than 3 or something)
So firstly, how do I get fastcgi running and using python? I know how to pass to it from nginx once it's running.
I also read something about needing "flup". How do I install that?
And then where do python files go? I thought I saw something about generating a sort of skeleton set up? Maybe I'm wrong on that.
Maybe point me to a super simplified tutorial or something - not the instructions on django's site - I'm just not getting it.
发布评论
评论(4)
您可以采取的最佳步骤是阅读 Django 教程
这是最好的开始观点。当您遇到问题时,您可以提出其他问题。
The best step you can make is to read the Django Tutorial
It's the best starting point. When you have problems you can put another questions.
当我面对一个必须重新托管的现有 Django 应用程序时,我犯了一些严重的错误。我有使用 Rails 的经验,但没有使用 Django 的经验。我最终使用 Nginx 为 Apache 和 mod_python 提供静态资源和代理框架请求——如果我没记错的话,我的应用程序有一个 mod_python 依赖项。以下是对我有用的资源:
你的问题的措辞让我觉得,像我一样,你有一个或多或少功能正常的应用程序,你现在正在尝试将其投入生产。 (如果您是从头开始,Seitaridis 可以为您提供答案。)这些链接中的一两个应该可以让您找到可以在此处搜索的错误消息。
I did some serious flailing around when I was faced with an existing Django app that I had to re-host. I had experience with Rails but none with Django. I wound up with Nginx serving static resources and proxying framework requests to Apache and
mod_python
-- if I recall correctly my app had amod_python
dependency. Here are the resources which came in handy for me:The phrasing of your question made me think that, like me, you had a more-or-less functioning app that you're now trying to put in production. (If you're starting from scratch, Seitaridis has the answer for you.) One or two of these links should get you to the point where you have error messages you can search here.
我找到了Brandon Konkle 的这篇博文 对于在 Ubuntu 上设置新的 Django 服务器非常有帮助。他选择了 Nginx/Gunicorn 路线,而不是 Nginx/fcgi,但这是最近在 Django 社区中变得越来越常见和流行的服务器设置。
I've found this blog post by Brandon Konkle very helpful for setting up a new Django server on Ubuntu. He goes the Nginx/Gunicorn route rather than Nginx/fcgi but it's a server setup that is becoming more common and popular in the Django community recently.
lighttpd 非常适合 fcgi。为了获得最大的灵活性,启动 django fcgi 作为 tcp 侦听器,并让 lighttpd 连接到它。
lighttpd is great for fcgi. for maximum flexibilty start the django fcgi as tcp-listener, and have the lighttpd connect to it.