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:
import httplib | |
import urllib | |
http = httplib.HTTPSConnection('example.com', 443) | |
cookie = 'your=cookies'; | |
http.request("GET", "/api/v1/csrf", "", { | |
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36', | |
'referer': 'https://example.com/', |
#run this in any directory add -v for verbose | |
#get Pillow (fork of PIL) from pip before running --> pip install Pillow | |
import os | |
import sys | |
from PIL import Image | |
def compressMe(file, verbose=False): | |
filepath = os.path.join(os.getcwd(), file) | |
oldsize = os.stat(filepath).st_size |