I am new to Django and Python.
I have created a python file in my application root called services.py. Inside this file I have a class named SchedulerService. I am trying to initialize an instance of SchedulerService in the settings module so it will be available every time a view is executed. In the Java world I would use a singleton object and initialize it with an auto init servlet or a MBean.
The problem I am running into is that I cannot import any custom modules into the settings.py file. For instance:
settings.py
from theapp.services import SchedulerService
I get the following message when I attempt to start my development server
Error: Can't find the file 'settings.py' in the directory containing 'manage.py'. It appears you've customized things.
You'll have to run django-admin.py, passing it your settings module.
(If the file settings.py does indeed exist, it's causing an ImportError somehow.)
I get the same error if I try to import a view or model class into the settings module.
Perhaps I am going about it entirely wrong and should be implementing this in another manner.
Any help will be appreciated.