[uwsgi]

# uwsgi magic shortcut
# %v    the vassals directory
# %o    the original config filename, as specified on the command line
# %p    the absolute path of the configuration file
# %s    the filename of the configuration file
# %d    the absolute path of the directory containing the configuration file
# %e    the extension of the configuration file
# %n    the filename without extension
# %c    the name of the directory containing the config file (version 1.3+)
# %0..%9    a specific component of the full path of the directory containing the config file (version 1.3+)


if-not-env = TERM
  logto = ../%c.log
endif =

log-maxsize = 20971520
log-backupname = %(logto).old

auto-procname = true
procname-prefix-spaced = [$(UNBIT_DOMAIN)]


# set master-worker structure (it will need 1 additional process)
master = true

# set starting configuration 
plugins = python273
processes = 1
#threads = 8
#thread-stacksize = 512

# set the absolute path of virtualenv (if any), lib and your application
virtualenv =  %d../venvs/%c
lib = %(virtualenv)/lib/python2.7/site-packages/

domain_name = %d 
base = %(domain_name)project/
upy = %(lib)upy/
django = %(lib)django/
chdir = %(base)

pil_lib = /opt/unbit/python272/lib/python2.7/site-packages/PIL-1.1.7-py2.7-linux-x86_64.egg/
pp = %(pil_lib)

#set django environment
module = project.django_wsgi
env = DJANGO_SETTINGS_MODULE=project.settings

# to use stats and view it on uwsgitop
#stats = ./upystats

# map the urls of static files with the proper directory
static-map = /static/=%(domain_name)static
static-map = /upy_static=%(upy)upy_static
static-map = /static/admin=%(django)contrib/admin/static/admin
static-map = /static/cked/=%(upy)contrib/cked/static/cked

# use it for loading static files in a different thread, so it will not block the current process
offload-threads = 2

# set spooler with python paths and imports it would need
#pp = %(upy)
#pp = %(base)
#import = upy.contrib.newsletter.models
#spooler = %(base)upyspool/
#spooler-chdir = %(base)


# Development Settings
plugins = router_basicauth
route = .* basicauth:Development Area,20tab:20tab
# use it just for debugging. Reload the entire app if any py module or this config file change
py-auto-reload = 1
touch-reload = %p