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:
[2019-01-19 18:50] [INFO] glutin event: WindowEvent { window_id: WindowId(Id(140352698763008)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 58, state: Pressed, virtual_keycode: Some(LAlt), modifiers: ModifiersState { shift: false, ctrl: false, alt: true, logo: false } } } } | |
[2019-01-19 18:50] [INFO] glutin event: WindowEvent { window_id: WindowId(Id(140352698763008)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 34, state: Pressed, virtual_keycode: Some(I), modifiers: ModifiersState { shift: false, ctrl: false, alt: true, logo: false } } } } | |
[2019-01-19 18:50] [INFO] glutin event: WindowEvent { window_id: WindowId(Id(140352698763008)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 34, state: Released, virtual_keycode: Some(I), modifiers: ModifiersState { shift: false, ctrl: false, alt: true, logo: false } } } } | |
[2019-01-19 18:50] [INFO] glutin event: WindowEvent { window_id: WindowId(I |
-> % ldd /usr/local/Cellar/macvim/7.4-76/MacVim.app/Contents/MacOS/Vim | |
/usr/local/Cellar/macvim/7.4-76/MacVim.app/Contents/MacOS/Vim: | |
/usr/local/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0) | |
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1152.0.0) | |
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 21.0.0) | |
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0) | |
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0) | |
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0) | |
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) | |
/usr/local/lib/liblua.5.2.dylib (compatibility version 5.2.0, current version 5.2.3) |
// Solution to eloquentjavascript exercise second 2nd edition | |
// Chapter 13 | |
// http://eloquentjavascript.net/2nd_edition/preview/13_dom.html | |
// Build a table | |
function buildTable(data) { | |
var node = document.createElement("table"); | |
var tr = document.createElement("tr"); | |
var headers = Object.keys(data[0]); | |
for (var i=0; i<headers.length; ++i) { | |
var header = headers[i]; |
// Solution to eloquentjavascript exercise second 2nd edition | |
// Chapter 10 | |
//http://eloquentjavascript.net/2nd_edition/preview/10_modules.html | |
// Month names | |
var month = function() { | |
var names = ["Jan", "Feb", "March", "April", "May", "Junte", "July", "August", "September", "October", "November", "December"]; | |
return { | |
name: function(number) { return names[number];}, | |
number: function(name) {return names.indexOf(name);} | |
} |
// Solution to eloquentjavascript exercise second 2nd edition | |
// Chapter 9 | |
// http://eloquentjavascript.net/2nd_edition/preview/09_regexp.html | |
// regex Golf | |
verify(/ca[rt]/, | |
["my car", "bad cats"], | |
["camper", "high art"]); | |
verify(/pr?op/, | |
["pop culture", "mad props"], |
// Solution to eloquentjavascript exercise second 2nd edition | |
// Chapter 8 | |
// http://eloquentjavascript.net/2nd_edition/preview/08_error.html | |
// Retry | |
function MultiplicatorUnitFailure() {} | |
function primitiveMultiply(a, b) { | |
if (Math.random() < 0.5) | |
return a * b; | |
else |
function Plant() { | |
this.energy = 3 + Math.random() * 4; | |
} | |
Plant.prototype.act = function(context) { | |
if (this.energy > 19) { | |
var space = context.find(" "); | |
if (space) | |
return {type: "reproduce", direction: space}; | |
} | |
if (this.energy < 20) |
// Solution to eloquentjavascript exercise second 2nd edition | |
// Chapter 6 | |
// http://eloquentjavascript.net/2nd_edition/preview/06_object.html | |
// A vector type | |
function Vector(x, y) { | |
this.x = x; | |
this.y = y; | |
} | |
Vector.prototype.plus = function (b) { |
// Solution to eloquentjavascript exercise second 2nd edition | |
// Chapter 5 | |
// http://eloquentjavascript.net/2nd_edition/preview/05_higher_order.html | |
// Mother-child age difference | |
function average(array) { | |
function plus(a, b) { return a + b; } | |
return array.reduce(plus) / array.length; | |
} |