Question

I am trying to develop a website with django, and I had everything running fairly well under my development environment but now that I am trying to deploy it to an apache based server I am running into a lot of problems. For instance, when I try to run an http post request via requests I receive an error: response = callback(request, *callback_args, **callback_kwargs)

resp = requests.post(api_connection, data=params)
user_dict = dict(line.split(u"=", 1) for line in resp.text.split(u'\r\n'))

And with subprocesses, I am having issues as well.

import subprocess as sp
cmd = ['/home/servvs/./litecoind', 'getnewaddress', 'test']
p = sp.Popen(cmd, stdout=sp.PIPE, close_fds=True)
ltc_address = p.communicate()[0]
print ltc_address

The above code works as a test but when ran from my view it seems to do nothing. I am not sure how to fix either of these things, checkoutput returns an error code 6 from CalledProcessError

[edit]

For the top part, i am receiving an error:

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/pmavens/wsoltc/poker/views.py" in myaccount
user_dict = dict(line.split(u"=", 1) for line in resp.text.split(u'\r\n'))

what is strange is I can confirm that the post is working properly but for some reason I am not receiving a correct response. (though I do on the development django server)

The latter gives an error with check_output

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/pmavens/wsoltc/poker/views.py" in register
 246.         ltc_address = sp.check_output(cmd, shell=False)
File "/usr/lib/python2.7/subprocess.py" in check_output
 544.         raise CalledProcessError(retcode, cmd, output=output)

Exception Type: CalledProcessError at /register/
Exception Value: Command '['/home/pmavens/./litecoind', 'getaccountaddress', u'Ghost']' returned non-zero exit status -6

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top