Sakura Use Python on the Internet

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.

dir.jpg

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

Sakura Use Python on the Internet
Use Python external module on Sakura Internet
The story of how the Python bottle worked on Sakura Internet
Use matplotlib on Ubuntu 12 & Python
Use Python on Windows (PyCharm)
Install Python3 on Sakura server (FreeBSD)
[Hyperledger Iroha] Notes on how to use the Python SDK
Memorize the Python commentary on YouTube.
Use the Flickr API from Python
Use python on Raspberry Pi 3 to illuminate the LED (Hello World)
Use The Metabolic Disassembler on Google Colaboratory
Use the Grove sensor on the Raspberry Pi
Memorandum on how to use gremlin python
Download files on the web with Python
Use without installing python 2.x on Windows
Use Django's ImageField on App Engine / Python
[Python] A progress bar on the terminal
Python on Windows
Use python on Raspberry Pi 3 to light the LED with switch control!
python on mac
Deploy and use the prediction model created in Python on SQL Server
Python on Windbg
How to use the C library in Python
Easy way to use Python 2.7 on Cent OS 6
Launch and use IPython notebook on the network
How to use Python Kivy ④ ~ Execution on Android ~
Specify the Python executable to use with virtualenv
Use logger with Python for the time being
Python: Try using the UI on Pythonista 3 on iPad
Use AppSync on the front and back ends
The easiest way to use OpenCV with python
Try CIing the pushed python code on GitHub.
Building multiple Python environments on the same system
[Algorithm x Python] How to use the list
Use the Python framework "cocotb" to test Verilog.
Introduction to Python with Atom (on the way)
Sound the buzzer using python on Raspberry Pi 3!
At the time of python update on ubuntu
Until you use PhantomJS with Python on Heroku
Building a Python environment on a Sakura VPS server
Use the LibreOffice app in Python (3) Add library
Use the nghttp2 Python module from Homebrew from pyenv's Python
I want to use Python in the environment of pyenv + pipenv on Windows 10
Use python on Raspberry Pi 3 and turn on the LED when it gets dark!
Python conda on cygwin
Find the maximum Python
Until the web application is released on Sakura VPS
Use config.ini in Python
Think about how to program Python on the iPad
[Python] Use JSON with Python
Install Python on Pidora.
I tried Python on Mac for the first time.
Use dates in Python
Install Scrapy on python3
Steps to install the latest Python on your Mac
Use Valgrind in Python
How to use the Raspberry Pi relay module Python
Use MySQL from Python
Use mecab with Python3
Install Python on Mac
Use LiquidTap Python Client ③