1. Denis Darii
  2. django-fagungis


Denis Darii  committed 0d474dc

added django_project_settings to gunicorn_django options

  • Participants
  • Parent commits 30f99a4
  • Branches default

Comments (0)

Files changed (3)

File fagungis/example_fabfile.py

View file
     env.projects_path = join(env.django_user_home, 'projects')
     #  the root path of your project
     env.code_root = join(env.projects_path, env.project)
-    #  the path where manage.py and settings.py of this project is located
+    #  the path where manage.py of this project is located
     env.django_project_root = env.code_root
+    #  path to settings file of this project
+    env.django_project_settings = join(env.code_root, 'settings.py')
     #  django media dir
     env.django_media_path = join(env.code_root, 'media')
     #  django static dir

File fagungis/scripts/rungunicorn.sh

View file
 # start gunicorn with all options earlier declared in fabfile.py
 exec %(virtenv)s/bin/gunicorn_django -w %(gunicorn_workers)s \
     --user=%(django_user)s --group=%(django_user_group)s \
+    --settings=%(django_project_settings)s \
     --bind=%(gunicorn_bind)s --log-level=%(gunicorn_loglevel)s \
     --log-file=%(gunicorn_logfile)s 2>>%(gunicorn_logfile)s

File fagungis/tasks.py

View file
         errors.append('Django project root configuration missing')
     elif verbose:
         parameters_info.append(('Django project root', env.django_project_root))
+    if 'django_project_settings' not in env or not env.django_project_settings:
+        env.django_project_settings = join(env.code_root, 'settings.py')
+    if verbose:
+        parameters_info.append(('django_project_settings', env.django_project_settings))
     if 'django_media_path' not in env or not env.django_media_path:
         errors.append('Django media path configuration missing')
     elif verbose:
         parameters_info.append(('supervisord_conf_file', env.supervisord_conf_file))
     if errors:
-        if len(errors) == 28:
+        if len(errors) == 29:
             ''' all configuration missing '''
             puts('Configuration missing! Please read README.rst first or go ahead at your own risk.')