- This is literally copied from code I have in production, with nearly no modification other than trimming the stock settings
- Yes I use the
globals().update()
method that d12f recommends against - given I am the author/maintainer, I'm probably qualified to do this
$ svc -t /goat
svc: warning: unable to chdir to /goat: file does not exist
$ echo $?
0
Well ok, maybe I'm missing a command line argument and it's just a crap default?
from django.conf import settings | |
class TemplateCheckerMiddleware(object): | |
def process_template_response(self, request, response): | |
if settings.DEBUG: | |
for k,v in response.context.iteritems(): # Probably does the right thing; ymmv | |
if v == settings.TEMPLATE_STRING_IF_INVALID: | |
raise SomeSortOfUsefulException(k) | |
return response |
server { | |
listen {{ proxy_port }}; | |
location / { | |
proxy_pass https://{{ elasticsearch_host }}/; | |
proxy_set_header Host {{ elasticsearch_host }}; | |
} | |
} |
Antelope v2 depends on Badger>1,<4 Badger has v1,v2,v3,v4 and no dependencies
If you have nothing installed:
pip install Antelope==2
will leave you with Antelope v2, Badger v3pip install --upgrade Antelope==2
will exhibit the same behaviour
If you have Badger v1 installed:
from django.apps import apps | |
from django.template import Library | |
register = Library() | |
_static = None | |
@register.simple_tag | |
def static(path): |
WSGI is a protocol/interface, that (roughly) describes translation between HTTP requests/responses and Python
This is similar to Java's Servlet specification, or the CGI spec.
uWSGI is a webserver that implements 'the server side of' WSGI, i.e. it takes HTTP requests and turns them into Python request objects, passes them off to whatever code you're running with it, gets a Python response object back, and returns it as an HTTP response.
Do not confuse uWSGI with WSGI. Other WSGI webservers exist, e.g. gunicorn, or apache+mod_wsgi.
#!/bin/bash -x | |
# Very very hacky, I'm so sorry | |
TYPE=$1 | |
PROCFILE="./Procfile" | |
# TODO More getopts | |
if [ -z $TYPE ] |