This is a minimal but effective set of configuration files and setup for running Django (targetted at 1.8) with Python 3.4, Gunicorn, Nginx
Because I'm sick and tired of writing this config over and over :)
#!/bin/bash | |
# | |
# Copyright 2015 James Cheese | |
# You may do anything with this work that copyright law would normally | |
# restrict, so long as you retain the above notice(s) and this license | |
# in all redistributed copies and derived works. There is no warranty. | |
# | |
# Python 3 Upgrade for Django Droplet | |
# Will update the "Django on 14.04" Digital Ocean image. | |
# Run as root. |
The MIT License (MIT) | |
Copyright (c) 2015 James Cheese | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
# Remove legacy SSL support. If you really need it, you're supporting IE6 yourself. Sorry. | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
# Settings for cached SSL sessions. | |
ssl_session_cache shared:SSL:50m; | |
ssl_session_timeout 5m; | |
# Choose some DH params: |
# Simple colour-coded prompts for BASH usage - red=live, blue=test, green=dev | |
#live: | |
export PS1="\[$(tput bold)\]\[\033[38;5;9m\]\u@\h\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]:\w\\$\[$(tput sgr0)\] " | |
#test: | |
export PS1="\[$(tput bold)\]\[\033[38;5;39m\]\u@\h\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]:\w\\$\[$(tput sgr0)\] " | |
#dev: | |
export PS1="\[$(tput bold)\]\[\033[38;5;119m\]\u@\h\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]:\w\\$\[$(tput sgr0)\] " |
### Keybase proof | |
I hereby claim: | |
* I am tr00st on github. | |
* I am jamescheese (https://keybase.io/jamescheese) on keybase. | |
* I have a public key whose fingerprint is 6F3C F8FD 4114 7718 A16E A759 8D3B AE8A 8E0A A400 | |
To claim this, I am signing this object: |
from django.db import models, migrations | |
class Migration(migrations.Migration): | |
dependencies = [] | |
operations = [ | |
migrations.RunSQL("CREATE EXTENSION IF NOT EXISTS postgis") | |
] |
--- rabbitmq-env-orig.bat Tue Oct 11 12:16:01 2016 | |
+++ rabbitmq-env.bat Tue Oct 11 12:10:18 2016 | |
@@ -1,10 +1,12 @@ | |
@echo off | |
REM Scopes the variables to the current batch file | |
REM setlocal | |
+set /p COOKIE_VALUE=<%HOMEDRIVE%%HOMEPATH%\.erlang.cookie | |
+ |
# First install GDAL as a wheel from: http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal | |
# Then ensure the following are added to your local settings.py (check the dll name, this may change!) | |
GDAL_LIBRARY_PATH = r"env\Lib\site-packages\osgeo\gdal200.dll" | |
environ["PATH"] = "{};{}".format(r"env\Lib\site-packages\osgeo", environ["PATH"]) |
/* | |
* Dark colour scheme for MarkdownEditor (https://github.com/madskristensen/MarkdownEditor) | |
* | |
* Licensed under MIT license. | |
* | |
* Copyright (c) 2018 James Cheese | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |