diff --git a/requirements.txt b/requirements.txt index 63848a8e5..528f9d956 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cookiecutter==1.5.1 flake8==3.3.0 # pyup: != 2.6.0 sh==1.12.13 -binaryornot==0.4.0 +binaryornot==0.4.3 # Testing pytest==3.0.7 diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index 90ce80dce..6a0a3029e 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -76,3 +76,6 @@ mailhog {% endif %} staticfiles/ + +.cache/ + diff --git a/{{cookiecutter.project_slug}}/config/wsgi.py b/{{cookiecutter.project_slug}}/config/wsgi.py index 636f547a4..05d56ab24 100644 --- a/{{cookiecutter.project_slug}}/config/wsgi.py +++ b/{{cookiecutter.project_slug}}/config/wsgi.py @@ -13,7 +13,12 @@ middleware here, or combine a Django application with an application of another framework. """ -import os +import os, sys + +# This allows easy placement of apps within the interior +# {{ cookiecutter.project_slug }} directory. +app_path = os.path.dirname(os.path.abspath(__file__)).replace('/config', '') +sys.path.append(os.path.join(app_path, '{{ cookiecutter.project_slug }}')) from django.core.wsgi import get_wsgi_application {% if cookiecutter.use_sentry_for_error_reporting == 'y' -%} diff --git a/{{cookiecutter.project_slug}}/manage.py b/{{cookiecutter.project_slug}}/manage.py index 9de71376f..9694c5f84 100755 --- a/{{cookiecutter.project_slug}}/manage.py +++ b/{{cookiecutter.project_slug}}/manage.py @@ -20,4 +20,10 @@ if __name__ == '__main__': "forget to activate a virtual environment?" ) raise + + # This allows easy placement of apps within the interior + # {{ cookiecutter.project_slug }} directory. + current_path = os.path.dirname(os.path.abspath(__file__)) + sys.path.append(os.path.join(current_path, '{{ cookiecutter.project_slug }}')) + execute_from_command_line(sys.argv) diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 672334946..9589fd732 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -4,7 +4,7 @@ coverage==4.3.4 django-coverage-plugin==1.5.0 -Sphinx==1.5.3 +Sphinx==1.5.5 django-extensions==1.7.8 Werkzeug==0.12.1 django-test-plus==1.0.17 diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py index 8346f837d..bea9768a9 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/taskapp/celery.py @@ -28,9 +28,19 @@ class CeleryConfig(AppConfig): {% if cookiecutter.use_sentry_for_error_reporting == 'y' -%} if hasattr(settings, 'RAVEN_CONFIG'): # Celery signal registration +{% if cookiecutter.use_pycharm == 'y' -%} + # Since raven is required in production only, + # imports might (most surely will) be wiped out + # during PyCharm code clean up started + # in other environments. + # @formatter:off +{%- endif %} from raven import Client as RavenClient from raven.contrib.celery import register_signal as raven_register_signal from raven.contrib.celery import register_logger_signal as raven_register_logger_signal +{% if cookiecutter.use_pycharm == 'y' -%} + # @formatter:on +{%- endif %} raven_client = RavenClient(dsn=settings.RAVEN_CONFIG['DSN']) raven_register_logger_signal(raven_client) @@ -39,10 +49,20 @@ class CeleryConfig(AppConfig): {% if cookiecutter.use_opbeat == 'y' -%} if hasattr(settings, 'OPBEAT'): +{% if cookiecutter.use_pycharm == 'y' -%} + # Since opbeat is required in production only, + # imports might (most surely will) be wiped out + # during PyCharm code clean up started + # in other environments. + # @formatter:off +{%- endif %} from opbeat.contrib.django.models import client as opbeat_client from opbeat.contrib.django.models import logger as opbeat_logger from opbeat.contrib.django.models import register_handlers as opbeat_register_handlers from opbeat.contrib.celery import register_signal as opbeat_register_signal +{% if cookiecutter.use_pycharm == 'y' -%} + # @formatter:on +{%- endif %} try: opbeat_register_signal(opbeat_client)