* 19/03/2015, Carlos Catucci wrote : > pero' che due maroni. > Ho sempre usato hosting (tipo Alwaysdata) che mi danno la possibilita' > di deployare un progetto Django senza dover impazzie troppo. Al massimo > richiedono una specigfica struttura nell'albero delel directories, tipo > mettere static in root del progetto oppure nelal cartella dove riside > anche settings.py, per dire. > Stavolta devo deployare su un server su cui o pieno accesso. > Primo tentativo: nginx+uwsgi. Non va neppure se lo prendo a calci sui > denti.
io uso nginx+uwsgi (emperor) con piu' webapp Pylons+Pyramid e funziona; ti passo di seguito un esempio di configurazione; il file .ini e' lo standard Pylons/Pyramid. nginx: server { ... location / { include /etc/nginx/uwsgi_params; uwsgi_param SCRIPT_NAME ''; uwsgi_read_timeout 180; uwsgi_pass_request_headers on; uwsgi_pass 127.0.0.1:5011; } } uwsgi_params: uwsgi_param QUERY_STRING $query_string; uwsgi_param REQUEST_METHOD $request_method; uwsgi_param CONTENT_TYPE $content_type; uwsgi_param CONTENT_LENGTH $content_length; uwsgi_param REQUEST_URI $request_uri; uwsgi_param PATH_INFO $document_uri; uwsgi_param DOCUMENT_ROOT $document_root; uwsgi_param SERVER_PROTOCOL $server_protocol; uwsgi_param HTTPS $https if_not_empty; uwsgi_param UWSGI_SCHEME $scheme; uwsgi_param REMOTE_ADDR $remote_addr; uwsgi_param REMOTE_PORT $remote_port; uwsgi_param SERVER_PORT $server_port; uwsgi_param SERVER_NAME $server_name; uwsgi: <uwsgi> <socket>0.0.0.0:5011</socket> <plugins>python27</plugins> <uid>utentemio</uid> <gid>utentemio</gid> <virtualenv>/home/utentemio/projects</virtualenv> <master>true</master> <processes>4</processes> <harakiri>180</harakiri> <post-buffering>1000</post-buffering> <vacuum>true</vacuum> <ini-paste>/home/utentemio/projects/acme/acme.ini</ini-paste> <chdir>/home/utentemio/projects/acme</chdir> <env>PYTHON_EGG_CACHE=/home/utentemio/tmp</env> <pythonpath>/home/utentemio/projects/acme</pythonpath> <pythonpath>/home/utentemio/.local/lib/python2.7/site-packages</pythonpath> <pythonpath>/home/utentemio/projects/lib/python2.7/site-packages</pythonpath> <pythonpath>/usr/lib/python2.7/site-packages</pythonpath> </uwsgi> -- Never try to teach a pig to sing. It wastes your time and annoys the pig. _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python