A web ui for python scripts
Wooey is a easy way to get your scripts up on the web for routine data analysis, file processing, or anything else.
This is my demo. Pythonanywhere does not support celery. therefore, scripts will not executed.
Read this before you start.
ALLOWED_HOSTS = (
'localhost',
'127.0.0.1',
".pythonanywhere.com")
git clone https://github.com/<your-github-username>/<your-git-repo-name>.git
Beware of inside of < and >.
$ cd <your-git-repo-name>
$ virtualenv --python=python3 myvenv
$ source myvenv/bin/activate
(myvenv) $ pip install wooey
It takes a time.
(mvenv) $ python manage.py createsuperuser
(mvenv) $ python manage.py migrate
- Pythonanywhere dashboard
- Click the
Web
- Add a new web app
- Set your domain name
- Select manual configuration
- Select Python 3.4 (This is latest version at 2018/6/14)
- Click
Next
button - Setup wizard will closed
- In Virtualenv section
- Click the
Enter the path to a virtualenv
- Input /home//<your-git-repo-name/myvenv/
- Click the blue check button
Wooey(based on Django) works with WSGI protocol. This is standard protocols for python web app.
- At Code section, there is
/var/www/<your-username>_pythonanywhere_com_wsgi.py
link - Click the link
- Delete everything
- Copy and paste below code (beware of <>)
import os
import sys
path = '/home/<your-PythonAnywhere-username>/<your-git-repo-name></your-git-repo-name>' # PythonAnywhere 계정으로 바꾸세요.
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = '<your-wooey-project-name>.settings'
from django.core.wsgi import get_wsgi_application
from django.contrib.staticfiles.handlers import StaticFilesHandler
application = StaticFilesHandler(get_wsgi_application())
Save this file
If there is error, you shold check the error log.
Momore hatz – Blog