Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: Could not import settings 'website.settings' (Is it on sys.path?): No module named website.settings #25

Open
ShahriyarR opened this issue Sep 23, 2014 · 6 comments

Comments

@ShahriyarR
Copy link

For testing purposes i just cloned and changed all necessary database related settings. After all getting an import error:

(django_env)sh@sh--work:~/Repos/newsdiffs$ python website/manage.py syncdb
Traceback (most recent call last):
  File "website/manage.py", line 17, in <module>
    execute_from_command_line(sys.argv)
  File "/home/sh/django_env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/home/sh/django_env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/sh/django_env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 263, in fetch_command
    app_name = get_commands()[subcommand]
  File "/home/sh/django_env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "/home/sh/django_env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 52, in __getattr__
    self._setup(name)
  File "/home/sh/django_env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 47, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/sh/django_env/local/lib/python2.7/site-packages/django/conf/__init__.py", line 132, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'website.settings' (Is it on sys.path?): No module named website.settings
@miguelcarvajal
Copy link

Same here. Did you solve this @ShahriyarR?

@ShahriyarR
Copy link
Author

@miguelcarvajal --- Problem is still here as we :)

@ghost
Copy link

ghost commented Dec 7, 2014

I'm having the same problem. Have either of you managed to find a solution? Thanks.

@Fil
Copy link

Fil commented Mar 19, 2015

found it! here's the patch that works for me (on Mac OS X):

diff --git a/website/manage.py b/website/manage.py
index 6fd85de..333e602 100755
--- a/website/manage.py
+++ b/website/manage.py
@@ -11,7 +11,7 @@ except OSError:

 if __name__ == "__main__":
     os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings")
-    sys.path.append(os.path.dirname(os.getcwd()))
+    sys.path.append(os.getcwd())
     from django.core.management import execute_from_command_line

     execute_from_command_line(sys.argv)

cwage added a commit to cwage/newsdiffs that referenced this issue Aug 10, 2015
@ryantate
Copy link

The @cwage fork fixed this for me, thanks much.

@lupa18
Copy link

lupa18 commented Aug 25, 2017

here same problem :(

caseyg added a commit to caseyg/cooperdiffs that referenced this issue Jul 3, 2018
0xrin1 referenced this issue in 0xrin1/newsdiffs Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants