I launch Fail so

aster3 / telping # python3 demonik.py

file itself

import asterisk.manager import re import time import os os.environ["DJANGO_SETTINGS_MODULE"] = "aster3.settings" import django django.setup() from telping.models import Tellping_offline, Tellping_online import datetime def sbor24(): a=1 while a < 5: ......... 

such a mistake

 root@xmaster-HP-ProBook-4540s:/home/xmaster/PycharmProjects/aster3/telping# python3 demonik.py Traceback (most recent call last): File "demonik.py", line 7, in <module> django.setup() File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 22, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 53, in __getattr__ self._setup(name) File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 41, in _setup self._wrapped = Settings(settings_module) File "/usr/local/lib/python3.5/dist-packages/django/conf/__init__.py", line 97, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked ImportError: No module named 'aster3' 

And in Pytcharm works, actually a question how to pick up aplication from django? That all earned. structure
enter image description here

    1 answer 1

    Without an idea of ​​the full structure of the project, it is certainly difficult to assert, but most likely a problem in the field of visibility. demonik.py runs from the telping module directory, in the namespace of which there is no aster3. Try:

     root@xmaster-HP-ProBook-4540s:/home/xmaster/PycharmProjects/aster3# python3 telping/./demonik.py