Commits

Denis Darii committed 0d474dc

added django_project_settings to gunicorn_django options

  • Participants
  • Parent commits 30f99a4

Comments (0)

Files changed (3)

fagungis/example_fabfile.py

     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

fagungis/scripts/rungunicorn.sh

 # 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

fagungis/tasks.py

         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.')
         else: