Web deployment question

Benjamin Gilbert bgilbert at cs.cmu.edu
Mon Oct 22 13:21:34 EDT 2012


On 10/22/2012 12:53 PM, Bob Seifert wrote:
> If I am hosting this through AMPPS on windows, I place the slidedeck
> app folder into \www.

Nope.  You may be used to PHP, where web applications go directly into 
your web server's root directory.  In other web frameworks, the web 
application is stored in a different directory and the web server is 
configured to relay requests to it.

For an ad-hoc installation with a few users, it's actually sufficient to 
install Python, OpenSlide Python, and Flask, and then use Python to run 
the slidedeck.py file directly.  This will run Flask's built-in web 
server, which is good enough for light use.  If you want to set up a 
system for more than a few users, or that will be exposed to untrusted 
users, the term to Google for is "WSGI".  WSGI is the standard mechanism 
for connecting Python web applications to web servers.  Apache has a 
module for this, mod_wsgi.

> For pointing the python app to the folder with slides do I edit line 30:
> SLIDE_DIR = '.'
> of slidedeck.py to read the directory that contains my slides?  If so
> how do I express this?
> '/www/slidedeck/slides' ?

You shouldn't store the slide files under /www unless you want to be 
able to download the original files directly from the web server. 
Create a directory somewhere else ("/slides"?) and specify that.

As to setting SLIDE_DIR, you don't need to edit the source file.  If 
you're using the Flask built-in web server, you can just pass the 
directory as a command-line argument.  If you're using something like 
Apache, you can set the SLIDEDECK_SETTINGS environment variable to the 
path to a config file:

     http://flask.pocoo.org/docs/config/#configuring-from-files

> Also when I load up the index.html through AMPPS via localhost/slidedeck/ I get
>
> {% for entry in root_dir.children recursive %}

Right, that's not really an HTML file.  It's a template for an HTML 
file, which is filled in by the web application.

--Benjamin Gilbert



More information about the openslide-users mailing list