{
"info": {
"author": "Jeremias Kangas",
"author_email": "UNKNOWN",
"bugtrack_url": null,
"classifiers": [],
"description": "Introduction\n================\n\n``django-bitcoin`` is a `Django web framework `_\napplication for building Bitcoin web apps.\n\n.. contents ::\n\nFeatures\n============\n\n* Simple Bitcoin wallet management\n\n* Bitcoin payment processing\n\n* Bitcoin market information\n\nInstallation\n============\n\nTo install, just add the app to your settings.py INSTALLED_APPS like::\n\n INSTALLED_APPS = [\n ...\n 'django_bitcoin',\n ...\n ]\n ```\n\nAlso you have to run a local bitcoind instance, and specify connection string in settings::\n\n BITCOIND_CONNECTION_STRING = \"http://bitcoinuser:password@localhost:8332\"\n\nUsage\n=====\n\nTutorial\n---------\n\n`There is a small tutorial about how to use django-bitcoin to create your own instawallet `_.\n\nWallet websites, escrow services using the \"Wallet\"-model\n------------------------------------------------------------\n\nYou can use the `Wallet` class to do different bitcoin-moving applications. Typical example would be a marketplace-style site, where there are multiple sellers and buyer. Or job freelance site, where escrow is needed. Or even an exchange could be done with this abstraction (a little extra classes would be needed however).\n\nNote that while you move bitcoins between Wallet-objects, only bitcoin transactions needed are incoming and outgoing transactions.\nTransactions between the system \"Wallet\"-objects don't generate \"real\" bitcoin transactions. Every transaction (except incoming transactions) is logged to `WalletTransaction` object to ease accounting.\n\nThis also means that outgoing bitcoin transactions are \"mixed\"::\n\n\n from django_bitcoin import Wallet, currency\n\n class Profile(models.Model):\n wallet = ForeignKey(Wallet)\n outgoing_bitcoin_address = CharField()\n\n class Escrow(models.Model):\n wallet = ForeignKey(Wallet)\n buyer_happy = BooleanField(default=False)\n\n buyer=Profile.objects.create()\n seller=Profile.objects.create()\n\n purchase=Escrow.objects.create()\n\n AMOUNT_USD=\"9.99\"\n\n m=currency.Money(AMOUNT_USD, \"USD\")\n btc_amount=currency.exchange(m, \"BTC\")\n\n print \"Send \"+str(btc_amount)+\" BTC to address \"+buyer.wallet.receiving_address()\n\n sleep(5000) # wait for transaction\n\n if p1.wallet.total_balance()>=btc_amount:\n p1.send_to_wallet(purchase, btc_amount)\n\n sleep(1000) # wait for product/service delivery\n\n if purchase.buyer_happy:\n purchase.wallet.send_to_wallet(seller.wallet)\n seller.wallet.send_to_address(seller.outgoing_bitcoin_address, seller.wallet.total_balance())\n else:\n print \"WHY U NO HAPPY\"\n #return bitcoins to buyer, 50/50 split or something\n\nTemplatetags\n----------------\n\nTo display transaction history and simple wallet tagline in your views, use the following templatetags::\n\n {% load currency_conversions %}\n \n {% wallet_tagline profile.bitcoin_wallet %}\n \n {% wallet_history profile.bitcoin_wallet %}\n\nEasy way to convert currencies from each other: `btc2usd, usd2btc, eur2btc, btc2eur`\n\nAlso currency2btc, btc2currency for any currencies on bitcoincharts.com::\n\n {% load currency_conversions %}\n Hi, for the pizza: send me {{bitcoin_amount}}BTC (about {{ bitcoin_amount|btc2usd }}USD).\n\nDisplay QR code of the bitcoin payment using google charts API::\n\n {% load currency_conversions %}\n Pay the following payment with your android bitcoin wallet:\n {% bitcoin_payment_qr wallet.receiving_address bitcoin_amount %}.\n\n The same but display also description and an estimate in EUR:\n {% bitcoin_payment_qr wallet.receiving_address bitcoin_amount \"One beer\" \"EUR\" %}.\n\nTransaction notifications\n-----------------------------\n\nTo enable bitcoin transaction notifications, set the following flag in your ``settings.py``::\n\n BITCOIN_TRANSACTION_SIGNALING = True\n\nAfter that, you need to setup a *cron* job to run each minute, something like the following::\n\n\n * * * * * (cd $APP_PATH && python manage.py python manage.py CheckTransactions >> $APP_PATH/logs/email_sends.log 2>&1)\n\n\nAfter that you can define your balance_changed and balance_changed_confirmed signals::\n\n from django_bitcoin.models import balance_changed, balance_changed_confirmed\n from django.dispatch import receiver\n\n\n @receiver(balance_changed)\n def balance_changed_handler(sender, **kwargs):\n pass\n # try:\n # print \"balance changed\", sender.id, kwargs[\"changed\"], sender.total_balance()\n\n\n @receiver(balance_changed_confirmed)\n def balance_changed_confirmed_handler(sender, **kwargs):\n pass\n\nCommunity\n==========\n\nCurrently ``django-bitcoin`` is used at production in\n\n* `localbitcoins.com `_\n\n* `bountychest.com `_\n\nMore to come!\n\nIf you have a site using django-bitcoin, drop me an email and I will link to it here.\n\nSupport and source code\n=========================\n\n`Issue tracker at Github.com `_.\n\n\n\nChangelog\n===================\n\n0.2 (2013-05-14)\n----------------\n\n- README.rst, change log and release process workflow updates [miohtama]\n\n- Historical prices data handling [Jeremias Kangas]\n\n0.1\n----\n\n- Initial release",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/kangasbros/django-bitcoin",
"keywords": null,
"license": "MIT",
"maintainer": null,
"maintainer_email": null,
"name": "django-bitcoin",
"package_url": "https://pypi.org/project/django-bitcoin/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/django-bitcoin/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/kangasbros/django-bitcoin"
},
"release_url": "https://pypi.org/project/django-bitcoin/0.2/",
"requires_dist": null,
"requires_python": null,
"summary": "Bitcoin application integration for Django web framework",
"version": "0.2"
},
"last_serial": 789183,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "fef010dda54be7420255739609dfff85",
"sha256": "24e846d17f04d4fa5c9787ec8bd1d92563c88b826d311f1c5224f1160eeceef4"
},
"downloads": -1,
"filename": "django-bitcoin-0.1.tar.gz",
"has_sig": false,
"md5_digest": "fef010dda54be7420255739609dfff85",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12397,
"upload_time": "2012-04-10T14:58:47",
"url": "https://files.pythonhosted.org/packages/56/0d/f1730081376419016d56dab04a6cc4ede848ffb291d1394d33cea5aa8010/django-bitcoin-0.1.tar.gz"
}
],
"0.2": [
{
"comment_text": "",
"digests": {
"md5": "22f1f2e69b97abe0b12d94c9cdc6de68",
"sha256": "c594557a567edf9a6dd170c30117f0e5dad6044eeeebef5f8fe4d40187f800a1"
},
"downloads": -1,
"filename": "django-bitcoin-0.2.zip",
"has_sig": false,
"md5_digest": "22f1f2e69b97abe0b12d94c9cdc6de68",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 63590,
"upload_time": "2013-05-14T09:09:00",
"url": "https://files.pythonhosted.org/packages/92/50/05b375d9819fb57c87ba12c1c54dd203c805a3b3336699348ad6d9618835/django-bitcoin-0.2.zip"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "22f1f2e69b97abe0b12d94c9cdc6de68",
"sha256": "c594557a567edf9a6dd170c30117f0e5dad6044eeeebef5f8fe4d40187f800a1"
},
"downloads": -1,
"filename": "django-bitcoin-0.2.zip",
"has_sig": false,
"md5_digest": "22f1f2e69b97abe0b12d94c9cdc6de68",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 63590,
"upload_time": "2013-05-14T09:09:00",
"url": "https://files.pythonhosted.org/packages/92/50/05b375d9819fb57c87ba12c1c54dd203c805a3b3336699348ad6d9618835/django-bitcoin-0.2.zip"
}
]
}