question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecate environment variables being loaded as settings

See original GitHub issue

Scrapy reads the following environment variables into settings named after them without the SCRAPY_ prefix:

  • SCRAPY_CHECK
  • SCRAPY_PICKLED_SETTINGS_TO_OVERRIDE
  • SCRAPY_PROJECT
  • SCRAPY_PYTHON_SHELL
  • SCRAPY_SETTINGS_MODULE

This is an unintended behavior, due to the (deprecated) feature that allows defining settings through environment variables not filtering out these environment variables that are not meant to generate settings.

I’ve seen cases where some of the resulting settings are used (settings.get('SETTINGS_MODULE')), so we need to deprecate this usage first, before we can eventually stop loading these environment variables into settings.

It may be tricky to do properly, because we need to avoid issuing a deprecation warning if same-name settings are defined without an environment variable. So, for example, if a project is using settings.get('SETTINGS_MODULE') but that project defines such a setting, we should not warn about it.

See #4375 for more context.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nyovcommented, Mar 2, 2020

Sorry, @joybhallaa, but let’s wait for someone from the maintainers team to clarify this - I could be wrong about it.

1reaction
joybh98commented, Feb 28, 2020

I’m taking this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scrapyd fails on depricated settings in environment variables
By inspecting my environment variables (thru this command at prompt: printenv ) I've found SCRAPY_SETTINGS_MODULE pointing to my scrapy  ...
Read more >
Use environment variables | Cloud Run Documentation
View environment variables settings · Go to Cloud Run · Click the service you are interested in to open the Service details page....
Read more >
Environment variables — dynaconf 2.2.3 documentation
Environment variables take precedence over all other configuration sources: if the variable is set, it will be used as the value for the...
Read more >
Environment variables and app settings in Azure App Service
Signifies a variable is specific to the Kudu app. SQLCONNSTR_, Signifies a SQL Server connection string in the app configuration. It's injected ...
Read more >
Environment variables in Compose | Docker Documentation
Your configuration options can contain environment variables. Compose uses the variable values from the shell environment in which docker-compose is run.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found