Django-cryptocoin is a Django app to organize accepting bitcoin, litecoin, novacoin and other cryptocoins, which support JSON-RPC commands getnewaddress and getreceivedbyaddress.
Quick Start
Install using pip pip install django-cryptocoin
Add ‘django-cryptocoin’, to INSTALLED_APPS in your settings.py
Run python manage.py migrate
Set settings similarly as https://github.com/quantum13/django-crypto-paid-chat/blob/master/cryptochat/settings_local.py-example
Add command python manage.py check_incomings to cron with interval 1 minute
Add relation to CryptoOrder to your order model:
crypto_order = models.OneToOneField(CryptoOrder, related_name='order')
Add handler to payment end signal (delivery digital content, sending email, etc):
@receiver(after_pay_confirmation) def after_pay(sender, **kwargs): passAfter sending form with order we need create instance of CryptoOrder and redirect to process view. Example:
if form.is_valid(): crypto_order = CryptoOrder( currency='btc', amount=0.1,#price date=timezone.now(),#time of invoice redirect_to=reverse('home')#view to redirect after payment ) crypto_order.save() form.instance.crypto_order = crypto_order form.save() return redirect('cryptocoin-order-process', addr=crypto_order.addr)
After confirmation of transaction sended signal after_pay_confirmation which handler described above.
Example
Tested cryptocoins
Bitcoin
Litecoin
Novacoin
Emercoin
Options
CRYPTO_COINS
Dict with supported crypto currencies. Default:
{
'btc': 'Bitcoin',
'ltc': 'Litecoin',
'nvc': 'Novacoin',
}
CONNECTION_STRING
Connection strings for JSON-RPC commands to coin clients. Default:
{
'btc': 'your_bitcoin_addr_to_send_btc',
'ltc': 'your_litecoin_addr_to_send_ltc',
'nvc': 'your_novacoin_addr_to_send_nvc',
}
CONFIRMATIONS
Network confirmations count for each crypto currency. Default:
{
'btc': 1,
'ltc': 1,
'nvc': 1,
}
PROCESS_TEMPLATE
Template for process view. You can use own site template for this page. For example if you have base template base.html with block content you can create process.html in your template folder and paste this code:
{% extends 'base.html' %}
{% block content %}
{% include 'django_cryptocoin/process.html' %}
{% endblock %}
INVOICE_TIME
How many seconds app will wait for payment. If you set big value, exchange rate to USD can change significantly. Default 900 seconds/
GENERATED_ADDRESSES_ACCOUNT
Account for generated addresses in your wallet. Default django_cryptocoin.
CURRENCY_PAIRS
Currency pairs for which will retrieved exchange rates from btc-e.com. To retrieve this rates run command python manage.py get_exchange_rates. Than you can get this rates with function ExchangeRate.get_exchange_rate(from_currency, to_currency). Default:
['btc_usd', 'btc_rur', 'btc_eur', 'ltc_usd', 'ltc_rur', 'nvc_usd']
Donate
BTC: 1JrV8GW9HWRHWvJNQ14fExAkfgxawAY4oq
LTC: LiHkeymborDtpqUh3ExYT9CXJkyucDH4Cc
NVC: 4U5F4GQin6QkTpbd5k9si3f4iSkn2o3v9x
Metadata
Release files for django-cryptocoin 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-cryptocoin-0.1.1.zip | 16.3 kB | Without provenance | Details |
Release files / django-cryptocoin-0.1.1.zip
| Download URL | django-cryptocoin-0.1.1.zip |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a26f92785d6e6daa3d2b05b8e36daf3878fcd34c75a32c1cdb595a9881f01c54
|
|
BLAKE2b-256 checksum How to use checksums |
7f6e4bbcd2d2b0f15242527a59052b183f48491f463188eee7f5d8d06099b818
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-cryptocoin 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.