Pythonanywhere Configuration Help

35 views
Skip to first unread message

Adonis

unread,
Nov 26, 2018, 7:18:59 PM11/26/18
to web2py-users
Hi, 

At one point I had my web2py code on pythonanywhere and everything was fine. Eventually my domain expired and I deleted the web2py app. The code was saved and accessible in the web2py directory. When i created a new app, I had to change the directory to something else because pythonanywhere required a blank directory. My question is how do I combine these directories so i can access my old apps or how can i package the code and upload it into the new web app?

I tried changing the pythonanywhere directory but that caused errors

Thanks
Capture.PNG

黄祥

unread,
Nov 26, 2018, 8:01:19 PM11/26/18
to web2py-users
the error message show that the directory is not empty, perhaps you can backup the app, delete web2py and recreate web2py (start from scratch) then restore the app
e.g. backup application in pythonanywhere console
mkdir -p ~/appdata/webapp
rsync -zhavur ~/web2py/applications/* ~/appdata/webapp/

delete web2py from pythonanywhere, then recreate web2py

e.g. copy back from backup (step above)
rsync -zhavur ~/appdata/webapp/* ~/web2py/applications/

best regards,
stifan

Dave S

unread,
Nov 27, 2018, 2:13:18 PM11/27/18
to web2py-users


It should be possible to include the old app in the new installation just by copying the [oldweb2py]/applications/oldapp folder to [newweb2py]/applications/oldapp, and restarting the web2py server.  If there is a difference in the web2py release between old and new, you should still be okay, but it's a good idea to compare the files in oldapp/static with those in the welcome app, and take a look at the welcome app's models/db.py for modernization.  If you need the appadmin stuff, then update those files; if you've disabled appadmin, then there's no issue. (Mine's not disabled, but requires ssl port forwarding.)

Skip copying the errors and sessions subdirectories because of pickling changes.  files.

Good luck!

/dps



Adonis

unread,
Nov 27, 2018, 8:57:04 PM11/27/18
to web2py-users
Thanks for answering. This was the problem that I was trying to solve in broad terms

Adonis

unread,
Nov 27, 2018, 9:01:42 PM11/27/18
to web2py-users
Thanks for the commands. I did what you suggested and everything worked well. The only thing I changed was

rsync -zhavur ~/appdata/webapp/* ~/web2py/applications/

TO

cp -R t1/. t2/

because I wanted to copy only the files instead of adding the directory itself. 

Many Thanks!
Reply all
Reply to author
Forward
0 new messages