-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f8e4c7
commit eb7e4a8
Showing
2 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
============================= | ||
Cafe24 SMS module for Django | ||
============================= | ||
|
||
Python 2 & 3 compatible | ||
|
||
.. image:: https://travis-ci.org/iumjjing/cafe24-sms-Django.svg?branch=master | ||
:target: https://travis-ci.org/iumjjing/cafe24-sms-Django/ | ||
.. image:: https://coveralls.io/repos/github/iumjjing/cafe24-sms-Django/badge.svg?branch=master | ||
:target: https://coveralls.io/github/iumjjing/cafe24-sms-Django?branch=master | ||
|
||
- Source code: `<https://github.com/iumjjing/cafe24-sms-Django>`_ | ||
- Distribution: `<https://pypi.python.org/pypi/cafe24-sms-Django>`_ | ||
- Maintainer: `<https://github.com/hwshim0810>`_ | ||
|
||
Installation | ||
------------ | ||
|
||
You can install the library directly from pypi using pip: | ||
|
||
.. code-block:: shell | ||
$ pip install cafe24-sms-Django | ||
Edit your settings.py file: | ||
|
||
.. code-block:: python | ||
CAFE24_SMS_SETTINGS = { | ||
# Required | ||
'USER_ID': 'Your cafe24 id', | ||
'SECURE_KEY': 'Your secure key', | ||
'SENDER': 'Your telephone number ex) 000-0000 or 000-0000-0000', | ||
# Optional (If you want using default value, delete lines) | ||
'REQUEST_TIMEOUT': 30.0, | ||
'TEST_MODE': False, | ||
'CHARSET': 'euc-kr', | ||
'TIMEZONE': 'Asia/Seoul', | ||
} | ||
Dependencies | ||
------------ | ||
|
||
- Python 2.7 or 3.4+ | ||
- Django 1.11+ | ||
|
||
Quickstart | ||
---------- | ||
|
||
Send sms message to use shortcut function | ||
|
||
.. code-block:: python | ||
import cafe24_sms | ||
try: | ||
# Send single SMS | ||
cafe24_sms.send_message(message='message', receiver='will receive telephone number or number list') | ||
except SMSModuleException as e: | ||
print(e) | ||
- Send function returning Tuple(Result code, Remaining sms count) | ||
- If message byte length over 90, Message will be send lms type. | ||
- Receiver format: Single number('000-000-000') or Number list(['000-000-000','000-000-000']) | ||
|
||
More usage | ||
---------- | ||
|
||
Send / Reserve SMS message | ||
|
||
.. code-block:: python | ||
from django.utils import timezone | ||
import cafe24_sms | ||
try: | ||
# Reserve single SMS | ||
cafe24_sms.reserve_message( | ||
message='message', | ||
receiver='will receive telephone number or number list', | ||
reservation_time=timezone.now(), | ||
) | ||
# Send multiple SMS | ||
cafe24_sms.send_message( | ||
message='message', | ||
receiver=['telephone number', '...'], | ||
) | ||
# Reserve multiple SMS | ||
cafe24_sms.reserve_message( | ||
message='message', | ||
receiver=['telephone number', '...'], | ||
reservation_time=timezone.now(), | ||
) | ||
# Send message repeat 3 times, gap 15 minutes | ||
cafe24_sms.send_message( | ||
message='message', | ||
receiver='telephone number', | ||
rpt_num=3, | ||
rpt_time=15, | ||
) | ||
except SMSModuleException as e: | ||
print(e) | ||
-------------- | ||
|
||
Check the result of sent SMS. | ||
|
||
.. code-block:: python | ||
from django.utils import timezone | ||
import cafe24_sms | ||
data = cafe24_sms.result_check(start_date=timezone.now()) | ||
total_count = data.get_total_count() | ||
result_records = data.get_records() | ||
- If you need more detail, see method doc. | ||
|
||
Contributors | ||
------------ | ||
|
||
See https://github.com/iumjjing/cafe24-sms-Django/graphs/contributors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from __future__ import with_statement | ||
|
||
from setuptools import setup | ||
|
||
|
||
VERSION = '1.0.0' | ||
|
||
|
||
def readme(): | ||
try: | ||
with open('README.rst') as f: | ||
return f.read() | ||
except IOError: | ||
return '' | ||
|
||
|
||
INSTALL_REQUIRES = [ | ||
'Django>=1.11', | ||
] | ||
|
||
TESTS_REQUIRE = [ | ||
'pytest>=3.0.0', | ||
'pytest-cov', | ||
'tox', | ||
] | ||
|
||
|
||
setup( | ||
name='cafe24-sms-Django', | ||
version=VERSION, | ||
description='Send SMS messages to mobile devices through Cafe24 SMS api.', | ||
long_description=readme(), | ||
author='Hyunwoo Shim', | ||
author_email='[email protected]', | ||
url='https://github.com/iumjjing/cafe24-sms-Django', | ||
download_url='https://github.com/iumjjing/cafe24-sms-Django/archive/master.zip', | ||
packages=('cafe24_sms',), | ||
install_requires=INSTALL_REQUIRES, | ||
tests_require=TESTS_REQUIRE, | ||
classifiers=[ | ||
'Intended Audience :: Developers', | ||
'Operating System :: OS Independent', | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
], | ||
) |