Sakura I tried to run a Python script on the Internet. I got an application error even though Heroku could be deployed, so it's an easy idea to study how to manage with a rental server.
If you can run it on a rental server when it works locally but not on Heroku, it's easy. At first, I tried to use bottle as it was, but it didn't work either.
So, I stumbled considerably, so it also serves as a memorandum.
The magic that you definitely want to put in
#!/usr/local/bin/python
print "Content-Type: text/html\n"
After all, the Python script works with CGI, so it is necessary to rewrite .cgi after uploading. So, at first I tried to get the bottle to work, but the routing didn't work. I was hungry, so I wrote everything from scratch. The index.py is full of prints.
Please tell me in detail if there is a way to make bottle work well with Sakura.
If it was a bottle, it would be dozens of lines. I really feel the convenience of the framework.
That's why development in the local environment uses the cgi module. When you upload it, you can upload it as it is without any hesitation.
Start production with a hierarchy like this. When uploading, upload everything except cgiserver.py.
There is no problem anywhere under home / user / www /.
After uploading index.py, rewrite it to index.cgi and set the permission to 705.
Click here for the deliverables. I wanted to implement more, but I was exhausted. http://app.jiriki.co.jp/rakuten-creater/index.html
I wrote a story about how bottle worked on Sakura's rental server.
http://qiita.com/Gen6/items/3238b3b5c7501e36f6d3
Recommended Posts