Skip to content

Instantly share code, notes, and snippets.

View mark-mishyn's full-sized avatar

Mark Mishyn mark-mishyn

View GitHub Profile
@mark-mishyn
mark-mishyn / main.py
Last active March 18, 2020 07:56
Run Django management command with real-time output
"""
This example shows how to run Django management command from some of your Django apps.
Stdout and stderr are redirected to Django's StreamingHttpResponse, so
you will see command execution result in realtime.
Example can be easily adopted to run all Django's management commands or
any bash command.
"""
import importlib
@mark-mishyn
mark-mishyn / steps.txt
Last active March 18, 2020 07:56
Simple steps to deploy Django project to Heroku (OUTDATED)
1. create new app in dashboard.heroku.com
2. create Procfile
echo "web: gunicorn <app-name>.wsgi --log-file -1" > Procfile
3. add settings file for heroku
from .<base-settings-file> import *
import dj_database_url
ALLOWED_HOSTS = ['<name-app>.herokuapp.com', ]