From b275c7ca72687d4fb4a2a2d72b1d1b1ffa23446b Mon Sep 17 00:00:00 2001 From: kaidokert Date: Mon, 20 Jul 2015 02:10:31 +0100 Subject: [PATCH 1/3] Add .pep8 and .pylintrc --- {{cookiecutter.repo_name}}/.pep8 | 3 +++ {{cookiecutter.repo_name}}/.pylintrc | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/.pep8 create mode 100644 {{cookiecutter.repo_name}}/.pylintrc diff --git a/{{cookiecutter.repo_name}}/.pep8 b/{{cookiecutter.repo_name}}/.pep8 new file mode 100644 index 000000000..5c558cdd6 --- /dev/null +++ b/{{cookiecutter.repo_name}}/.pep8 @@ -0,0 +1,3 @@ +[pep8] +max-line-length = 120 +exclude=*/migrations/* diff --git a/{{cookiecutter.repo_name}}/.pylintrc b/{{cookiecutter.repo_name}}/.pylintrc new file mode 100644 index 000000000..ce2204c9d --- /dev/null +++ b/{{cookiecutter.repo_name}}/.pylintrc @@ -0,0 +1,11 @@ +[MASTER] +load-plugins=pylint_common, pylint_django{% if cookiecutter.use_celery == "y" %}, pylint_celery {% endif %} + +[FORMAT] +max-line-length=120 + +[MESSAGES CONTROL] +disable=missing-docstring,invalid-name + +[DESIGN] +max-parents=13 \ No newline at end of file From 362f86a4c11aa8c67107a0a6c5f3bcaf976bcecc Mon Sep 17 00:00:00 2001 From: kaido Date: Sun, 19 Jul 2015 21:55:29 -0700 Subject: [PATCH 2/3] Switch celery default serialization to JSON, to avoid pickle related deprecation warnings --- {{cookiecutter.repo_name}}/config/settings/common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/config/settings/common.py b/{{cookiecutter.repo_name}}/config/settings/common.py index 22d3d0849..cc6faece5 100644 --- a/{{cookiecutter.repo_name}}/config/settings/common.py +++ b/{{cookiecutter.repo_name}}/config/settings/common.py @@ -256,11 +256,14 @@ LOGGING = { } } {% if cookiecutter.use_celery == "y" %} -########## CELERY +# ######### CELERY INSTALLED_APPS += ('{{cookiecutter.repo_name}}.taskapp.celery.CeleryConfig',) # if you are not using the django database broker (e.g. rabbitmq, redis, memcached), you can remove the next line. INSTALLED_APPS += ('kombu.transport.django',) BROKER_URL = env("CELERY_BROKER_URL", default='django://') -########## END CELERY +CELERY_ACCEPT_CONTENT = ['json'] +CELERY_TASK_SERIALIZER = 'json' +CELERY_RESULT_SERIALIZER = 'json' +# ######### END CELERY {% endif %} # Your common stuff: Below this line define 3rd party library settings From 76a207d8dae65ed67ac59889d968b7841e11f260 Mon Sep 17 00:00:00 2001 From: Kaido Kert Date: Thu, 6 Aug 2015 11:21:08 -0700 Subject: [PATCH 3/3] Oops - revert celery defaults change, separate PR --- {{cookiecutter.repo_name}}/config/settings/common.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.repo_name}}/config/settings/common.py b/{{cookiecutter.repo_name}}/config/settings/common.py index cc6faece5..22d3d0849 100644 --- a/{{cookiecutter.repo_name}}/config/settings/common.py +++ b/{{cookiecutter.repo_name}}/config/settings/common.py @@ -256,14 +256,11 @@ LOGGING = { } } {% if cookiecutter.use_celery == "y" %} -# ######### CELERY +########## CELERY INSTALLED_APPS += ('{{cookiecutter.repo_name}}.taskapp.celery.CeleryConfig',) # if you are not using the django database broker (e.g. rabbitmq, redis, memcached), you can remove the next line. INSTALLED_APPS += ('kombu.transport.django',) BROKER_URL = env("CELERY_BROKER_URL", default='django://') -CELERY_ACCEPT_CONTENT = ['json'] -CELERY_TASK_SERIALIZER = 'json' -CELERY_RESULT_SERIALIZER = 'json' -# ######### END CELERY +########## END CELERY {% endif %} # Your common stuff: Below this line define 3rd party library settings