3
File "C:\Users\User\path\lib\site-packages\environ\environ.py", line 277, in get_value
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: Set the CELERY_BROKER_URL environment variable

I'm getting this error when I execute the python manage.py command.

I already installed cookiecutter with its requirements but I don't know where to go from there.

Any suggestions?

2 Answers2

4

When you create user project with cookiecutter, you must set every required settings. In this case, it is celery.

What is celery?

If you don't want to use celery, I recommend you to recreate your project. Then type n when cookiecutter ask to use celery.

If you want to use celery, see this tutorial First step with Django.

I give you some advise. cookiecutter is powerful tool to create project simply. But if you are not familiar with django and other libraries, the cookiecutter could confuse you. So I recommend you not to use the cookiecutter. Instead, look at this tutorial and proceed step by step.

Jrog
  • 1,469
  • 10
  • 29
  • 1
    This link (http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html) goes nowhere. – Harlin Mar 22 '22 at 00:51
0

I think is not a good idea to abandon a technology when you find small issues on initialization, I started a project with "Cookiecutter Django" and I find It very powerful, so for those who still have this issue do the following:

Following the cookiecutter documentation https://cookiecutter-django.readthedocs.io/en/latest/developing-locally.html you will find this:

$ export CELERY_BROKER_URL=redis://localhost:6379/0

To convert the above command in Windows just follow this post https://linuxhint.com/windows-equivalent-export-command/

The “setx” command can be utilized in Windows Command Prompt to set environment variables permanently. However, in order to set environment variables just for a session or temporarily, utilize the “set” command.

To set environment variables just for a session or temporarily use:

set CELERY_BROKER_URL=redis://localhost:6379/0

To set environment variables permanently use:

set CELERY_BROKER_URL=redis://localhost:6379/0