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 | |
| if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
| appify v3.0.1 for Mac OS X - http://mths.be/appify | |
| Creates the simplest possible Mac app from a shell script. | |
| Appify takes a shell script as its first argument: | |
| `basename "$0"` my-script.sh |
| ############################## django-auth-ldap ############################## | |
| if DEBUG: | |
| import logging, logging.handlers | |
| logfile = "/tmp/django-ldap-debug.log" | |
| my_logger = logging.getLogger('django_auth_ldap') | |
| my_logger.setLevel(logging.DEBUG) | |
| handler = logging.handlers.RotatingFileHandler( | |
| logfile, maxBytes=1024 * 500, backupCount=5) |
| #! /usr/bin/env python | |
| import threading | |
| import subprocess | |
| import traceback | |
| import shlex | |
| class Command(object): | |
| """ | |
| Enables to run subprocess commands in a different thread with TIMEOUT option. |
| import subprocess | |
| import select | |
| from logging import DEBUG, ERROR | |
| def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs): | |
| """ | |
| Variant of subprocess.call that accepts a logger instead of stdout/stderr, | |
| and logs stdout messages via logger.debug and stderr messages via | |
| logger.error. |
| # LICENSE: public domain | |
| def calculate_initial_compass_bearing(pointA, pointB): | |
| """ | |
| Calculates the bearing between two points. | |
| The formulae used is the following: | |
| θ = atan2(sin(Δlong).cos(lat2), | |
| cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong)) |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail |
| # From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html | |
| git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |