-
-
Save RyanMulready/3fc887d4886ec76b89fd292fdd57f4d4 to your computer and use it in GitHub Desktop.
django: es-site/es/manage.py runserver 0.0.0.0:8000 | |
compass: compass watch es-site/es/es/static | |
mail: maildev | |
log: tail -f local_es.log | |
storybook: yarn --cwd es-site/selfserve/ styleguide |
Here's my Procfile
, followed by instructions on how to use it.
django: cd es-site/es && python manage.py runserver --settings es.settings.local_dev 8001
bsync: wait-on tcp:8001 && browser-sync start --proxy 127.0.0.1:8001 --files "es-site/es/es/**/*.+(css|js|html)" --port 8000 --no-open
log: tail -f local_es.log
sass: compass watch es-site/es/es/static
mail: maildev --web 8025
celery: celery --app=es worker --beat --loglevel info
flower: celery --app=es flower --port=8555
solr: cd solr/apache-solr-3.6.1/example && java -jar start.jar
This lives in the parent directory of es-site
. I use overmind to run it; you can also use the lighter-weight hivemind.
Dependency installation on a Mac:
$ brew install overmind
$ npm install -g wait-on browser-sync maildev
Start all processes with overmind start
, or selectively start with -l
flag:
$ overmind start -l django,bsync,sass,mail
system | Listening at /Users/brian/Code/es-111/.overmind.sock
system | Tmux socket name: overmind-es-111-LD3VzZhS9K0xK1i73fLTMT
system | Tmux session ID: es-111
sass | Started with pid 57230...
mail | Started with pid 57232...
django | Started with pid 57235...
bsync | Started with pid 57238...
django | /Users/brian/Code/es-111/es-site/es
mail | MailDev webapp running at http://0.0.0.0:8025
mail | MailDev SMTP Server running at 0.0.0.0:1025
sass | Ignoring ffi-1.9.18 because its extensions are not built. Try: gem pristine ffi --version 1.9.18
sass | >>> Compass is watching for changes. Press Ctrl-C to Stop.
django | Performing system checks...
django |
django | /Users/brian/Code/es-111/venv/lib/python2.7/site-packages/djgeojson/fields.py:12: UserWarning: `django-leaflet` is not available.
django | warnings.warn('`django-leaflet` is not available.')
django | System check identified no issues (0 silenced).
django | September 21, 2018 - 15:48:00
django | Django version 1.11.12, using settings 'es.settings.local_dev'
django | Starting development server at http://127.0.0.1:8001/
django | Quit the server with CONTROL-C.
bsync | [Browsersync] Proxying: http://127.0.0.1:8001
bsync | [Browsersync] Access URLs:
bsync | -----------------------------------
bsync | Local: http://localhost:8000
bsync | External: http://10.1.10.46:8000
bsync | -----------------------------------
bsync | UI: http://localhost:3001
bsync | UI External: http://10.1.10.46:3001
bsync | -----------------------------------
bsync | [Browsersync] Watching files...
sass | modified es-site/es/es/static/sass/selfserve.scss
sass | write es-site/es/es/static/css/selfserve.css
sass | write es-site/es/es/static/css/selfserve.css.map
bsync | [Browsersync] File event [change] : es-site/es/es/static/css/selfserve.css
The ports are set up so that you can use http://localhost:8000 as usual. The page should reload on HTML and JS changes, while SASS changes should be injected without a reload. With some additional work, I think it's possible trigger a page reload when runserver
reloads.
Worth noting that I've changed my Django logging configuration to write to the console, instead of local_es.log
, which is why I didn't run the log
process.
As I mentioned, I'd like to get this into the repo, as a baseline for local dev, especially for folks like Phil, Tommy, and interns that likely won't want to customize their environment.
Also, I have a build task set up in VS Code, which means I can start my local server with Command+Shift+B
:
{
"version": "2.0.0",
"tasks": [
{
"label": "overmind",
"type": "shell",
"command": "(. venv/bin/activate; overmind start -l django,bsync,sass,mail)",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
I should not I'm using hivemind
not overmind
.
In my
.bash_alias
file I've created aliases for all the various commands.This makes it very easy to navigate and start various services.
My Procfile is as follows:
I then run
esrunserver
in another terminal pane/window. If I'm doing pikachu work I simply open another window and typeesjs
.