steiza / docstore

For any civics-minded organization that needs a simple place to host documents publicly
http://a2docs.org/
7 stars 4 forks source link

Make webserver script executable #15

Closed eby closed 8 years ago

eby commented 8 years ago

I've looked at OSX and a few linux distros. Especially ones that support having both 2.x and 3.x pythons installed. It seems that the executable python2.7 exists on all of them.

On my server I made webserver.py executable and added the following to the top:

!/usr/bin/env python2.7

That looks for the python2.7 in path vs a hard path. Maybe give it a try on your dev box and see if it causes issues. Seems to work wherever I put it.

This allows it to just run as ./webserver.py which helps in writing a init.d script to control it. I need to polish up the init.d script and then I'll share that in a support scripts folder along with nginx config.

steiza commented 8 years ago

Yeah, this is a good idea.

Actually, while we're at it, I'm going to rename webserver.py -> docstore. Once things settle down a bit we could put this project on pypi and then people could do pip install docstore and after docstore will be in their sys bin path.

See https://github.com/steiza/docstore/commit/fb621e83d8b55e11cec0165a6a78a5b5c3b5bfc9 for the changes.