diff --git a/HISTORY.rst b/HISTORY.rst index 2311e17..1b13410 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,11 @@ History ------- +0.2.6 (2017-04-08) +++++++++++++++++++ +* Improve module loading +* Added sample project + 0.2.5 (2017-03-06) ++++++++++++++++++ * Fix compatibility with python-telegram-bot 5.1 diff --git a/django_telegrambot/__init__.py b/django_telegrambot/__init__.py index 88a4db2..3c91b5f 100644 --- a/django_telegrambot/__init__.py +++ b/django_telegrambot/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.2.5' +__version__ = '0.2.6' default_app_config = 'django_telegrambot.apps.DjangoTelegramBot' diff --git a/requirements.txt b/requirements.txt index 81f0414..6bd885f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -django>=1.8.0 +django>=1.8.18 # Additional requirements go here python-telegram-bot>=5.1 diff --git a/sampleproject/bot/templates/base_generic.html b/sampleproject/bot/templates/base_generic.html new file mode 100644 index 0000000..227d90f --- /dev/null +++ b/sampleproject/bot/templates/base_generic.html @@ -0,0 +1,49 @@ + + +
+ {% block title %}
+Welcome in the sample project of Django-Telegrambot, aka how add Telegram bots to your Django app!
+
+The full documentation is at https://django-telegrambot.readthedocs.org.
+
No bots are available. Please configure it in settings.py
+{% endif %} +{% endblock %} diff --git a/sampleproject/bot/urls.py b/sampleproject/bot/urls.py new file mode 100644 index 0000000..c714da7 --- /dev/null +++ b/sampleproject/bot/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'^$', views.index, name='index'), +] diff --git a/sampleproject/bot/views.py b/sampleproject/bot/views.py index 91ea44a..6dffab3 100644 --- a/sampleproject/bot/views.py +++ b/sampleproject/bot/views.py @@ -1,3 +1,8 @@ from django.shortcuts import render +from django_telegrambot.apps import DjangoTelegramBot # Create your views here. +def index(request): + bot_list = DjangoTelegramBot.bots + context = {'bot_list': bot_list} + return render(request, 'bot/index.html', context) diff --git a/sampleproject/sampleproject/urls.py b/sampleproject/sampleproject/urls.py index 7eec06a..a1b33ed 100644 --- a/sampleproject/sampleproject/urls.py +++ b/sampleproject/sampleproject/urls.py @@ -19,4 +19,5 @@ urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^baseurl/', include('django_telegrambot.urls')), + url(r'^$', include('bot.urls')), ]