From 5ca49c0b3c460558865a5781144353009c1f4611 Mon Sep 17 00:00:00 2001 From: "Francesco Scarlato (Jungmann)" Date: Sat, 8 Apr 2017 13:01:56 +0200 Subject: [PATCH] version 0.2.6 --- HISTORY.rst | 5 ++ django_telegrambot/__init__.py | 2 +- requirements.txt | 2 +- sampleproject/bot/templates/base_generic.html | 49 +++++++++++++++++++ sampleproject/bot/templates/bot/index.html | 23 +++++++++ sampleproject/bot/urls.py | 7 +++ sampleproject/bot/views.py | 5 ++ sampleproject/sampleproject/urls.py | 1 + 8 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 sampleproject/bot/templates/base_generic.html create mode 100644 sampleproject/bot/templates/bot/index.html create mode 100644 sampleproject/bot/urls.py 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 %}Django-Telegrambot{% endblock %} + + + + + + + + {% load static %} + + + + + +
+ +
+
+ {% block sidebar %} + + {% endblock %} +
+
+ {% block content %}{% endblock %} +
+
+
+ + + diff --git a/sampleproject/bot/templates/bot/index.html b/sampleproject/bot/templates/bot/index.html new file mode 100644 index 0000000..fca8289 --- /dev/null +++ b/sampleproject/bot/templates/bot/index.html @@ -0,0 +1,23 @@ +{% extends "base_generic.html" %} + +{% block content %} +

Django-TelegramBot

+

+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. +

+ +{% if bot_list %} +

Bot's List:

+ +{% else %} +

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')), ]