Forums

New App from Git Repository

Hello

I want to see if I could run the FOSS app Sahana Eden on PythonAnywhere. I am able to clone the git repository from https://github.com/sahana/eden.git to my home dir/web2py/eden dir on pythonanywhere but I am not sure how to make the code run under the (one allowed app on the free account) app that has my user id, e.g. http://freeuser.pythonanywhere.com

Thanks in advance.

You could create a web2py app from the webapp tab, making sure that the directory that you specify is different to the one where you've cloned the repository.

Then edit the WSGI configuration file (the link is on the web app page) and replace the directory there with the directory where your clone is.

The dir in the WSGI config file is $HOME/web2py and not any specific app in $HOME/web2py/applications. The file settings.cfg specifies the index file from the welcome app. welcome = welcome/models/db.py,welcome/controllers/default.py,welcome/views/default/index.html Is that what I need to change to point to the eden app I cloned under applications dir?

if your git clone of the foss app was in /home/akachhy/web2py, and you had created a new web2py app at /home/akachhy/web2py, then you have overwritten your cloned files.

if this is the case, git clone again (eg: to /home/akachhy/foss_webapp). and go to your wsgi.py file and change the project_home variable from /home/akachhy/web2py to /home/akachhy/foss_webapp. That's all you need to change. You can find the wsgi.py file either directly from your webapps tab or by navigating to /var/www in the files tab.

When I create a web2py app from the console on pythonanywhere, it creates an app named welcome. I cloned the git repository named eden under web2py/applications where it is expected. So the dir tree is as follows. -rw-r--r-- 1 akachhy registered_users 1 May 2 20:14 init.py -rw-r--r-- 1 akachhy registered_users 111 May 2 20:15 init.pyc drwxr-xr-x 14 akachhy registered_users 4096 May 2 20:44 admin drwxrwxr-x 13 akachhy registered_users 4096 May 2 20:34 eden drwxr-xr-x 9 akachhy registered_users 4096 May 2 20:14 examples drwxr-xr-x 14 akachhy registered_users 4096 May 2 20:15 welcome

Seems that pythonanywhere starts the app named welcome, by specifying its index action in the settings.cfg file as I indicated in the previous message. The WSGI file (content below)does not seem to specify any particular app (welcome or admin) to be started.

import os import sys

add your project directory to the sys.path

project_home = u'/home/akachhy/web2py/' if project_home not in sys.path: sys.path = [project_home] + sys.path

sys.stdout = sys.stderr os.chdir(project_home)

serve web2py via WSGI handler

from gluon.main import wsgibase as application

I edited the settings.cfg file as follows.

welcome = welcome/models/db.py,welcome/controllers/default.py,welcome/views/default/index.html

welcome = eden/models/000_config.py,eden/controllers/default.py,eden/views/default/index.html

but after reloading the app from the console I still see the pages from welcome app. You visited the url /welcome/default/index

So, I need to know what to update to stop loading welcome and start with eden under web2py.

From the web2py docs