# Deploy: Spooky environment variable

**URL:** <https://forum.djangoproject.com/t/deploy-spooky-environment-variable/17650>\
**Category:** Deployment\
**Created:** [December 16, 2022, 8:37am UTC](https://forum.djangoproject.com/t/deploy-spooky-environment-variable/17650 "2022-12-16T08:37:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![silviogesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/silviogesell/32/10974_2.png) [@silviogesell](https://forum.djangoproject.com/u/silviogesell)\
**Post date:** [December 16, 2022, 8:37am UTC](https://forum.djangoproject.com/t/deploy-spooky-environment-variable/17650/1 "2022-12-16T08:37:25Z")

</div>

I have a strange problem when deploying.  
For deploying I set the environment variables via file and an export:

> production.conf  
> DJANGO\_CONFIGURATION=“Prod”  
> DJANGO\_SECRET\_KEY=“abc”  
> DJANGO\_DATABASE\_URL=“mysql://testuser:testpwd@localhost/testdb”
> 
> export $(cat production.conf | xargs)

After python3 manage.py makemigrations I get the following error messages:

> Traceback (most recent call last):  
> File “/home/testuser/test/manage.py”, line 23, in   
> main()  
> File “/home/testuser/test/manage.py”, line 19, in main  
> execute\_from\_command\_line(sys.argv)  
> File “/home/testuser/test-venv/lib/python3.10/site-packages/django/core/management/ **init**.py”, line 446, in execute\_from\_command\_line  
> utility.execute()  
> File “/home/testuser/test-venv/lib/python3.10/site-packages/django/core/management/ **init**.py”, line 386, in execute  
> settings.INSTALLED\_APPS  
> File “/home/testuser/test-venv/lib/python3.10/site-packages/django/conf/ **init**.py”, line 92, in **getattr**  
> self.\_setup(name)  
> File “/home/testuser/test-venv/lib/python3.10/site-packages/django/conf/ **init**.py”, line 79, in \_setup  
> self.\_wrapped = Settings(settings\_module)  
> File “/home/testuser/test-venv/lib/python3.10/site-packages/django/conf/ **init**.py”, line 190, in **init**  
> mod = importlib.import\_module(self.SETTINGS\_MODULE)  
> File “/usr/lib/python3.10/importlib/ **init**.py”, line 126, in import\_module  
> return \_bootstrap.\_gcd\_import(name[level:], package, level)  
> File “”, line 1050, in \_gcd\_import  
> File “”, line 1027, in \_find\_and\_load  
> File “”, line 1006, in \_find\_and\_load\_unlocked  
> File “”, line 672, in \_load\_unlocked  
> File “”, line 632, in \_load\_backward\_compatible  
> File “/home/testuser/test-venv/lib/python3.10/site-packages/configurations/importer.py”, line 153, in load\_module  
> reraise(err, "Couldn’t find configuration ‘{0}’ "  
> File “/home/testuser/test-venv/lib/python3.10/site-packages/configurations/utils.py”, line 65, in reraise  
> raise exc  
> File “/home/testuser/test-venv/lib/python3.10/site-packages/configurations/importer.py”, line 151, in load\_module  
> cls = getattr(mod, self.name)  
> ’ . Did you mean: ‘Prod’?module ‘test.settings’ has no attribute 'Prod

If I enter the value of the environment variable DJANGO\_CONFIGURATION manually, everything is ok.

> DJANGO\_CONFIGURATION=“Prod”  
> export DJANGO\_CONFIGURATION
> 
> python3 manage.py makemigrations  
> No changes detected

The value of the environment variable DJANGO\_DATABASE\_URL does not cause any problem, only DJANGO\_CONFIGURATION.

I was thinking of an encoding problem, but that’s probably out of the question. Also because env always shows the same values ​​for DJANGO\_CONFIGURATION. But the same value is obviously not the same for Django after all.

Does anyone have an explanation for this?

---

<div class="post-metadata">

**Author:** ![leandrodesouzadev](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/leandrodesouzadev/32/8981_2.png) [@leandrodesouzadev](https://forum.djangoproject.com/u/leandrodesouzadev)\
**Post date:** [December 16, 2022, 11:37am UTC](https://forum.djangoproject.com/t/deploy-spooky-environment-variable/17650/2 "2022-12-16T11:37:17Z")

</div>

What happens when you unquote the value `"Prod"` → `Prod`?
