Forums

A beginners guide to running and serving superset on the web interface

Hello, I'm all new to pythonanywhere and the web interface world. I have a small hobby project, that I think might work on pythonanywhere.

In short terms, I want to build a simple web interface that allows a user to upload a (small) .csv file, pass this to a pandas data frame for processing and finally present the output on Apache Superset.

I have installed Superset in a virtual environment here, and when running it using superset init it spins up on http://0.0.0.0:8088.

My question is quite simple:

How do I correctly setup Superset, such as it is accessible at xxx.pythonanywhere.com?

I realise that I'm not supplying any code for my first attempt, which is quite simply because I don't really know where to start. I am quite comfortable with python, and have some small experience with using flask in non-app settings. I think it would be quite instructive for me (and probably others) if this post could become a short guide with link to resources required to learn the necessary steps.

Thanks!

I see you posted this on Stack Overflow too -- I'll reply here, though, as I suspect there will be a bit of back-and-forth before we can work out the solution.

It sounds like you've worked out how the WSGI file setup works. Superset's docs say that if you're running gunicorn (which of course we're not in this case, but it may be instructive) you should run it like this:

gunicorn \
        -w 10 \
        -k gevent \
        --timeout 120 \
        -b  0.0.0.0:6666 \
        --limit-request-line 0 \
        --limit-request-field_size 0 \
        --statsd-host localhost:8125 \
        superset:app

That looks to me like it's just running the application app from the module superset. So, for a first try, could you try changing your WSGI file so that it reads:

import superset
from superset import app as application

...and see how that goes?

Dear giles,

thanks for the reply. That was depressingly simple and worked instantly! Many thanks. I will link this to the stack overflow post so others can benefit.

Excellent, glad I could help!

Hello, i'm trying to run the superset without web app 'http://resultadosacademicos.pythonanywhere.com/' but when I changed the WSGI to:

import sys
import superset

# add your project directory to the sys.path
project_home = u'/home/resultadosacademicos/mysite'
if project_home not in sys.path:
    sys.path = [project_home] + sys.path

# import flask app but need to call it "application" for WSGI to work
#from flask_app import app as application  # noqa
from superset import app as application

an error message appeared: Error running WSGI application ModuleNotFoundError: No module named 'superset' File "/var/www/resultadosacademicos_pythonanywhere_com_wsgi.py", line 9, in <module> import superset

I use python, but I do not use web framework.

Thank you

Your first import of superset is not used in the rest of the file. The linter is just pointing out that it's not necessary.