Pages:
Author

Topic: Tutorial: creating a bitcoin instawallet clone with python and django - page 2. (Read 8923 times)

hero member
Activity: 812
Merit: 1006
You have to configure your bitcoin.conf (bitcoind daemon) to allow your IP address.

rpcallowip=*

right? i've done that, still got the same error report.

That error means that you are not getting proper results from the bitcoind. Try checking the connection string in settings.

Also with django you can go to console and execute "python manage.py shell" or with django-extensions installed "python manage.py shell_plus"

That way you can test on command line what goes wrong. Just try creating a bitcoin wallet object, and getting the receiving address.

I'm using bitcoind 0.5.2 , and i tested it with SafeBit, it's working fine.
Maybe i should check 0.4, and try your suggestions. thanks.

Have you checked the credentials you supplied in your bitcoind connection string?

BITCOIND_CONNECTION_STRING = "http://login:password@domain:8332"

I think that changing the version doesn't necessarily help that much...

Example bitcoin.conf:

testnet=1
server=1
rpcuser=TESTUSER
rpcpassword=TESTPW
rpcallowip=*
gen=0
hero member
Activity: 714
Merit: 500
You have to configure your bitcoin.conf (bitcoind daemon) to allow your IP address.

rpcallowip=*

right? i've done that, still got the same error report.

That error means that you are not getting proper results from the bitcoind. Try checking the connection string in settings.

Also with django you can go to console and execute "python manage.py shell" or with django-extensions installed "python manage.py shell_plus"

That way you can test on command line what goes wrong. Just try creating a bitcoin wallet object, and getting the receiving address.

I'm using bitcoind 0.5.2 , and i tested it with SafeBit, it's working fine.
Maybe i should check 0.4, and try your suggestions. thanks.
hero member
Activity: 812
Merit: 1006
You have to configure your bitcoin.conf (bitcoind daemon) to allow your IP address.

rpcallowip=*

right? i've done that, still got the same error report.

That error means that you are not getting proper results from the bitcoind. Try checking the connection string in settings.

Also with django you can go to console and execute "python manage.py shell" or with django-extensions installed "python manage.py shell_plus"

That way you can test on command line what goes wrong. Just try creating a bitcoin wallet object, and getting the receiving address.
hero member
Activity: 714
Merit: 500
You have to configure your bitcoin.conf (bitcoind daemon) to allow your IP address.

rpcallowip=*

right? i've done that, still got the same error report.
hero member
Activity: 812
Merit: 1006
You have to configure your bitcoin.conf (bitcoind daemon) to allow your IP address.

This error bothers me too much, Can you help me figure it out ? thanks!
Code:
TemplateSyntaxError at /wallet/XK8LKzH0fd5aDBNlxYVF_ntihYMyYLIssy-9m_aYD9M
Caught ValueError while rendering: No JSON object could be decoded
Request Method: GET
Request URL: http://127.0.0.1:8000/wallet/XK8LKzH0fd5aDBNlxYVF_ntihYMyYLIssy-9m_aYD9M
Django Version: 1.3.1
Exception Type: TemplateSyntaxError
Exception Value:
Caught ValueError while rendering: No JSON object could be decoded
Exception Location: e:\python27\lib\json\decoder.py in raw_decode, line 384
Python Executable: e:\python27\python.exe
Python Version: 2.7.2
Python Path:
['C:\\Documents and Settings\\admin\\instawallet',
 'e:\\python27\\lib\\site-packages\\zope.interface-3.8.0-py2.7-win32.egg',
 'e:\\python27\\lib\\site-packages\\slowaes-0.1a1-py2.7.egg',
 'C:\\WINDOWS\\system32\\python27.zip',
 'e:\\python27\\DLLs',
 'e:\\python27\\lib',
 'e:\\python27\\lib\\plat-win',
 'e:\\python27\\lib\\lib-tk',
 'e:\\python27',
 'e:\\python27\\lib\\site-packages',
 'e:\\python27\\lib\\site-packages\\gtk-2.0',
 'e:\\python27\\lib\\site-packages']
Server time: Fri, 24 Feb 2012 01:59:15 +0800
Template error

In template c:\documents and settings\admin\instawallet\templates\instawallet.html, error at line 22
Caught ValueError while rendering: No JSON object could be decoded
12     {% for message in messages %}
13     {{ message }}
14     {% endfor %}
15
16 {% endif %}
17
18 {% wallet_tagline instawallet.wallet %}

19
20 {% trans "Send bitcoins to following address to receive coins" %}:
21
22 {% bitcoin_payment_qr instawallet.wallet.receiving_address %}
23
24

{% trans "Send payments" %}


25
26
{% csrf_token %}
27 {{ form.as_p }}
28
29

30
31

{% trans "Transaction log" %}


32
hero member
Activity: 714
Merit: 500
This error bothers me too much, Can you help me figure it out ? thanks!
Code:
TemplateSyntaxError at /wallet/XK8LKzH0fd5aDBNlxYVF_ntihYMyYLIssy-9m_aYD9M
Caught ValueError while rendering: No JSON object could be decoded
Request Method: GET
Request URL: http://127.0.0.1:8000/wallet/XK8LKzH0fd5aDBNlxYVF_ntihYMyYLIssy-9m_aYD9M
Django Version: 1.3.1
Exception Type: TemplateSyntaxError
Exception Value:
Caught ValueError while rendering: No JSON object could be decoded
Exception Location: e:\python27\lib\json\decoder.py in raw_decode, line 384
Python Executable: e:\python27\python.exe
Python Version: 2.7.2
Python Path:
['C:\\Documents and Settings\\admin\\instawallet',
 'e:\\python27\\lib\\site-packages\\zope.interface-3.8.0-py2.7-win32.egg',
 'e:\\python27\\lib\\site-packages\\slowaes-0.1a1-py2.7.egg',
 'C:\\WINDOWS\\system32\\python27.zip',
 'e:\\python27\\DLLs',
 'e:\\python27\\lib',
 'e:\\python27\\lib\\plat-win',
 'e:\\python27\\lib\\lib-tk',
 'e:\\python27',
 'e:\\python27\\lib\\site-packages',
 'e:\\python27\\lib\\site-packages\\gtk-2.0',
 'e:\\python27\\lib\\site-packages']
Server time: Fri, 24 Feb 2012 01:59:15 +0800
Template error

In template c:\documents and settings\admin\instawallet\templates\instawallet.html, error at line 22
Caught ValueError while rendering: No JSON object could be decoded
12     {% for message in messages %}
13     {{ message }}
14     {% endfor %}
15
16 {% endif %}
17
18 {% wallet_tagline instawallet.wallet %}

19
20 {% trans "Send bitcoins to following address to receive coins" %}:
21
22 {% bitcoin_payment_qr instawallet.wallet.receiving_address %}
23
24

{% trans "Send payments" %}


25
26
{% csrf_token %}
27 {{ form.as_p }}
28
29

30
31

{% trans "Transaction log" %}


32
hero member
Activity: 714
Merit: 500
You have to {% load currency_conversions %} in your template, and check that django_bitcoin is installed.

Otherwise, thanks for the feedback, I try to improve the tutorial later today.

I've installed django_bitcoin,
i'll try again.
hero member
Activity: 812
Merit: 1006
You have to {% load currency_conversions %} in your template, and check that django_bitcoin is installed.

Otherwise, thanks for the feedback, I try to improve the tutorial later today.
hero member
Activity: 714
Merit: 500
Interesting, django+python+bitcoin,
I'll try this out.

EDIT:
@kangasbros: What does this mean?
Code:
TemplateSyntaxError at /wallet/p_OBlA8Vb8UW_T1wUKtKyh8U6ZzmOYinv9rKcRE8JL8
Invalid block tag: 'wallet_tagline'
Request Method: GET
Request URL: http://127.0.0.1:8000/wallet/p_OBlA8Vb8UW_T1wUKtKyh8U6ZzmOYinv9rKcRE8JL8
Django Version: 1.3.1
Exception Type: TemplateSyntaxError
Exception Value:
Invalid block tag: 'wallet_tagline'
Exception Location: e:\python27\lib\site-packages\django\template\base.py in invalid_block_tag, line 291
Python Executable: e:\python27\python.exe
Python Version: 2.7.2
Python Path:
['C:\\Documents and Settings\\admin\\instawallet',
 'e:\\python27\\lib\\site-packages\\zope.interface-3.8.0-py2.7-win32.egg',
 'C:\\WINDOWS\\system32\\python27.zip',
 'e:\\python27\\DLLs',
 'e:\\python27\\lib',
 'e:\\python27\\lib\\plat-win',
 'e:\\python27\\lib\\lib-tk',
 'e:\\python27',
 'e:\\python27\\lib\\site-packages',
 'e:\\python27\\lib\\site-packages\\gtk-2.0',
 'e:\\python27\\lib\\site-packages']
Server time: Tue, 27 Dec 2011 22:17:26 +0800
donator
Activity: 2772
Merit: 1019
Hi,

thanks for making this, I might use it at some point.
I only skimmed the first 1/3 of it and have some suggestions:

1.) when showing stuff the user has to enter in some shell (there might be different shells involved at some point, like bash and python shell), replicate the prompt, something like this:

Code:
#> pip install django
#> django-admin.py startproject instawallet
#> cd instawallet


that way, the user (always assume he knows nothing) always knows that this is commands he is supposed to enter and in which shell they go. Another upside to this is that you can also replicate the shells answer in cases where this might be reassuring, like so:

Code:
#> bitcoind stop
bitcoind stopping

2.) When telling the reader to edit/create some file, you should always state the name of the file clearly. You could also emphasize the filename in the pretext.

Here is an example that leaves me uncertain about what the file should be named and where it goes:

Quote
We set up the sqlite database as a file “dev.db”. After that we add “django_bitcoin” and “wallets” to INSTALLED_APPS so that django can find our apps. Also we specify a templates directory. Create a folder “templates” inside the project root.

You're telling the reader to create a folder and then give him some text he should put in a file... which file? db.env? Where does it go? In the templates folder? This is not clear, always be clear on this. This problem is seen in many tutorials: the author makes some assumptions about the users just _knowing_ where some config directives or newly created files should go. It might be crystal-clear to the author (who is an expert), but keep in mind that all the stuff you write is probably new to the reader, so he is very uncertain about things and it helps to reassure him by stating the obvious.

Other than that your tutorial seems great!

I will give you more feedback once I actually go through with it.

Thanks!
hero member
Activity: 812
Merit: 1006
Hi, I wrote this little tutorial for those who are interested in developing bitcoin web apps with python/django

http://blog.kangasbros.fi/?p=85

This is my first time writing something like this, feedback welcome!

Edit: the github repo: https://github.com/kangasbros/django-bitcoin-instawallet
Pages:
Jump to: