I want to create the app in django 1.8.12
and I type `python manage.py startapp fb_weatherbot
and the traceback:
File "C:\Users\User\Anaconda3\lib\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 956, in _find_and_load_unlocked
ImportError: No module named 'fb_weatherbot'
What part I missed?
I have added the app in INSTALLED_APPS in the settings.py
thank you.
Add it to INSTALLED_APPS after running startapp, not before.
Explanation: running manage.py imports settings.py, so it tries to find fb_weatherbot app which doesn't exist (yet).
Example (error output truncated):
INSTALLED_APPS = [
…
'fb_weatherbot'
]
$ ./manage.py startapp fb_weatherbot
Traceback (most recent call last):
…
ImportError: No module named 'fb_weatherbot'
INSTALLED_APPS = [
…
# 'fb_weatherbot'
]
$ ./manage.py startapp fb_weatherbot
$ # outputs nothing, app is created
Uncomment it again after running startapp, of course.