Skip to content

Instantly share code, notes, and snippets.

@manelclos
Last active August 1, 2017 10:06
Show Gist options
  • Save manelclos/390c2bc28cbd6279e234 to your computer and use it in GitHub Desktop.
Save manelclos/390c2bc28cbd6279e234 to your computer and use it in GitHub Desktop.

Revisions

  1. manelclos revised this gist Aug 1, 2017. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,6 @@ gid = www-data
    buffer-size = 32768
    master = true
    chmod = 660
    reload-os-env = true
    auto-procname = true
    no-orphans = true
    vacuum = true
  2. manelclos revised this gist Jun 1, 2017. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,14 @@
    procname-prefix-spaced=/apps/%c

    chdir = %d/app
    module = wsgi
    need-app = true
    touch-reload = %d/uwsgi.ini
    # old way
    # module = wsgi
    # new way
    mount = /apps/appname=djangoapp/wsgi.py
    manage-script-name = true


    # set enviroment variables from ini file.
    # http://stackoverflow.com/a/23733905/593907
  3. manelclos revised this gist Jan 29, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@ procname-prefix-spaced=/apps/%c
    chdir = %d/app
    module = wsgi
    need-app = true
    touch-reload = %d/uwsgi.ini

    # set enviroment variables from ini file.
    # http://stackoverflow.com/a/23733905/593907
    @@ -42,4 +43,5 @@ chmod = 660
    reload-os-env = true
    auto-procname = true
    no-orphans = true
    vacuum = true
    die-on-term = true
  4. manelclos revised this gist Sep 9, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@ chdir = %d/app
    module = wsgi
    need-app = true

    # set enviroment variables from ini file. E.g. DB_PASSWORD=foobar
    # set enviroment variables from ini file.
    # http://stackoverflow.com/a/23733905/593907
    for-readline = %d/vars.ini
    env = %(_)
    endfor =
  5. manelclos revised this gist Sep 9, 2015. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,15 @@
    [uwsgi]
    procname-prefix-spaced=/apps/%c

    # set enviroment variables from ini file. E.g. DB_PASSWORD=foobar
    for-readline = vars.ini
    env = %(_)
    endfor =

    chdir = %d/app
    module = wsgi
    need-app = true

    # set enviroment variables from ini file. E.g. DB_PASSWORD=foobar
    for-readline = %d/vars.ini
    env = %(_)
    endfor =

    # define if needed
    # venv = %d/env

  6. manelclos revised this gist Sep 9, 2015. 2 changed files with 11 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions vars.ini
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    DB_user=foo
    DB_PASSWORD=bar
    9 changes: 9 additions & 0 deletions vars.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #! /bin/sh
    #
    # how can I turn config ini file into system environment in bash?
    #
    # credits: http://stackoverflow.com/a/22535251/593907
    #
    set -a # turn on automatic export
    source vars.ini # execute all commands in the file
    set +a # turn off automatic export
  7. manelclos revised this gist Sep 9, 2015. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,11 @@
    [uwsgi]
    procname-prefix-spaced=/apps/%c

    # set enviroment variables from ini file. E.g. DB_PASSWORD=foobar
    for-readline = vars.ini
    env = %(_)
    endfor =

    chdir = %d/app
    module = wsgi
    need-app = true
  8. manelclos revised this gist Mar 17, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,8 @@ need-app = true
    # venv = %d/env

    # execution
    socket = %d/uwsgi.sock
    # on-demand instances don't need to create the socket, the emperor will do
    # socket = %d/uwsgi.sock

    workers = 1
    threads = 5
  9. manelclos revised this gist Mar 1, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@ procname-prefix-spaced=/apps/%c

    chdir = %d/app
    module = wsgi
    need-app = true

    # define if needed
    # venv = %d/env
  10. manelclos created this gist Feb 18, 2015.
    37 changes: 37 additions & 0 deletions uwsgi_ondemand.ini
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    [uwsgi]
    procname-prefix-spaced=/apps/%c

    chdir = %d/app
    module = wsgi

    # define if needed
    # venv = %d/env

    # execution
    socket = %d/uwsgi.sock

    workers = 1
    threads = 5
    max-requests = 1000

    cheap
    idle = 60
    die-on-idle = true

    # logging
    logto = %d/log.log
    log-date = true
    logfile-chown = true
    log-backupname = %d/log.log.old
    log-maxsize = 2500000

    # system
    uid = www-data
    gid = www-data
    buffer-size = 32768
    master = true
    chmod = 660
    reload-os-env = true
    auto-procname = true
    no-orphans = true
    die-on-term = true