JungDev / django-telegrambot

Simple app for Telegram bot in Django
BSD 3-Clause "New" or "Revised" License
237 stars 88 forks source link

Attribute Error: 'Settings' object has no attribute 'DJANGO_TELEGRAMBOT' #16

Open koralfade opened 6 years ago

koralfade commented 6 years ago

Hi! Can you help me to solve this problem? This happens when I run python manage.py migrate / runserver.

koralfade commented 6 years ago

I even created a new folder, virtualenv, clone your repository, install all requirements, problem didn't solved

amir-yaghoubi commented 6 years ago

Hi, You should add DJANGO_TELEGRAMBOT in your settings.py and follow instructions as Here shows.

luojiyin1987 commented 6 years ago

I think @koralfade see Sample Application

Copy file local_settings.sample.py as local_settings.py and edit your bot token

cp sampleproject/local_settings.sample.py sampleproject/local_settings.py

nano sampleproject/local_settings.py

when set my website and bot token in local_settings.py python manage.py runserver
report Attribute Error: 'Settings' object has no attribute 'DJANGO_TELEGRAMBOT'

solution

I remove it in setting.py

try:
    from local_settings import *
except:
    pass

then cat local_settings.py >> settings.py

background

I use Python3.6 and virtualenv,