Bitcoin Forum

Bitcoin => Project Development => Topic started by: kangasbros on December 25, 2011, 05:44:35 PM



Title: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on December 25, 2011, 05:44:35 PM
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


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: molecular on December 26, 2011, 10:58:56 AM
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!


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: finway on December 27, 2011, 02:36:19 AM
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


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on December 27, 2011, 04:20:01 PM
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.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: finway on December 28, 2011, 01:01:05 AM
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.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: finway on February 23, 2012, 06:01:09 PM
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     <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
14     {% endfor %}
15 </ul>
16 {% endif %}
17
18 <b>{% wallet_tagline instawallet.wallet %}</b><br/>
19
20 {% trans "Send bitcoins to following address to receive coins" %}:
21
22 {% bitcoin_payment_qr instawallet.wallet.receiving_address %}
23
24 <h2>{% trans "Send payments" %}</h2>
25
26 <form id="newform" action="{{ instawallet.url }}" method="POST">{% csrf_token %}
27 {{ form.as_p }}
28 <input type="submit" value="Send!"/>
29 </form>
30
31 <h2>{% trans "Transaction log" %}</h2>
32


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on February 23, 2012, 06:26:31 PM
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     <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
14     {% endfor %}
15 </ul>
16 {% endif %}
17
18 <b>{% wallet_tagline instawallet.wallet %}</b><br/>
19
20 {% trans "Send bitcoins to following address to receive coins" %}:
21
22 {% bitcoin_payment_qr instawallet.wallet.receiving_address %}
23
24 <h2>{% trans "Send payments" %}</h2>
25
26 <form id="newform" action="{{ instawallet.url }}" method="POST">{% csrf_token %}
27 {{ form.as_p }}
28 <input type="submit" value="Send!"/>
29 </form>
30
31 <h2>{% trans "Transaction log" %}</h2>
32


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: finway on February 24, 2012, 12:53:03 AM
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.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on February 24, 2012, 05:59:10 AM
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.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: finway on February 24, 2012, 06:12:57 AM
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.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on February 24, 2012, 07:36:35 AM
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


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: finway on February 24, 2012, 12:32:34 PM
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

Yes, the BITCOIND_CONNECTION_STRING is correct,
and the bitcoind.conf is correct too, except testnet =1
I've tested it remotely with SafeBit, it's working fine.

This is the traceback.

Code:
Environment:


Request Method: GET
Request URL: http://finway.org:8888/wallet/VSoAMlWrQUPLENYNHRZDsJXHcEp5jwawnh6qIaLY8EM

Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_bitcoin',
 'wallets']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Template error:
In template /home/finway/instawallet/templates/instawallet.html, error at line 22
   Caught ValueError while rendering: No JSON object could be decoded
   12 :     {% for message in messages %}


   13 :     <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>


   14 :     {% endfor %}


   15 : </ul>


   16 : {% endif %}


   17 :


   18 : <b>{% wallet_tagline instawallet.wallet %}</b><br/>


   19 :


   20 : {% trans "Send bitcoins to following address to receive coins" %}:


   21 :


   22 :  {% bitcoin_payment_qr instawallet.wallet.receiving_address %}


   23 :


   24 : <h2>{% trans "Send payments" %}</h2>


   25 :


   26 : <form id="newform" action="{{ instawallet.url }}" method="POST">{% csrf_token %}


   27 : {{ form.as_p }}


   28 : <input type="submit" value="Send!"/>


   29 : </form>


   30 :


   31 : <h2>{% trans "Transaction log" %}</h2>


   32 :


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/finway/instawallet/wallets/views.py" in wallet
  59.         }, context_instance=RequestContext(request))
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py" in render_to_response
  20.     return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
  188.         return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  123.             return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
  117.         return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  915.                     resolved_vars = [var.resolve(context) for var in self.vars_to_resolve]
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in resolve
  653.             value = self._resolve_lookup(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _resolve_lookup
  698.                             current = current()
File "/home/finway/instawallet/django_bitcoin/models.py" in receiving_address
  302.         addr=new_bitcoin_address()
File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py" in inner
  217.                 res = func(*args, **kwargs)
File "/home/finway/instawallet/django_bitcoin/models.py" in new_bitcoin_address
  90.         refill_payment_queue()
File "/home/finway/instawallet/django_bitcoin/models.py" in refill_payment_queue
  409.             bp.address=bitcoind.create_address()
File "/home/finway/instawallet/django_bitcoin/utils.py" in create_address
  47.             for_account or self.account_name, *args, **kwargs)
File "/home/finway/instawallet/django_bitcoin/jsonrpc/authproxy.py" in __call__
  95.         resp = json.loads(httpresp.read(), parse_float=decimal.Decimal)
File "/usr/lib/python2.7/json/__init__.py" in loads
  339.     return cls(encoding=encoding, **kw).decode(s)
File "/usr/lib/python2.7/json/decoder.py" in decode
  366.         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py" in raw_decode
  384.             raise ValueError("No JSON object could be decoded")

Exception Type: TemplateSyntaxError at /wallet/VSoAMlWrQUPLENYNHRZDsJXHcEp5jwawnh6qIaLY8EM
Exception Value: Caught ValueError while rendering: No JSON object could be decoded


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on February 24, 2012, 01:34:40 PM
As you can see from the stack trace, python fails retrieving proper JSON from the server. I would advise trying to contact the server via command line python shell.

Unfortunately that is the best advice I can give, the library is working fine for me. Other people have also been using it successfully.

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

Yes, the BITCOIND_CONNECTION_STRING is correct,
and the bitcoind.conf is correct too, except testnet =1
I've tested it remotely with SafeBit, it's working fine.

This is the traceback.

Code:
Environment:


Request Method: GET
Request URL: http://finway.org:8888/wallet/VSoAMlWrQUPLENYNHRZDsJXHcEp5jwawnh6qIaLY8EM

Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_bitcoin',
 'wallets']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Template error:
In template /home/finway/instawallet/templates/instawallet.html, error at line 22
   Caught ValueError while rendering: No JSON object could be decoded
   12 :     {% for message in messages %}


   13 :     <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>


   14 :     {% endfor %}


   15 : </ul>


   16 : {% endif %}


   17 :


   18 : <b>{% wallet_tagline instawallet.wallet %}</b><br/>


   19 :


   20 : {% trans "Send bitcoins to following address to receive coins" %}:


   21 :


   22 :  {% bitcoin_payment_qr instawallet.wallet.receiving_address %}


   23 :


   24 : <h2>{% trans "Send payments" %}</h2>


   25 :


   26 : <form id="newform" action="{{ instawallet.url }}" method="POST">{% csrf_token %}


   27 : {{ form.as_p }}


   28 : <input type="submit" value="Send!"/>


   29 : </form>


   30 :


   31 : <h2>{% trans "Transaction log" %}</h2>


   32 :


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/finway/instawallet/wallets/views.py" in wallet
  59.         }, context_instance=RequestContext(request))
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py" in render_to_response
  20.     return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in render_to_string
  188.         return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  123.             return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
  117.         return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  744.                 bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.7/dist-packages/django/template/debug.py" in render_node
  73.             result = node.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
  915.                     resolved_vars = [var.resolve(context) for var in self.vars_to_resolve]
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in resolve
  653.             value = self._resolve_lookup(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _resolve_lookup
  698.                             current = current()
File "/home/finway/instawallet/django_bitcoin/models.py" in receiving_address
  302.         addr=new_bitcoin_address()
File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py" in inner
  217.                 res = func(*args, **kwargs)
File "/home/finway/instawallet/django_bitcoin/models.py" in new_bitcoin_address
  90.         refill_payment_queue()
File "/home/finway/instawallet/django_bitcoin/models.py" in refill_payment_queue
  409.             bp.address=bitcoind.create_address()
File "/home/finway/instawallet/django_bitcoin/utils.py" in create_address
  47.             for_account or self.account_name, *args, **kwargs)
File "/home/finway/instawallet/django_bitcoin/jsonrpc/authproxy.py" in __call__
  95.         resp = json.loads(httpresp.read(), parse_float=decimal.Decimal)
File "/usr/lib/python2.7/json/__init__.py" in loads
  339.     return cls(encoding=encoding, **kw).decode(s)
File "/usr/lib/python2.7/json/decoder.py" in decode
  366.         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py" in raw_decode
  384.             raise ValueError("No JSON object could be decoded")

Exception Type: TemplateSyntaxError at /wallet/VSoAMlWrQUPLENYNHRZDsJXHcEp5jwawnh6qIaLY8EM
Exception Value: Caught ValueError while rendering: No JSON object could be decoded


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: finway on February 24, 2012, 02:30:20 PM
It turns out that the rpcpassword  are too long...

Thanks for your help, man.

You are doing great contribution to this community.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: wachtwoord on March 30, 2012, 06:04:26 PM
I am having this issue: https://github.com/kangasbros/django-bitcoin-instawallet/issues/1

'currency_conversions' is not a valid tag library

Note I know nothing about Django other than it seems to be one of those convention over specification languages that make me fringe :P

I'm trying it out for the sole purpose of using this library.

I'll paste some extra info for you to help me.

Code:
TemplateSyntaxError at /wallet/xYkmN3ILm2xVHfaBfKoWPkXdFnLVT4FChdaNfDo8kZo

'currency_conversions' is not a valid tag library: Template library currency_conversions not found, tried django.templatetags.currency_conversions,django.contrib.staticfiles.templatetags.currency_conversions

Request Method: GET
Request URL: http://127.0.0.1:8000/wallet/xYkmN3ILm2xVHfaBfKoWPkXdFnLVT4FChdaNfDo8kZo
Django Version: 1.4
Exception Type: TemplateSyntaxError
Exception Value:

'currency_conversions' is not a valid tag library: Template library currency_conversions not found, tried django.templatetags.currency_conversions,django.contrib.staticfiles.templatetags.currency_conversions

Exception Location: /usr/lib/python2.7/dist-packages/django/template/defaulttags.py in load, line 1043
Python Executable: /usr/bin/python
Python Version: 2.7.2
Python Path:

['/home/ubuntu/django_projects/instawallet',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

Server time: Fri, 30 Mar 2012 12:55:00 -0500

Code:
Error during template rendering

In template /home/ubuntu/django_projects/instawallet/templates/instawallet.html, error at line 2
'currency_conversions' is not a valid tag library: Template library currency_conversions not found, tried django.templatetags.currency_conversions,django.contrib.staticfiles.templatetags.currency_conversions
1 {% load i18n %}
[b]2 {% load currency_conversions %}[/b]
3 <html>
4 <head>
5 <title>{% trans "Bitcoin Instawallet" %}: {{ instawallet.uuid }}</title>
6 </head>
7 <body>
8 <h1>{% trans "Your instawallet" %}: {{ instawallet.uuid }}</h1>
9
10 {% if messages %}
11 <ul class="messages">
12 {% for message in messages %}

Code:
 wsgi.version 	

(1, 0)

wsgi.multiprocess

False

RUN_MAIN

'true'

GNOME_DESKTOP_SESSION_ID

'this-is-deprecated'

SERVER_PROTOCOL

'HTTP/1.1'

SERVER_SOFTWARE

'WSGIServer/0.1 Python/2.7.2+'

SCRIPT_NAME

u''

LESSOPEN

'| /usr/bin/lesspipe %s'

REQUEST_METHOD

'GET'

USER

'ubuntu'

PATH

'/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games'

QUERY_STRING

''

GNOME_KEYRING_CONTROL

'/tmp/keyring-7YctUb'

DISPLAY

':0'

SSH_AGENT_PID

'1565'

LANG

'en_US.UTF-8'

HTTP_ACCEPT_CHARSET

'ISO-8859-1,utf-8;q=0.7,*;q=0.7'

TERM

'xterm'

SHELL

'/bin/bash'

XDG_SESSION_PATH

'/org/freedesktop/DisplayManager/Session0'

XAUTHORITY

'/home/ubuntu/.Xauthority'

SERVER_NAME

'localhost'

SESSION_MANAGER

'local/ubuntu-VirtualBox:@/tmp/.ICE-unix/1503,unix/ubuntu-VirtualBox:/tmp/.ICE-unix/1503'

SHLVL

'1'

MANDATORY_PATH

'/usr/share/gconf/ubuntu-2d.mandatory.path'

wsgi.url_scheme

'http'

REMOTE_ADDR

'127.0.0.1'

WINDOWID

'65011717'

SERVER_PORT

'8000'

GPG_AGENT_INFO

'/tmp/keyring-7YctUb/gpg:0:1'

HOME

'/home/ubuntu'

USERNAME

'ubuntu'

CONTENT_LENGTH

''

HTTP_CONNECTION

'keep-alive'

HTTP_PRAGMA

'no-cache'

CONTENT_TYPE

'text/plain'

SSH_AUTH_SOCK

'/tmp/keyring-7YctUb/ssh'

wsgi.multithread

True

GDMSESSION

'ubuntu-2d'

HTTP_CACHE_CONTROL

'no-cache'

HTTP_USER_AGENT

'Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'

HTTP_HOST

'127.0.0.1:8000'

GNOME_KEYRING_PID

'1494'

XDG_SEAT_PATH

'/org/freedesktop/DisplayManager/Seat0'

LESSCLOSE

'/usr/bin/lesspipe %s %s'

XDG_CURRENT_DESKTOP

'Unity'

DBUS_SESSION_BUS_ADDRESS

'unix:abstract=/tmp/dbus-mdqfvqExnC,guid=384384747a5a9860d09d3d4e000000fa'

_

'/usr/bin/python'

XDG_SESSION_COOKIE

'cb54f6a4f68957845b964efe00000005-1333128275.9951-864149598'

HTTP_ACCEPT

'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'

DESKTOP_SESSION

'ubuntu-2d'

wsgi.file_wrapper

''

XDG_CONFIG_DIRS

'/etc/xdg/xdg-ubuntu-2d:/etc/xdg'

DEFAULTS_PATH

'/usr/share/gconf/ubuntu-2d.default.path'

UBUNTU_MENUPROXY

'libappmenu.so'

wsgi.run_once

False

CSRF_COOKIE

'YDqzd3rcTjK5JjYpmLyMMUczLaL7l2xf'

OLDPWD

'/home/ubuntu/django_projects/instawallet/django-bitcoin'

GATEWAY_INTERFACE

'CGI/1.1'

HTTP_ACCEPT_LANGUAGE

'en-us,en;q=0.5'

wsgi.input

<socket._fileobject object at 0x91111ec>

wsgi.errors

<open file '<stderr>', mode 'w' at 0xb772f0d0>

GTK_MODULES

'canberra-gtk-module:canberra-gtk-module'

XDG_DATA_DIRS

'/usr/share/ubuntu-2d:/usr/share/gnome:/usr/local/share/:/usr/share/'

PWD

'/home/ubuntu/django_projects/instawallet'

DJANGO_SETTINGS_MODULE

'instawallet.settings'

TZ

'America/Chicago'

COLORTERM

'gnome-terminal'

LS_COLORS

'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'

REMOTE_HOST

''

HTTP_ACCEPT_ENCODING

'gzip, deflate'

PATH_INFO

u'/wallet/xYkmN3ILm2xVHfaBfKoWPkXdFnLVT4FChdaNfDo8kZo'

Code:
USE_L10N 	

True

BITCOIND_CONNECTION_STRING

'http://admin:1234@localhost:8332'

USE_THOUSAND_SEPARATOR

False

CSRF_COOKIE_SECURE

False

LANGUAGE_CODE

'en-us'

ROOT_URLCONF

'instawallet.urls'

MANAGERS

(('Jeremias Kangas', 'jeremias.kangas@gmail.com'),)

DEFAULT_CHARSET

'utf-8'

STATIC_ROOT

''

MESSAGE_STORAGE

'django.contrib.messages.storage.fallback.FallbackStorage'

EMAIL_SUBJECT_PREFIX

'[Django] '

FILE_UPLOAD_PERMISSIONS

None

URL_VALIDATOR_USER_AGENT

'Django/1.4 (https://www.djangoproject.com)'

STATICFILES_FINDERS

('django.contrib.staticfiles.finders.FileSystemFinder',
 'django.contrib.staticfiles.finders.AppDirectoriesFinder')

SESSION_COOKIE_DOMAIN

None

SESSION_COOKIE_NAME

'sessionid'

ADMIN_FOR

()

TIME_INPUT_FORMATS

('%H:%M:%S', '%H:%M')

DATABASES

{'default': {'ENGINE': 'django.db.backends.sqlite3',
             'HOST': '',
             'NAME': 'dev.db',
             'OPTIONS': {},
             'PASSWORD': u'********************',
             'PORT': '',
             'TEST_CHARSET': None,
             'TEST_COLLATION': None,
             'TEST_MIRROR': None,
             'TEST_NAME': None,
             'TIME_ZONE': 'America/Chicago',
             'USER': ''}}

SERVER_EMAIL

'root@localhost'

FILE_UPLOAD_HANDLERS

('django.core.files.uploadhandler.MemoryFileUploadHandler',
 'django.core.files.uploadhandler.TemporaryFileUploadHandler')

DEFAULT_CONTENT_TYPE

'text/html'

APPEND_SLASH

True

FIRST_DAY_OF_WEEK

0

DATABASE_ROUTERS

[]

YEAR_MONTH_FORMAT

'F Y'

STATICFILES_STORAGE

'django.contrib.staticfiles.storage.StaticFilesStorage'

CACHES

{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
             'LOCATION': ''}}

SESSION_COOKIE_PATH

'/'

USE_X_FORWARDED_HOST

False

MIDDLEWARE_CLASSES

('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')

USE_I18N

True

THOUSAND_SEPARATOR

','

SECRET_KEY

u'********************'

LANGUAGE_COOKIE_NAME

'django_language'

DEFAULT_INDEX_TABLESPACE

''

TRANSACTIONS_MANAGED

False

LOGGING_CONFIG

'django.utils.log.dictConfig'

SEND_BROKEN_LINK_EMAILS

False

TEMPLATE_LOADERS

('django.template.loaders.filesystem.Loader',
 'django.template.loaders.app_directories.Loader')

WSGI_APPLICATION

None

TEMPLATE_DEBUG

True

X_FRAME_OPTIONS

'SAMEORIGIN'

AUTHENTICATION_BACKENDS

('django.contrib.auth.backends.ModelBackend',)

FORCE_SCRIPT_NAME

None

CACHE_BACKEND

'locmem://'

SIGNING_BACKEND

'django.core.signing.TimestampSigner'

SESSION_COOKIE_SECURE

False

CSRF_COOKIE_DOMAIN

None

FILE_CHARSET

'utf-8'

DEBUG

True

SESSION_FILE_PATH

None

DEFAULT_FILE_STORAGE

'django.core.files.storage.FileSystemStorage'

INSTALLED_APPS

('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_bitcoin',
 'wallets')

LANGUAGES

(('ar', 'Arabic'),
 ('az', 'Azerbaijani'),
 ('bg', 'Bulgarian'),
 ('bn', 'Bengali'),
 ('bs', 'Bosnian'),
 ('ca', 'Catalan'),
 ('cs', 'Czech'),
 ('cy', 'Welsh'),
 ('da', 'Danish'),
 ('de', 'German'),
 ('el', 'Greek'),
 ('en', 'English'),
 ('en-gb', 'British English'),
 ('eo', 'Esperanto'),
 ('es', 'Spanish'),
 ('es-ar', 'Argentinian Spanish'),
 ('es-mx', 'Mexican Spanish'),
 ('es-ni', 'Nicaraguan Spanish'),
 ('et', 'Estonian'),
 ('eu', 'Basque'),
 ('fa', 'Persian'),
 ('fi', 'Finnish'),
 ('fr', 'French'),
 ('fy-nl', 'Frisian'),
 ('ga', 'Irish'),
 ('gl', 'Galician'),
 ('he', 'Hebrew'),
 ('hi', 'Hindi'),
 ('hr', 'Croatian'),
 ('hu', 'Hungarian'),
 ('id', 'Indonesian'),
 ('is', 'Icelandic'),
 ('it', 'Italian'),
 ('ja', 'Japanese'),
 ('ka', 'Georgian'),
 ('kk', 'Kazakh'),
 ('km', 'Khmer'),
 ('kn', 'Kannada'),
 ('ko', 'Korean'),
 ('lt', 'Lithuanian'),
 ('lv', 'Latvian'),
 ('mk', 'Macedonian'),
 ('ml', 'Malayalam'),
 ('mn', 'Mongolian'),
 ('nb', 'Norwegian Bokmal'),
 ('ne', 'Nepali'),
 ('nl', 'Dutch'),
 ('nn', 'Norwegian Nynorsk'),
 ('pa', 'Punjabi'),
 ('pl', 'Polish'),
 ('pt', 'Portuguese'),
 ('pt-br', 'Brazilian Portuguese'),
 ('ro', 'Romanian'),
 ('ru', 'Russian'),
 ('sk', 'Slovak'),
 ('sl', 'Slovenian'),
 ('sq', 'Albanian'),
 ('sr', 'Serbian'),
 ('sr-latn', 'Serbian Latin'),
 ('sv', 'Swedish'),
 ('sw', 'Swahili'),
 ('ta', 'Tamil'),
 ('te', 'Telugu'),
 ('th', 'Thai'),
 ('tr', 'Turkish'),
 ('tt', 'Tatar'),
 ('uk', 'Ukrainian'),
 ('ur', 'Urdu'),
 ('vi', 'Vietnamese'),
 ('zh-cn', 'Simplified Chinese'),
 ('zh-tw', 'Traditional Chinese'))

COMMENTS_ALLOW_PROFANITIES

False

STATICFILES_DIRS

()

PREPEND_WWW

False

SECURE_PROXY_SSL_HEADER

None

SESSION_COOKIE_HTTPONLY

True

DEBUG_PROPAGATE_EXCEPTIONS

False

MONTH_DAY_FORMAT

'F j'

LOGIN_URL

'/accounts/login/'

SESSION_EXPIRE_AT_BROWSER_CLOSE

False

TIME_FORMAT

'P'

BITCOIN_MINIMUM_CONFIRMATIONS

0

DATE_INPUT_FORMATS

('%Y-%m-%d',
 '%m/%d/%Y',
 '%m/%d/%y',
 '%b %d %Y',
 '%b %d, %Y',
 '%d %b %Y',
 '%d %b, %Y',
 '%B %d %Y',
 '%B %d, %Y',
 '%d %B %Y',
 '%d %B, %Y')

CSRF_COOKIE_NAME

'csrftoken'

EMAIL_HOST_PASSWORD

u'********************'

PASSWORD_RESET_TIMEOUT_DAYS

u'********************'

CACHE_MIDDLEWARE_ALIAS

'default'

SESSION_SAVE_EVERY_REQUEST

False

ADMIN_MEDIA_PREFIX

'/static/admin/'

NUMBER_GROUPING

0

SESSION_ENGINE

'django.contrib.sessions.backends.db'

CSRF_FAILURE_VIEW

'django.views.csrf.csrf_failure'

CSRF_COOKIE_PATH

'/'

LOGIN_REDIRECT_URL

'/accounts/profile/'

PROJECT_ROOT

'/home/ubuntu/django_projects/instawallet'

LOGGING

{'disable_existing_loggers': False,
 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}},
 'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler',
                              'filters': ['require_debug_false'],
                              'level': 'ERROR'}},
 'loggers': {'django.request': {'handlers': ['mail_admins'],
                                'level': 'ERROR',
                                'propagate': True}},
 'version': 1}

IGNORABLE_404_URLS

()

LOCALE_PATHS

()

TEMPLATE_STRING_IF_INVALID

''

LOGOUT_URL

'/accounts/logout/'

EMAIL_USE_TLS

False

FIXTURE_DIRS

()

EMAIL_HOST

'localhost'

DATE_FORMAT

'N j, Y'

MEDIA_ROOT

''

DEFAULT_EXCEPTION_REPORTER_FILTER

'django.views.debug.SafeExceptionReporterFilter'

ADMINS

(('Jeremias Kangas', 'jeremias.kangas@gmail.com'),)

FORMAT_MODULE_PATH

None

DEFAULT_FROM_EMAIL

'webmaster@localhost'

MEDIA_URL

''

DATETIME_FORMAT

'N j, Y, P'

TEMPLATE_DIRS

('/home/ubuntu/django_projects/instawallet/templates',)

SITE_ID

1

DISALLOWED_USER_AGENTS

()

ALLOWED_INCLUDE_ROOTS

()

DECIMAL_SEPARATOR

'.'

SHORT_DATE_FORMAT

'm/d/Y'

TEST_RUNNER

'django.test.simple.DjangoTestSuiteRunner'

CACHE_MIDDLEWARE_KEY_PREFIX

u'********************'

TIME_ZONE

'America/Chicago'

FILE_UPLOAD_MAX_MEMORY_SIZE

2621440

EMAIL_BACKEND

'django.core.mail.backends.smtp.EmailBackend'

DEFAULT_TABLESPACE

''

TEMPLATE_CONTEXT_PROCESSORS

('django.contrib.auth.context_processors.auth',
 'django.core.context_processors.debug',
 'django.core.context_processors.i18n',
 'django.core.context_processors.media',
 'django.core.context_processors.static',
 'django.core.context_processors.tz',
 'django.contrib.messages.context_processors.messages')

SESSION_COOKIE_AGE

1209600

SETTINGS_MODULE

'instawallet.settings'

USE_ETAGS

False

LANGUAGES_BIDI

('he', 'ar', 'fa')

FILE_UPLOAD_TEMP_DIR

None

INTERNAL_IPS

()

STATIC_URL

'/static/'

EMAIL_PORT

25

USE_TZ

False

SHORT_DATETIME_FORMAT

'm/d/Y P'

PASSWORD_HASHERS

u'********************'

ABSOLUTE_URL_OVERRIDES

{}

CACHE_MIDDLEWARE_SECONDS

600

DATETIME_INPUT_FORMATS

('%Y-%m-%d %H:%M:%S',
 '%Y-%m-%d %H:%M:%S.%f',
 '%Y-%m-%d %H:%M',
 '%Y-%m-%d',
 '%m/%d/%Y %H:%M:%S',
 '%m/%d/%Y %H:%M:%S.%f',
 '%m/%d/%Y %H:%M',
 '%m/%d/%Y',
 '%m/%d/%y %H:%M:%S',
 '%m/%d/%y %H:%M:%S.%f',
 '%m/%d/%y %H:%M',
 '%m/%d/%y')

EMAIL_HOST_USER

''

PROFANITIES_LIST

u'********************'


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on March 31, 2012, 02:33:43 PM
I am having this issue: https://github.com/kangasbros/django-bitcoin-instawallet/issues/1

'currency_conversions' is not a valid tag library

Note I know nothing about Django other than it seems to be one of those convention over specification languages that make me fringe :P

I'm trying it out for the sole purpose of using this library.

I'll paste some extra info for you to help me.

For some reason, django can't find the currency_conversions tag library, which should reside in django_bitcoin/templatetags/currency_conversions.py

Check that django_bitcoin is properly installed (if you fetch it from git, it should be linked in a way so that django_bitcoin can be found by python, eg.:

django-bitcoin/ <- git repo
django_bitcoin <- links to django-bitcoin/django_bitcoin

This isn't normal convention, but since I haven't yet released django_bitcoin 0.1, it can't be installed easier (or maybe can, I don't know much about python library packagin).

Note I know nothing about Django other than it seems to be one of those convention over specification languages that make me fringe :P

Well, in my programming career I have done something bigger at least with following technologies:

- Perl + CGI
- PHP/MySQL/PostgreSQL etc
- ASP.NET/C#
- Ruby on Rails
- Django

So far, I have found django the best in the longer term. Of course it has it quirks, and not everything is always so easy, but to get shit done fast, while still keeping some kind of maintainability it is the best I have found so far. However this is a very debatable and subjective issue, of course :)


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on March 31, 2012, 02:35:12 PM
One small addition: actually in the tutorial the library is installed via setup.y, so that isn't the problem.... Hmm, have to think about it.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: wachtwoord on March 31, 2012, 05:22:53 PM
Thanks for the reply. It is true I have installed Django-bitcoin by pulling it from git and I have subsequently run the setup (sudo python setup.py install) which led to the directory structure you describe.

So the structure is (under Django_projects in my home directory):

ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet$ ls
dev.db          __init__.pyc  settings.py   templates  wallets
django-bitcoin  manage.py     settings.py~  urls.py
__init__.py     README.html   settings.pyc  urls.pyc
ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet$ cd django-bitcoin/
ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet/django-bitcoin$ ls
build  django_bitcoin  README.markdown  setup.py
ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet/django-bitcoin$ cd ..
ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet$ cd wallets
ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet/wallets$ ls
forms.py   __init__.py   models.py   tests.py  views.pyc
forms.pyc  __init__.pyc  models.pyc  views.py
ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet/wallets$ cd ..
ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet$ cd templates/
ubuntu@ubuntu-VirtualBox:~/django_projects/instawallet/templates$ ls
instawallet.html  instawallet.html~

Note that I have both cloned Django-bitcoin and django-bitcoin-instawallet from git (django-bitcoin-instawallet is renamed to instawallet) because I wanted to be sure I wasn't doing anything wrong myself. Of course I did make the necessary changes as described in the tutorial.

And as a final note on your set of languages. Anything is better than Perl! :P I have seen some garbage code in that language like you wouldn't believe (all supported with: but it's short, no?).

And as I said I really don't have enough experience with Django (hardly any) to judge it one way or another. I just really like explicitly specifying things for readability/maintainability :)


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: EskimoBob on April 21, 2012, 06:41:02 PM
Code:
ImportError at /

No module named instawallet.urls

Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.4
Exception Type: ImportError
Exception Value:

No module named instawallet.urls

Exception Location: /usr/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/bin/python2.7
Python Version: 2.7.2
Python Path:

['/TESTSITE/django-bitcoin-instawallet',
 '/usr/lib/python27.zip',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7/site-packages',
 '/usr/lib/portage/pym']

Any idea why do I get "No module named instawallet.urls"


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: FreeMoney on April 21, 2012, 08:01:11 PM
I just had an idea. Make an instawallet with a "Double or Nothing" button. Just a huge irresistible button that either doubles your balance or takes it all. Take a 1% or whatever fee by giving only 49.5% odds. Have to publish the max amount you can handle covering, maybe make it dynamic. If someone actually wants to do this I could probably put up some cash.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: EskimoBob on April 22, 2012, 07:55:27 AM
I just had an idea. Make an instawallet with a "Double or Nothing" button. Just a huge irresistible button that either doubles your balance or takes it all. Take a 1% or whatever fee by giving only 49.5% odds. Have to publish the max amount you can handle covering, maybe make it dynamic. If someone actually wants to do this I could probably put up some cash.

You really need to see a specialist about your gambling addiction. :) 


Title: Feature request for django-python-instawallet
Post by: EskimoBob on April 22, 2012, 08:30:23 AM
In more serious note.
Feature request #1 : Additional module for tipping aka "Bitcoin me" URI
Generate a special URL, that can me used for only receiving a tip. I personally like the "Bitcoin me" URI idea:

Code:
<a href="bitcoin:'bitcoin address here'?amount='amount here'&label='label here' ">bitcoin me!</a>
 
(remove the " ' ")

This starts your bitcoin client and you can complete the payment.
Obviously, this can be redesigned/reversed so that your web based wallet is opened, authentication is requested and payment is made.
Something like "Tip me from 'service name' "

Code:
<a href="https://:wallet_serviceURL?amount='amount here'&label='Tip for the article' ">Bitcoin tip!</a>

Feature request #2:
To add another layer of security, wallet service user must select/upload a "security image" for his/her account.
This image is always displayed when he logs in to his account or starts to complete the tip payment. If someone has lured a user to a fake phishing site, image is missing or is not correct. User with a half a brain must notice this and stop. This actually requires a FR #3

Feature Request #3 Transactions or any changes to users account can not be completed without "PIN". PIN number is generated to user when account is first created.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: FreeMoney on April 23, 2012, 01:16:20 AM
I just had an idea. Make an instawallet with a "Double or Nothing" button. Just a huge irresistible button that either doubles your balance or takes it all. Take a 1% or whatever fee by giving only 49.5% odds. Have to publish the max amount you can handle covering, maybe make it dynamic. If someone actually wants to do this I could probably put up some cash.

You really need to see a specialist about your gambling addiction. :) 

Lol, I want to own it not to use it. Does that mean I'm in the clear or is that just worse?


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: molecular on April 23, 2012, 09:06:33 AM
I just had an idea. Make an instawallet with a "Double or Nothing" button. Just a huge irresistible button that either doubles your balance or takes it all. Take a 1% or whatever fee by giving only 49.5% odds. Have to publish the max amount you can handle covering, maybe make it dynamic. If someone actually wants to do this I could probably put up some cash.

You really need to see a specialist about your gambling addiction. :) 

Lol, I want to own it not to use it. Does that mean I'm in the clear or is that just worse?

haha. worse, you're in denial.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on April 23, 2012, 06:27:25 PM
I just had an idea. Make an instawallet with a "Double or Nothing" button. Just a huge irresistible button that either doubles your balance or takes it all. Take a 1% or whatever fee by giving only 49.5% odds. Have to publish the max amount you can handle covering, maybe make it dynamic. If someone actually wants to do this I could probably put up some cash.

Well, creating a gambling site with django_bitcoin is trivial. It could be of course an anonymous gambling site as well - just deposit your bitcoins to this address, and then you have gambling functionalities there.

eg. "double or nothing" pseudocode:

Code:
import random
from django_bitcoin import Wallet

def double_or_nothing(request, uuid):
    main_wallet=Wallet.objects.get(id=1) # the main wallet, where the site's bitcoins are kept
    user_wallet=Wallet.objects.get(uuid=uuid)
    if random.random()<0.49:
         main_wallet.send_to_wallet(user_wallet, user_wallet.total_balance())
    else:
         user_wallet.send_to_wallet(main_wallet, user_wallet.total_balance())

I just wrote the code directly here, so perhaps it doesn't work :D But anyway, the basic idea is very simple. Then of course, if you want to implement more complex gambling functionalities, it is easy.

I'm not implementing this, since I think it doesn't fit well with wallet... But the library itself could be used as well for gambling sites, or almost anything.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: dadj on June 29, 2012, 04:44:07 AM
Code:
ImportError at /

No module named instawallet.urls

Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.4
Exception Type: ImportError
Exception Value:

No module named instawallet.urls

Exception Location: /usr/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/bin/python2.7
Python Version: 2.7.2
Python Path:

['/TESTSITE/django-bitcoin-instawallet',
 '/usr/lib/python27.zip',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7/site-packages',
 '/usr/lib/portage/pym']

Any idea why do I get "No module named instawallet.urls"

In settings.py change ROOT_URLCONF from 'instawallet.urls' to just 'urls'


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: dadj on June 29, 2012, 06:47:55 AM
I'm stuck with getting the QR code to display.

At the moment the image location is showing as http://10.1.1.14:8000/qrcode/mnooEeJ3GjR8ztUby9Ch9vgrp9BE6at6HV

I guess it needs to lookup the QR code through Google somehow but I have no idea.

Any ideas?


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: dadj on June 29, 2012, 07:01:06 AM
I have a question about the directory structure of django-bitcoin-instawallet and django_bitcoin.

I have django_bitcoin installed in the project folder, instawallet and the app wallets inside instawallet.

leo@ubuntu:~/django/instawallet/instawallet$ ls
dev.db             __init__.pyc   settings.pyc   urls.pyc   wsgi.pyc
django_bitcoin  manage.py     templates      wallets
__init__.py      settings.py     urls.py          wsgi.py

My question is can {% load currency_conversions %} from ~/django/instawallet/instawallet/templates/instawallet.html reach ~/django/instawallet/instawallet/django_bitcoin/templatetags/currency_conversions.py given the ~/django/instawallet/instawallet/settings.py file has 'django_bitcoin', in the INSTALLED_APPS?


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on July 14, 2012, 10:44:40 AM
I have a question about the directory structure of django-bitcoin-instawallet and django_bitcoin.

I have django_bitcoin installed in the project folder, instawallet and the app wallets inside instawallet.

leo@ubuntu:~/django/instawallet/instawallet$ ls
dev.db             __init__.pyc   settings.pyc   urls.pyc   wsgi.pyc
django_bitcoin  manage.py     templates      wallets
__init__.py      settings.py     urls.py          wsgi.py

My question is can {% load currency_conversions %} from ~/django/instawallet/instawallet/templates/instawallet.html reach ~/django/instawallet/instawallet/django_bitcoin/templatetags/currency_conversions.py given the ~/django/instawallet/instawallet/settings.py file has 'django_bitcoin', in the INSTALLED_APPS?


Today at Bitcoin Hackathon (http://bitcoin-hackathon.com), I started a new project, and fixed some problems with django_bitcoin that only affect new users. These problems were mostly when you used easy_install or pip. I myself have always used cloned repository, so it didn't affect me.


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: dadj on July 14, 2012, 02:18:56 PM
I have a question about the directory structure of django-bitcoin-instawallet and django_bitcoin.

I have django_bitcoin installed in the project folder, instawallet and the app wallets inside instawallet.

leo@ubuntu:~/django/instawallet/instawallet$ ls
dev.db             __init__.pyc   settings.pyc   urls.pyc   wsgi.pyc
django_bitcoin  manage.py     templates      wallets
__init__.py      settings.py     urls.py          wsgi.py

My question is can {% load currency_conversions %} from ~/django/instawallet/instawallet/templates/instawallet.html reach ~/django/instawallet/instawallet/django_bitcoin/templatetags/currency_conversions.py given the ~/django/instawallet/instawallet/settings.py file has 'django_bitcoin', in the INSTALLED_APPS?


Today at Bitcoin Hackathon (http://bitcoin-hackathon.com), I started a new project, and fixed some problems with django_bitcoin that only affect new users. These problems were mostly when you used easy_install or pip. I myself have always used cloned repository, so it didn't affect me.

Thanks for your suggestion, I will try again from clean install.

About the qrcode-library, can you please point me in the right direction for this dependancy?


Title: Re: Tutorial: creating a bitcoin instawallet clone with python and django
Post by: kangasbros on July 14, 2012, 03:19:28 PM
I have a question about the directory structure of django-bitcoin-instawallet and django_bitcoin.

I have django_bitcoin installed in the project folder, instawallet and the app wallets inside instawallet.

leo@ubuntu:~/django/instawallet/instawallet$ ls
dev.db             __init__.pyc   settings.pyc   urls.pyc   wsgi.pyc
django_bitcoin  manage.py     templates      wallets
__init__.py      settings.py     urls.py          wsgi.py

My question is can {% load currency_conversions %} from ~/django/instawallet/instawallet/templates/instawallet.html reach ~/django/instawallet/instawallet/django_bitcoin/templatetags/currency_conversions.py given the ~/django/instawallet/instawallet/settings.py file has 'django_bitcoin', in the INSTALLED_APPS?


Today at Bitcoin Hackathon (http://bitcoin-hackathon.com), I started a new project, and fixed some problems with django_bitcoin that only affect new users. These problems were mostly when you used easy_install or pip. I myself have always used cloned repository, so it didn't affect me.

Thanks for your suggestion, I will try again from clean install.

About the qrcode-library, can you please point me in the right direction for this dependancy?

All the requirements are in requirements.txt, you can install them using

pip install -r requirements.txt

or

pip install qrcode