summaryrefslogtreecommitdiff
path: root/pelican/server.py
Commit message (Collapse)AuthorAgeFilesLines
* Initial pass of removing Python 2 supportKevin Yap2019-11-261-10/+7
| | | | | | This commit removes Six as a dependency for Pelican, replacing the relevant aliases with the proper Python 3 imports. It also removes references to Python 2 logic that did not require Six.
* Update Tox config and fix failing CI envsJohn Franey2019-06-181-1/+1
| | | | | Updates base Python version for Travis CI from 2.7 to 3.6 and fixes a linting error.
* Refactor pelican.server loggingDeniz Turgut2018-11-271-16/+21
| | | | | * Use pelican.log instead of default loggers * Remove excessive logging (report failures if nothing matches, don't report successes)
* Merge pull request #2324 from oulenz/get_suffixesJustin Mayer2018-10-311-29/+22
|\ | | | | correct suffix order in ComplexHTTPRequestHandler
| * correct suffix order in ComplexHTTPRequestHandlerOliver Urs Lenz2018-08-081-29/+22
| |
* | fix pelican.server __main__ code, add deprecation warningOliver Urs Lenz2018-08-081-8/+7
|/
* clarify error message when running deprecated command for dev server. Fixes ↵Ryan Fox2018-08-021-0/+5
| | | | #2390
* Remove develop_server.sh in favour of pelican serving static files itselfJohannes 'josch' Schauer2018-06-221-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Competing static site generators integrate the functionality of regenerating content and serving it into their main executable. In pelican this functionality used to be in an external script `develop_server.sh` which resides in the blog base directory. This has the disadvantage that changes in pelican can break the `develop_server.sh` scripts which will not automatically be upgraded together with pelican by package managers. Thus, pelican should integrate this functionality into its main executable. To this end, this commit removes `develop_server.sh` and adds three command line options to the pelican executable: * `-l/--listen` starts the HTTP server (`-s/--serve` was already taken) * `-p/--port` specifies the port to listen at * `-b/--bind` specifies the IP to bind to `--listen` and `--autoreload` can be used together to achieve the same effect that other static site generators offer: Serve files via HTTP while at the same time auto-generating the content. Since the `develop_server.sh` script was removed, pelican-quickstart looses the `develop` option. Since the `develop_server.sh` script was removed, the Makefile looses the `stopserver` target and the `devserver` target is replaced by running `pelican -l` in the foreground. Since pelican now offers the `--listen` option, the fabfile uses that instead of starting the socketserver itself.
* Merge pull request #2269 from tonymet/feature/https-serverJustin Mayer2018-04-101-6/+36
|\ | | | | Support SSL with pelican.server by adding --ssl , --cert and --key options
| * support ssl in pelican.server with --ssl, --cert & --keyAnthony Metzidis2018-04-071-6/+36
| |
* | Try to rstrip '/' from the address in the server script when serving pages.Eli Bendersky2018-04-051-13/+20
|/
* prevent server from dying when query strings presentRyan M2016-12-101-0/+4
| | | | split on first ?
* fulfil pep8 standardderwinlu2015-08-171-7/+9
|
* Make `pelican.server` importable and use it in `fab serve`Deniz Turgut2015-04-031-26/+20
| | | | | | | `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.
* Guess mime type with python-magic if available. Fixes #1514.Forest2015-03-241-0/+17
|
* Minor changes to server.pyKevin Yap2015-01-141-11/+15
| | | | | | - Log original path name rather than last path name - Use for-else construct to avoid use of flag variable - Make log messages consistent
* Adding ability to listen on addresses other than localhost.Danny Hermes2015-01-101-4/+5
| | | | | | This is helpful for mobile testing of Pelican sites by allowing broadcasting on the local network. Using port 80 requires running as root on most machines.
* Refactor logging handlingDeniz Turgut2014-07-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Old system was using manual string formatting for log messages. This caused issues with common operations like exception logging because often they need to be handled differently for Py2/Py3 compatibility. In order to unify the effort: - All logging is changed to `logging.level(msg, arg1, arg2)` style. - A `SafeLogger` is implemented to auto-decode exceptions properly in the args (ref #1403). - Custom formatters were overriding useful logging functionality like traceback outputing (ref #1402). They are refactored to be more transparent. Traceback information is provided in `--debug` mode for `read_file` errors in generators. - Formatters will now auto-format multiline log messages in order to make them look related. Similarly, traceback will be formatted in the same fashion. - `pelican.log.LimitFilter` was (ab)using logging message which would result in awkward syntax for argumented logging style. This functionality is moved to `extra` keyword argument. - Levels for errors that would result skipping a file (`read_file`) changed from `warning` to `error` in order to make them stand out among other logs. - Small consistency changes to log messages (i.e. changing all to start with an uppercase letter) and quality-of-life improvements (some log messages were dumping raw object information).
* Allow socket address reuse; fixed #1264Rob Kennedy2014-02-141-0/+1
| | | | | | | The socket may remain in the TIME_WAIT state for some time after the server shuts down, which prevents another instance of the server from listening on the same port. This change allows the server to reuse the address even when it's still waiting.
* Fixes issue in devserver introduced in v3.3Rob Iwancz2013-12-041-7/+10
| | | | | | | Fixes an intermittent devserver problem with directory urls containing index.html (i.e. clean urls). It tries to send the index.html file twice, resulting in a scrambled web page complete with HTTP headers in the output, and sometimes Broken Pipe errors.
* Fixing #1038 by allowing nice URLs.Sorin Sbarnea2013-08-121-5/+24
|
* add port option to pelican.serverStefan hr Berder2013-07-071-2/+2
|
* Adding a message for gracefully shutting down dev serverFélix Delval2013-03-191-1/+5
|
* Creating a more explicit error message at server creationFélix Delval2013-03-161-1/+7
|
* Manual pass on sources for better standards.Alexis Métaireau2013-03-031-3/+2
|
* Port pelican to python 3.Dirk Makowski2013-01-111-0/+20
Stays compatible with 2.x series, thanks to an unified codebase.