From 6d3236d21bd370d6308223b14d9be925462f91f1 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 12 Mar 2018 12:25:28 +0000 Subject: [PATCH] Install psycopg2-binary when not using docker locally - The binary package should be installable on Windows locally - The binary package is not recommended for Production, compile from source --- {{cookiecutter.project_slug}}/requirements/base.txt | 5 ----- {{cookiecutter.project_slug}}/requirements/local.txt | 5 +++++ {{cookiecutter.project_slug}}/requirements/production.txt | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 4b2ac77f8..96ec92f29 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,11 +8,6 @@ argon2-cffi==18.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==3.3.1 # https://github.com/evansd/whitenoise {%- endif %} -{%- if cookiecutter.windows == 'y' %} -# TODO: On Windows, install psycopg2 manually from http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg -{%- else %} -psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 -{%- endif %} redis>=2.10.5 # https://github.com/antirez/redis {%- if cookiecutter.use_celery == "y" %} celery==3.1.25 # pyup: <4.0 # https://github.com/celery/celery diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 6b6323d42..a54270cd2 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -3,6 +3,11 @@ Werkzeug==0.14.1 # https://github.com/pallets/werkzeug ipdb==0.11 # https://github.com/gotcha/ipdb Sphinx==1.7.1 # https://github.com/sphinx-doc/sphinx +{%- if cookiecutter.use_docker == 'y' %} +psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 +{%- else %} +psycopg2-binary==2.7.4 # https://github.com/psycopg/psycopg2 +{%- endif %} # Testing # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index e605e2202..bec8ce3c8 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -5,6 +5,7 @@ gevent==1.2.2 gunicorn==19.7.1 # https://github.com/benoitc/gunicorn boto3==1.6.2 # pyup: update minor # https://github.com/boto/boto3 +psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2 {%- if cookiecutter.use_whitenoise == 'n' %} Collectfast==0.6.0 # https://github.com/antonagestam/collectfast {%- endif %}