Setting up django for the first time
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 pa开发者_C百科ss 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.
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.
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:
- Configuration example from the Nginx wiki
- Another Django - Nginx - FastCGI configuration example for comparison
- Flup
- Proxying Nginx to Apache (assumes you already have Apache serving Django successfully, so maybe not so useful for you)
- Page caching with Memcached - I found a lot of tutorials for Django and memcached; if full-page caching is a valid option for you (it was for me) this was the most helpful walk-through for me, and I strongly recommend it.
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.
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 is great for fcgi. for maximum flexibilty start the django fcgi as tcp-listener, and have the lighttpd connect to it.
精彩评论