Skip to main content

虚拟币专用模块.

Project description

===== django-vcoin

django-vcoin project is coin application for hehuoya.com

virtual coin for app

Quick start

安装到特定目录下

pip3 install hhycommon --target='~/Library/Python/3.8/site-packages/'


  1. Add "vcoin" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [ ... 'vcoin', ],

  2. 配置aes密钥,默认为 AES_KEY : "A0UrOf/XVPjdPIKG"

  3. Include the class in your project views.py like this:: from vcoin.Checker import HHYAES from vcoin.views import VCoinManager

and then pass your user token for vcoin

aes_encrypt_data = HHYAES.aes_encrypt(utoken.decode(encoding='utf-8')) utoken = base64.b64encode(aes_encrypt_data.encode('utf-8')) VCoinManager.freezeCoin(utoken, 50, 1)

  1. Run python3 manage.py makemigrations vcoin to create the vcoin models.

  2. Run python3 manage.py migrate to create the vcoin models.

  3. Start the development server and visit http://127.0.0.1:8000/admin/ to create a models if needed (you'll need the Admin app enabled).

demo:

from vcoin.Checker import HHYAES
from vcoin.views import VCoinManager

def index(request):
    current_milli_time = int(round(time.time() * 1000))
    utoken = ('RVAMY>' + str(current_milli_time)).encode("utf-8")
    aes_encrypt_data = HHYAES.aes_encrypt(utoken.decode(encoding='utf-8'))
    utoken = base64.b64encode(aes_encrypt_data.encode('utf-8'))
    # 对base64的tokenAES加密
    VCoinManager.provideCoin(user_token=utoken, coin_count=10, coin_type=1)
    return HttpResponse(utoken)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vcoin-0.1.1.5.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vcoin-0.1.1.5-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file vcoin-0.1.1.5.tar.gz.

File metadata

  • Download URL: vcoin-0.1.1.5.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for vcoin-0.1.1.5.tar.gz
Algorithm Hash digest
SHA256 033d45513eb2d3945ac8543ecaa49d2cf36861dce9821a73a0b1925426b27688
MD5 9576f98796b660cf8e7039b6ad4925d0
BLAKE2b-256 222f66d45d5296428ce6f92e91322ae4d7dbfc76514566fd9df43d04685010f5

See more details on using hashes here.

File details

Details for the file vcoin-0.1.1.5-py3-none-any.whl.

File metadata

  • Download URL: vcoin-0.1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for vcoin-0.1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d03fb1f0b5419cc272ce833765f96bd2bd613b172f6a21f485c974c1a760d243
MD5 016ac109c33a919072aba4f417345ad9
BLAKE2b-256 4bf11ba6feb2a2fb2f6df1b887c2fb510f7ad0eadaccb7990573107f1756a09c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page