第一次设置 django

发布于 2024-09-29 05:37:44 字数 375 浏览 6 评论 0 原文

我习惯用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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

太傻旳人生 2024-10-06 05:37:45

您可以采取的最佳步骤是阅读 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.

久隐师 2024-10-06 05:37:45

当我面对一个必须重新托管的现有 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 a mod_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.

软糖 2024-10-06 05:37:45

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.

沧笙踏歌 2024-10-06 05:37:45

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文