This document has now been incorporated into the uWSGI documentation:
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Steps with explanations to set up a server using:
| #!/bin/bash -eux | |
| ARCH=${ARCH:-x86_64} | |
| CORES=$(sysctl -n hw.ncpu) | |
| GHC=${GHC:-7.4.2} | |
| CABAL=${CABAL:-0.14.0} | |
| PLATFORM=${PLATFORM:-2012.2.0.0} | |
| [[ ! -d /usr/local/src ]] && mkdir -p /usr/local/src |
As configured in my dotfiles.
start new:
tmux
start new with session name:
This is a brief and bare-bones guide to getting GHC 7.6.1 and the cabal-install
tool (the two basic things you'll need to do Haskell development) up and running
on Mac OS X 10.8 install.
The instructions given here worked for me, but YMMV.
Original on https://gist.github.com/1169332
| #!/usr/bin/env python | |
| """ | |
| How to use it: | |
| 1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID` , The Tornado Web Server Will shutdown after process all the request. | |
| 2. When you run it behind Nginx, it can graceful reboot your production server. | |
| 3. Nice Print in http://weibo.com/1682780325/zgkb7g8k7 | |
| """ |
| data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/python");</script> |
| <div id="main-container"> | |
| <div id="main"> | |
| <h1> | |
| <img alt="scubabook logo" src="{{ static_url("img/logo.png") }}"> | |
| </h1> | |
| <div id="login-form"> | |
| <form action="/auth/login/" method="post" id="login_form"> | |
| <fieldset> | |
| <label for="username">Username</label> | |
| <input autocapitalize="off" autocorrect="off" class="text-input" id="username" name="username" tabindex="1" type="text" value=""> |
| #!/bin/bash | |
| # From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/ | |
| # | |
| ARGS=2 | |
| E_BADARGS=99 | |
| if [ $# -ne $ARGS ] # correct number of arguments to the script; | |
| then |
| import suds | |
| __author__ = 'Volodymyr Vladymyrov: smartkiwi@gmail.com' | |
| __doc__ = "Example of using MessagePlugin to prevent suds from parsing response" | |
| class PayloadInterceptor(suds.plugin.MessagePlugin): | |
| def __init__(self, *args, **kwargs): | |
| self.last_payload = None |
| from django.views.decorators.csrf import csrf_exempt | |
| @csrf_exempt | |
| def reverse_proxy(request): | |
| """ | |
| Reverse proxy for a remote service. | |
| """ | |
| path = request.get_full_path() | |
| #Optionally, rewrite the path to fit whatever service we're proxying to. | |