Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use hiredis #2577

Merged
merged 6 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion {{cookiecutter.project_slug}}/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi
{%- if cookiecutter.use_whitenoise == 'y' %}
whitenoise==5.0.1 # https://github.com/evansd/whitenoise
{%- endif %}
redis==3.5.0 # https://github.com/andymccurdy/redis-py
redis==3.5.0 # https://github.com/andymccurdy/redis-py
{%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %}
hiredis==1.0.1 # https://github.com/redis/hiredis-py
{%- endif %}
{%- if cookiecutter.use_celery == "y" %}
celery==4.4.2 # pyup: < 5.0 # https://github.com/celery/celery
django-celery-beat==2.0.0 # https://github.com/celery/django-celery-beat
Expand Down
3 changes: 3 additions & 0 deletions {{cookiecutter.project_slug}}/requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Collectfast==2.1.0 # https://github.com/antonagestam/collectfast
{%- if cookiecutter.use_sentry == "y" %}
sentry-sdk==0.14.3 # https://github.com/getsentry/sentry-python
{%- endif %}
{%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %}
hiredis==1.0.1 # https://github.com/redis/hiredis-py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused here. The line tells me that if people are not using docker and they have said yes to windows, we force the use of hiredis in production? Is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's just wrong to use a Windows machine to deploy a server. If you take a look at base.txt, it has a different condition for if you use Windows or Docker. If you do use Windows but not docker, you cannot build hiredis. But, since you wanted to use Redis, you'll also get hiredis for production, assuming, with hope, that you deploy with a unix.

However, if you use Docker on Windows, you should be able to build hiredis, and thus it can go into base.txt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks - that clarifies a lot. I see this is mentioned in the description as well but it didn't click until now.

Thanks a lot!

{%- endif %}

# Django
# ------------------------------------------------------------------------------
Expand Down