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:
parent
cc8f835f07
commit
7b4ceb2974
2 changed files with 23 additions and 28 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue