In order to enable debugging for your Django app running in a Docker container, follow these steps using Visual Studio (Code):
- Add
ptvsd
to your requirements.txt file
ptvsd == 4.3.2
- To your
launch.json
, add this:
require 'dnsimple' | |
require 'platform-api' | |
namespace :staging do | |
desc "create subdomain DNS record for Heroku review app" | |
task :publish_dns do | |
heroku_app_name = ENV['HEROKU_APP_NAME'] | |
heroku_app_name =~ /.*(pr-\d+)/ | |
subdomain = $1 |
My notes for Dokku on Digital Ocean.
These may be a bit outdated: Since I originally wrote them, I've reinstalled on a newer Dokku and may not have updated every section below.
Install dokku-cli (gem install dokku-cli
) for a more Heroku-like CLI experience (dokku config:set FOO=bar
).
# List/run commands when not on Dokku server (assuming a "henroku" ~/.ssh/config alias)
ssh henroku dokku
* |
// | |
// README: | |
// - Listens for PUSH events | |
// - Fetches the ref pushed via the given remote | |
// - Sets the repositories HEAD to latest ref | |
// - Checks out the new HEAD (--force) | |
// - Install dependencies from package.json | |
// - Calls `npm run reload` (My app uses this) | |
// - Calls `nginx -s reload` (My app also uses this) | |
// |
// Restify Server CheatSheet. | |
// More about the API: http://mcavage.me/node-restify/#server-api | |
// Install restify with npm install restify | |
// 1.1. Creating a Server. | |
// http://mcavage.me/node-restify/#Creating-a-Server | |
var restify = require('restify'); |
#!/bin/bash | |
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/ | |
set -e | |
sourceApp="$1" | |
targetApp="$2" | |
while read key value; do |
from StringIO import StringIO | |
from django.core.handlers.wsgi import WSGIRequest | |
def fake_get(path='/', user=None): | |
req = WSGIRequest({ | |
'REQUEST_METHOD': 'GET', | |
'PATH_INFO': path, | |
'wsgi.input': StringIO()}) | |
from django.contrib.auth.models import AnonymousUser | |
req.user = AnonymousUser() if user is None else user |