How to use PythonAnywhere to host an already developed Web2py app?

1,265 views
Skip to first unread message

Bklynate

unread,
Jan 30, 2014, 3:11:01 PM1/30/14
to web...@googlegroups.com
Okay,

I couldn't really think of a title that accurately described the problem I am having. I am currently working through a web2py beginner tutorial that has me - well doing a lot of coding and tinkering. I would like to host the web-app that I have been developing locally on my computer using PythonAnywhere.com, but can't for the life of me figure out how to properly get this app from my computer onto PythonAnywhere.com ...

I really wanted to show my cousin whose currently learning HTML - what could be possible using a web framework instead.

[STEP-BY-STEP]Help on this matter would be greatly appreciated

Thx,
Nate

Dragan Matic

unread,
Jan 31, 2014, 4:14:44 AM1/31/14
to web...@googlegroups.com
  1. Create an account on pythonanywhere and log in (I presume you want a "Beginner" account for 0$/month)
  2. Click on "Dashboard"
  3. Click on "Web"
  4. Click on "Add a new web app"
  5. Click "Next", click on "web2py"
  6. Enter your admin password, click on "Next"
  7. You can now see web2py installation on "http://YOUR_USERNAME.pythonanywhere.com/welcome/default/index"

Now you need to upload your web app from your computer to pythonanywhere.com

  1. Go to your web2py dev machine (presumably on http://127.0.0.1:8000/admin/default/site) and press "Manage" and then "Pack all" on your application. Save it somewhere on disk
  2. In order to upload your app go to https://YOUR_USERNAME.pythonanywhere.com/admin (note the https://), login with your admin password
  3. On "Upload and install packed application", "Application name" type "init"
  4. On "Upload package" select the file that you have saved in step 1
  5. You should now have your application on http://YOUR_USERNAME.pythonanywhere.com/

Bklynate

unread,
Jan 31, 2014, 8:07:00 AM1/31/14
to web...@googlegroups.com
This worked, Thank you very much.

One more question though, How do I get my "YOUR_USERNAME.pythonanywhere.com/" to automatically direct to my webapp instead of point to the generic "Welcome" HelloWorld app?

Otherwise I have to constantly add the app in for "YOUR_USERNAME.pythonanywhere.com/app2"

Bklynate

unread,
Jan 31, 2014, 8:41:06 AM1/31/14
to web...@googlegroups.com
I realized I could always make the "Welcome" app redirect to my other app, but I would like it if my YOUR_USERNAME.pythonanywhere.com/" went directly to my new app.

Dave S

unread,
Jan 31, 2014, 8:44:30 PM1/31/14
to web...@googlegroups.com


On Friday, January 31, 2014 5:41:06 AM UTC-8, Bklynate wrote:
I realized I could always make the "Welcome" app redirect to my other app, but I would like it if my YOUR_USERNAME.pythonanywhere.com/" went directly to my new app.


Is this a question that leads to routes.py?  I haven't played with it, just read the book description (once) and a lot of the tips here in the forum, but I think it fits here.

/dps

 

Dragan Matic

unread,
Feb 2, 2014, 6:02:12 AM2/2/14
to web...@googlegroups.com
If you name your application 'init' (like I wrote in step 3) it should be automatically started when you point to YOUR_USERNAME.pythonanywhere.com
Reply all
Reply to author
Forward
0 new messages