I have my Django app settings in a folder within the app folder with an init.py and this works fine on my current VPS server, Pycharm development and in the Divio local development environment. However, when I try and deploy this to Divio staging I get "ModuleNotFoundError: No module named 'settings'". Why is this?
Manage.py:
#!/usr/bin/env python
import os
from aldryn_django import startup
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
startup.manage(path=os.path.dirname(os.path.abspath(__file__)))
No settings.py file
Folder called settings with:
_ init _.py
from .dev_divio import * # or .dev if you want dev
from .common import *
INSTALLED_ADDONS = [
# <INSTALLED_ADDONS> # Warning: text inside the INSTALLED_ADDONS tags is auto-generated. Manual changes will be overwritten.
'aldryn-addons',
'aldryn-django',
'aldryn-sso',
# </INSTALLED_ADDONS>
]
import aldryn_addons.settings
aldryn_addons.settings.load(locals())
# Application definition
INSTALLED_APPS.extend([
# add your project specific apps here
# 'django.contrib.admin',
# 'django.contrib.auth',
# 'django.contrib.contenttypes',
# 'django.contrib.sessions',
# 'django.contrib.messages',
# 'django.contrib.staticfiles',
# 'django.contrib.sites',
'rest_framework',
'rest_framework.authtoken',
'appname',
])
which imports:
common.py dev_divio.py
The two files above have the config in.