You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I am using cookiecutter-django on my project and having problem while trying to import settings from config outside app.
Getting error ModuleNotFoundError: No module named 'config' Project structure
Here I am sending message on telegram bot when object created. If I try to use os.environ['BOT_TOKEN'] it gives me another error from signals.pyKeyError: 'BOT_TOKEN'. BOT_TOKEN is located in .envs/.local/.bot
Please, can anyone help ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there! I am using
cookiecutter-django
on my project and having problem while trying to import settings from config outside app.Getting error
ModuleNotFoundError: No module named 'config'
Project structure
project ┣ .envs ┃ ┗ .local ┃ ┃ ┣ .bot ┃ ┃ ┣ .django ┣ bot ┃ ┣ __init__.py ┃ ┗ bot.py ┣ compose ┃ ┣ local ┃ ┃ ┣ django ┃ ┃ ┃ ┣ Dockerfile ┃ ┃ ┃ ┗ start ┃ ┃ ┗ pytelegrambot ┃ ┃ ┃ ┣ Dockerfile ┃ ┃ ┃ ┗ start ┣ config ┃ ┣ settings ┃ ┃ ┣ __init__.py ┃ ┃ ┣ base.py ┃ ┃ ┣ local.py ┃ ┣ __init__.py ┃ ┣ urls.py ┃ ┗ wsgi.py ┣ project ┃ ┣ app ┃ ┃ ┣ migrations ┃ ┃ ┃ ┗ __init__.py ┃ ┃ ┣ admin.py ┃ ┃ ┣ apps.py ┃ ┃ ┣ signals.py ┃ ┃ ┣ models.py ┃ ┃ ┗ views.py ┣ requirements ┃ ┣ base.txt ┣ README.md ┣ local.yml ┣ manage.py
bot.py
signals.py
Here I am sending message on telegram bot when object created. If I try to use
os.environ['BOT_TOKEN']
it gives me another error from signals.pyKeyError: 'BOT_TOKEN'
. BOT_TOKEN is located in.envs/.local/.bot
Please, can anyone help ?
Beta Was this translation helpful? Give feedback.
All reactions