1
0
Fork 0
forked from github/pelican

Make pelican.server importable and use it in fab serve

`fab serve` and `make devserver` use different HTTP Handlers and as a
result they behave differently. This makes sure `fab serve` also uses
the Handler defined in `pelican.server` in order to get rid of the
inconsistency.
This commit is contained in:
Deniz Turgut 2015-04-03 18:58:52 -04:00
commit 7b4ceb2974
2 changed files with 23 additions and 28 deletions

View file

@ -3,9 +3,10 @@ import fabric.contrib.project as project
import os
import shutil
import sys
import SimpleHTTPServer
import SocketServer
from pelican.server import ComplexHTTPRequestHandler
# Local path configuration (can be absolute or relative to fabfile)
env.deploy_path = 'output'
DEPLOY_PATH = env.deploy_path
@ -51,7 +52,7 @@ def serve():
class AddressReuseTCPServer(SocketServer.TCPServer):
allow_reuse_address = True
server = AddressReuseTCPServer(('', PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
server = AddressReuseTCPServer(('', PORT), ComplexHTTPRequestHandler)
sys.stderr.write('Serving on port {0} ...\n'.format(PORT))
server.serve_forever()