Completed
Push — develop ( 74fa17...01f1ed )
by Wu
8s
created

text_handler()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
1
"""django_test URL Configuration
2
3
The `urlpatterns` list routes URLs to views. For more information please see:
4
    https://docs.djangoproject.com/en/1.9/topics/http/urls/
5
Examples:
6
Function views
7
    1. Add an import:  from my_app import views
8
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
9
Class-based views
10
    1. Add an import:  from other_app.views import Home
11
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
12
Including another URLconf
13
    1. Import the include() function: from django.conf.urls import url, include
14
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
15
"""
16
from django.conf.urls import url
17
from django.contrib import admin
18
from werobot import WeRoBot
19
from werobot.contrib.django import make_view
20
from werobot.utils import generate_token
21
22
robot = WeRoBot(enable_session=False,
23
                token="TestDjango",
24
                app_id="9998877",
25
                encoding_aes_key=generate_token(32))
26
27
28
@robot.text
29
def text_handler():
30
    return 'hello'
31
32
33
urlpatterns = [
34
    url(r'^admin/', admin.site.urls),
35
    url(r'^robot/', make_view(robot))
36
]
37