Just remember, about last year, I think I talked about how Python worked on Sakura's rental server with CGI, but bottle didn't work at all. In conclusion, it worked.
Upload the complete bottle project to the Sakura rental server. Change the controller part to .cgi and leave the permissions as 755. Bottle.py is placed as it is.
If you access it as it is
Status: 500 Internal Server Error Content-Type: text/plain Content-Length: 59 A server error occurred. Please contact the administrator.
It is said that. This is the cause of the most stumbling. If you follow the log,
-File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 86, in run -File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response -File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 217, in write
It is clearly moving like that. Where is the problem of the error ... I found it when I was looking for it.
ā€¯UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 358: ordinal not in range(128)ā€¯
What a Unicode error. Unicode error where it didn't appear in either the local environment or the Heroku environment.
When I tried to erase the Japanese in index.tpl, it turned out to work safely. What is this punch line ...
A common routing problem can be easily solved with .htaccess, but this unicode error is hard to beat. I feel like there is another good solution for this, so I'll give it a try.
The Japanese read by {{default_tag}} is also an error. I'm frustrated.
Recommended Posts