@@ -66,6 +66,7 @@ INSTALLED_APPS = ( |
||
66 | 66 |
'photo', |
67 | 67 |
'pre', |
68 | 68 |
'server', |
69 |
+ 'shells', |
|
69 | 70 |
'statistic', |
70 | 71 |
'website', |
71 | 72 |
) |
@@ -9,4 +9,5 @@ pywe-pay==1.0.13 |
||
9 | 9 |
pywe-pay-notify==1.0.4 |
10 | 10 |
pywe-response==1.0.1 |
11 | 11 |
pywe-sign==1.0.8 |
12 |
+pywe-user==1.0.2 |
|
12 | 13 |
pywe-xml==1.0.6 |
@@ -0,0 +1,6 @@ |
||
1 |
+# -*- coding: utf-8 -*- |
|
2 |
+from __future__ import unicode_literals |
|
3 |
+ |
|
4 |
+from django.contrib import admin |
|
5 |
+ |
|
6 |
+# Register your models here. |
@@ -0,0 +1,8 @@ |
||
1 |
+# -*- coding: utf-8 -*- |
|
2 |
+from __future__ import unicode_literals |
|
3 |
+ |
|
4 |
+from django.apps import AppConfig |
|
5 |
+ |
|
6 |
+ |
|
7 |
+class ShellsConfig(AppConfig): |
|
8 |
+ name = 'shells' |
@@ -0,0 +1,6 @@ |
||
1 |
+# -*- coding: utf-8 -*- |
|
2 |
+from __future__ import unicode_literals |
|
3 |
+ |
|
4 |
+from django.db import models |
|
5 |
+ |
|
6 |
+# Create your models here. |
@@ -0,0 +1,6 @@ |
||
1 |
+# -*- coding: utf-8 -*- |
|
2 |
+from __future__ import unicode_literals |
|
3 |
+ |
|
4 |
+from django.test import TestCase |
|
5 |
+ |
|
6 |
+# Create your tests here. |
@@ -0,0 +1,23 @@ |
||
1 |
+# -*- coding: utf-8 -*- |
|
2 |
+ |
|
3 |
+from django.conf import settings |
|
4 |
+from pywe_storage import RedisStorage |
|
5 |
+from pywe_user import get_all_users |
|
6 |
+ |
|
7 |
+from utils.redis.connect import r |
|
8 |
+ |
|
9 |
+ |
|
10 |
+WECHAT = settings.WECHAT |
|
11 |
+ |
|
12 |
+ |
|
13 |
+def fetch_users_func(authorizer_appid, get_user_infos): |
|
14 |
+ print authorizer_appid, get_user_infos |
|
15 |
+ |
|
16 |
+ |
|
17 |
+def fetch_all_users(brand_id, ): |
|
18 |
+ wxcfg = WECHAT.get('{}:JSAPI'.format(brand_id), {}) |
|
19 |
+ |
|
20 |
+ appid = wxcfg.get('appID') |
|
21 |
+ secret = wxcfg.get('appsecret') |
|
22 |
+ |
|
23 |
+ get_all_users(appid=appid, secret=secret, storage=RedisStorage(r), users_func=fetch_users_func) |