Sakura I want to run external modules when I can run Python on the Internet. So I thought I'd write all the work I did. There may be some work that you don't need, but I don't know. It feels like I've done everything I can think of.
Add the following to .cshrc in your home directory
setenv PYTHONPATH ~/lib/python
Log in with SSH,
% mkdir -p ~/.local/lib/python2.7
For the module you want to install, create tmp directly under www and put it in it. Let's insuko Requests-OAuthlib as an example.
% cd www
% cd tmp
% cd requests-oauthlib-master
% python setup.py install --user
So, write a spell in the header of the Python script itself that runs on CGI.
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import sys, codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
from requests_oauthlib import OAuth1Session
import json
import cgi
print "Content-Type: text/html\n"
Now you can create a Twitter client on Sakura's rental server. Congratulations ...
But the bottle still doesn't work ...
Recommended Posts