Skip to content

Commit

Permalink
switched back to rst
Browse files Browse the repository at this point in the history
fixed restructured style for readme
  • Loading branch information
lukruh authored Jul 25, 2020
1 parent 67403d1 commit 76742ec
Showing 1 changed file with 40 additions and 12 deletions.
52 changes: 40 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
NOTE: This is a fork of the original django-telegrambot module, it contains updates to new django and ptb versions and features/fixes from contributors. To install this fork run: ``pip install -e git+https://github.com/telebotter/django-telegrambot.git#egg=django-telegrambot --upgrade``.
## Documentation
NOTE: This is a fork of the original django-telegrambot module, it contains updates to new django and ptb versions and features/fixes from contributors. To install this fork run::

pip install -e git+https://github.com/telebotter/django-telegrambot.git#egg=django-telegrambot --upgrade

Documentation
=============

The full documentation of the original library is at https://django-telegrambot.readthedocs.org.


## Changelog
Changelog
=========

The latest version to the base repository was v1.0.1, this fork started as a PR for v1.0.2


## Quickstart
Quickstart
==========

Install django-telegrambot
::

pip install -e git+https://github.com/telebotter/django-telegrambot.git#egg=django-telegrambot --upgrade

## Register the App
Register the App
=============

Add ``django_telegrambot`` in ``INSTALLED_APPS``
::

#settings.py
INSTALLED_APPS = (
Expand All @@ -25,7 +36,9 @@ Add ``django_telegrambot`` in ``INSTALLED_APPS``
)


## Setup your Bots
Setup your Bots
=============
::

#settings.py
#Django Telegram Bot settings
Expand Down Expand Up @@ -115,6 +128,7 @@ Add ``django_telegrambot`` in ``INSTALLED_APPS``


Include in your urls.py the ``django_telegrambot.urls``
::

#urls.py
urlpatterns = [
Expand All @@ -124,6 +138,7 @@ Include in your urls.py the ``django_telegrambot.urls``
]

Then use it in a project creating a module ``telegrambot.py`` in your app
::

#myapp/telegrambot.py
# Example code for telegrambot.py module
Expand Down Expand Up @@ -174,15 +189,17 @@ Then use it in a project creating a module ``telegrambot.py`` in your app



## Features of this Fork
Features of this Fork
=============

* Support latest django and python-telegram-bot versions
* Support latest telegram bot API
* Optionally skip webhook setup
* Change bots from settings (use personal bot_id instead of registered botname)


## Original Features
Original Features
=============

* Multiple bots
* Admin dashboard available at ``/admin/django-telegrambot``
Expand All @@ -195,50 +212,61 @@ Then use it in a project creating a module ``telegrambot.py`` in your app



## Running Tests
Running Tests
=============

NOTE: The tests have not been updated for latest features. See Issue #13

Does the code actually work?
::

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements-test.txt
(myenv) $ python runtests.py


## Sample Application
Sample Application
=============

There a sample application in `sampleproject` directory. Here is installation instructions:

1. Install requirements with command
::

pip install -r requirements.txt
2. 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
3. Run Django migrations

python manage.py migrate
4. Run server

::
python manage.py runserver
5. If **WEBHOOK** Mode setted go to 8

6. If **POLLING** Mode setted, open in your browser http://localhost/

7. Open Django-Telegram Dashboard http://localhost/admin/django-telegrambot and follow instruction to run worker by management command `botpolling`. Then go to 10

8. To test webhook locally install `ngrok` application and run command
::

./ngrok http 8000
9. Change `WEBHOOK_SITE` and `ALLOWED_HOSTS` in local_settings.py file

10. Start a chat with your bot using telegram.me link avaible in **Django-Telegram Dashboard** at http://localhost/admin/django-telegrambot


## Credits
Credits
=============

* `Python Telegram Bot` https://github.com/python-telegram-bot/python-telegram-bot
* `Django` https://www.djangoproject.com/
Expand Down

0 comments on commit 76742ec

Please sign in to comment.