Jump to content

[Solved] Can I use bottle framework?


zetaxis

Recommended Posts

Followed the guide, django is ok, how about bottle?

 

I tried for it, uploaded bottle.py(from my python 2.7 lib) to the html directory, but failed.

 

the error log :

 

[Wed May 18 08:06:02 2011] [error] [client 223.166.97.228] File does not exist: /home/zetaxis/public_html/500.shtml, referer: http://zetaxis.co.cc/
[Wed May 18 08:06:02 2011] [error] [client 223.166.97.228]   File "/home/zetaxis/public_html/mysite/bottle.py", line 72, referer: http://zetaxis.co.cc/
[Wed May 18 08:06:02 2011] [error] [client 223.166.97.228]   File "/home/zetaxis/public_html/mysite/app.wsgi", line 5, in ?, referer: http://zetaxis.co.cc/
[Wed May 18 08:06:02 2011] [error] [client 223.166.97.228] mod_wsgi (pid=24693): Exception occurred processing WSGI script '/home/zetaxis/public_html/mysite/app.wsgi'., referer: http://zetaxis.co.cc/
[Wed May 18 08:06:02 2011] [error] [client 223.166.97.228] mod_wsgi (pid=24693): Target WSGI script '/home/zetaxis/public_html/mysite/app.wsgi' cannot be loaded as Python module., referer: http://zetaxis.co.cc/

 

what's the problem, who can help me?

Link to comment
Share on other sites

Guest Geoff

Have you tried looking on line 72 in bottle.py?

 

 

[Wed May 18 08:06:02 2011] [error] [client 223.166.97.228]   File "/home/zetaxis/public_html/mysite/bottle.py", line 72, referer: http://zetaxis.co.cc/

Link to comment
Share on other sites

Have you tried looking on line 72 in bottle.py?

 

 

[Wed May 18 08:06:02 2011] [error] [client 223.166.97.228]   File "/home/zetaxis/public_html/mysite/bottle.py", line 72, referer: http://zetaxis.co.cc/

 

I know the reason now. the bottle homepage write it:Bottle runs with Python 2.5+ and 3.x. the server run python2.4.3, ..XD.

 

 

 

 

 

 

Link to comment
Share on other sites

Guest Geoff
I know the reason now. the bottle homepage write it:Bottle runs with Python 2.5+ and 3.x. the server run python2.4.3, ..XD.

 

Actually, you are wrong. WSGI applications use python2.7, and you have the option of using python 3.2.

 

Just put:

 

#!/usr/bin/env python3.2

at the top of your script.

Link to comment
Share on other sites

I know the reason now. the bottle homepage write it:Bottle runs with Python 2.5+ and 3.x. the server run python2.4.3, ..XD.

 

Actually, you are wrong. WSGI applications use python2.7, and you have the option of using python 3.2.

 

Just put:

 

#!/usr/bin/env python3.2

at the top of your script.

 

i had added the script to the head

#!/usr/bin/env python3.2

import os, sys

sys.path.append("/home/zetaxis/public_html/mysite")

os.chdir(os.path.dirname(__file__))

import bottle

 

@bottle.route('/')

@bottle.route('/index.html')

def index():

return "<a href='/hello'>Go to Hello World page</a>"

 

application = bottle.default_app()

error,

i also try "#!/usr/bin/env python2.7"

both error, the error message is same.

i had tried the program in my local apache server, it's work. I don't know what's wrong with it.

Link to comment
Share on other sites

Are you on johnny or stevie? If you are on johnny, I will need to install python 2.7 for you.

 

Yes, I'm on johny.

My home directory is "/home/zetaxis" and domain is "zetaxis.co.cc"

Thank you very much.

Link to comment
Share on other sites

Guest Geoff

That explains these problems.

 

@djbob Please edit this post and check the following items off:

 

 

- Install python 2.7 on Johnny (DONE)

- Install python 3.2 on Johnny (DONE)

- Upgrade Django/mod_wsgi to use python 2.7 [i can do this part if you are having problems]

 

 

 

I would go ahead and install python, but I found that you had installed it in the /usr/local location; all the tutorials on the web recommend installing it in the /opt location. Also, if you could post what command you are using to install different versions of python, that would be great.

 

Thanks.

Link to comment
Share on other sites

And how do I know the escalation has been completed?

Most likely djbob will post in this thread once the installation has been completed or if there is any reason why it cannot be.

 

Will the process take a long time?

Just have to wait for djbob to come along. He's usually very quick. Everyone here is just a volunteer and no one gets paid for any of the work they do here. That said everyone is amazingly helpful and very responsive and quick. Just be patient.

Link to comment
Share on other sites

And how do I know the escalation has been completed?

Most likely djbob will post in this thread once the installation has been completed or if there is any reason why it cannot be.

 

Ok, I see.

 

Will the process take a long time?

Just have to wait for djbob to come along. He's usually very quick. Everyone here is just a volunteer and no one gets paid for any of the work they do here. That said everyone is amazingly helpful and very responsive and quick. Just be patient.

 

Sure, Thank for your help!

Link to comment
Share on other sites

Johnny already has Python 2.7. I installed 3.2. I'll leave the mod_wsgi configuration to you, as I have been unable to do that in the past. To install alternate versions of Python, follow these instructions:

 

wget http://www.python.org/ftp/python/2.x/Python-2.x.tgz
tar -xzf Python-2.x.tgz
./configure
make
make altinstall

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...