Git Product home page Git Product logo

django-security-check's Introduction

django-security-check's People

Contributors

fi-do avatar victoriadrake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

django-security-check's Issues

ModuleNotFoundError: No module named 'dotenv'

Django Security Check identified issues:
Traceback (most recent call last):
File "/github/workspace/manage.py", line 5, in
from dotenv import load_dotenv
ModuleNotFoundError: No module named 'dotenv'

Job passes when there is an exception

Describe the bug
I didnt set DB_NAME, but the step doesnt fail.

The log is

--------- Django Security Check results ---------
Traceback (most recent call last):
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/environ/environ.py", line 367, in get_value
    value = self.ENVIRON[var]
  File "/usr/local/lib/python3.7/os.py", line 681, in __getitem__
    raise KeyError(key) from None
KeyError: 'DB_NAME'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/core/management/commands/check.py", line 69, in handle
    databases=options['databases'],
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/core/management/base.py", line 423, in check
    databases=databases,
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/core/checks/registry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/core/checks/translation.py", line 52, in check_setting_languages_bidi
    for tag in settings.LANGUAGES_BIDI if not isinstance(tag, str) or not language_code_re.match(tag)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/conf/__init__.py", line 82, in __getattr__
    self._setup(name)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/conf/__init__.py", line 69, in _setup
    self._wrapped = Settings(settings_module)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/django/conf/__init__.py", line 170, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/github/workspace/src/brain/settings/__init__.py", line 1, in <module>
    from .base import *
  File "/github/workspace/src/brain/settings/base.py", line 98, in <module>
    'NAME': env.str('DB_NAME'),
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/environ/environ.py", line 191, in str
    value = self.get_value(var, cast=str, default=default)
  File "/github/home/.local/share/virtualenvs/workspace-0SZQOxG8/lib/python3.7/site-packages/environ/environ.py", line 371, in get_value
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: Set the DB_NAME environment variable

Expected behavior
The github action step should fail with a non-zero exit code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.