Forums

Import settings stuck

Hello, I think it's very popular issue, but I cant deal with it. my projects details: Django 1.9 python 3.5.2 structure details: /home/timofeyantonenko/vityaz/manage.py /home/timofeyantonenko/vityaz/vityaz/settings.py

Part of wsgi: path = '/home/timofeyantonenko/vityaz' os.environ['DJANGO_SETTINGS_MODULE'] = 'vityaz.settings'

All tests with python -i /var/www/timofeyantonenko_pythonanywhere_com_wsgi.py work good.

In error log I have this: ImportError: No module named 'vityaz.settings'. Sorry, I think an answer is near, but I can't solve my problem( So, any suggestions?

Hm. Is there a __init__.py in /home/timofeyantonenko/vityaz ? Does removing it change anything?

harry, thanks you a lot, it's help and you save my day. But how it works?

You had 2 modules on your path called vityaz. The first on one the path had no settings module in it, so Python failed to find the settings module in the second one. Removing __init__.py stopped that directory from being a module so Python could find the second one which had your settings.