Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Fix config import #74

Merged
merged 1 commit into from
Nov 6, 2018
Merged

Conversation

sharmaeklavya2
Copy link
Contributor

When I execute python server/manage.py runserver 8080 or python server/manage.py loaddata dev_utils/graph_data.json, I get this error:

Traceback (most recent call last):
  File "server/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/mnt/code/repos/cloned/metacademy/meta_venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/mnt/code/repos/cloned/metacademy/meta_venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/mnt/code/repos/cloned/metacademy/meta_venv/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/mnt/code/repos/cloned/metacademy/meta_venv/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/mnt/code/repos/cloned/metacademy/meta_venv/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/mnt/code/repos/cloned/metacademy/metacademy-application/server/settings.py", line 8, in <module>
    import config
ImportError: No module named config

I saw a similar error message in #66.

This pull request fixes this error by adding the root directory of this repository to sys.path.

An ImportError is thrown by Django's manage.py when 'config' is
imported in server/settings.py. This commit fixes this bug.
Copy link
Member

@cjrd cjrd left a comment

Choose a reason for hiding this comment

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

great - thanks!

@cjrd cjrd merged commit 709a702 into metacademy:master Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants