1
0
Fork 0
forked from github/pelican
Commit graph

26 commits

Author SHA1 Message Date
Kevin Yap
1e0e541b57 Initial pass of removing Python 2 support
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.
2019-11-26 06:16:41 +09:00
John Franey
9e07234bae Update Tox config and fix failing CI envs
Updates base Python version for Travis CI from 2.7 to 3.6 and fixes a
linting error.
2019-06-18 22:44:46 -04:00
Deniz Turgut
8aeed9b7bd Refactor pelican.server logging
* Use pelican.log instead of default loggers
* Remove excessive logging (report failures if nothing matches, don't report successes)
2018-11-27 19:55:31 +03:00
Justin Mayer
96a689eaef
Merge pull request #2324 from oulenz/get_suffixes
correct suffix order in ComplexHTTPRequestHandler
2018-10-31 15:23:22 +01:00
Oliver Urs Lenz
8c433616bf fix pelican.server __main__ code, add deprecation warning 2018-08-08 18:00:15 +02:00
Oliver Urs Lenz
5cc40ee3ba correct suffix order in ComplexHTTPRequestHandler 2018-08-08 16:37:39 +02:00
Ryan Fox
36d61438c1 clarify error message when running deprecated command for dev server. Fixes #2390 2018-08-02 20:59:19 -05:00
Johannes 'josch' Schauer
a5edbf8546 Remove develop_server.sh in favour of pelican serving static files itself
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.
2018-06-22 19:22:38 +02:00
Justin Mayer
583c840579
Merge pull request #2269 from tonymet/feature/https-server
Support SSL with pelican.server by adding --ssl , --cert and --key options
2018-04-10 14:09:07 -07:00
Anthony Metzidis
12db9ba0e1 support ssl in pelican.server with --ssl, --cert & --key 2018-04-07 15:06:38 -07:00
Eli Bendersky
16d5236e62 Try to rstrip '/' from the address in the server script when serving pages. 2018-04-05 05:50:50 -07:00
Ryan M
90025818ed prevent server from dying when query strings present
split on first ?
2016-12-10 10:05:50 -08:00
derwinlu
8993c55e6e fulfil pep8 standard 2015-08-17 13:34:32 +02:00
Deniz Turgut
7b4ceb2974 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.
2015-04-03 18:58:52 -04:00
Forest
7ad649e3b7 Guess mime type with python-magic if available. Fixes #1514. 2015-03-24 11:38:38 -07:00
Kevin Yap
79548c3bf9 Minor changes to server.py
- Log original path name rather than last path name
- Use for-else construct to avoid use of flag variable
- Make log messages consistent
2015-01-14 20:20:36 -08:00
Danny Hermes
3d8ceb1c67 Adding ability to listen on addresses other than localhost.
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.
2015-01-10 15:40:54 -08:00
Deniz Turgut
ed3209888a Refactor logging handling
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).
2014-07-22 12:39:39 -04:00
Rob Kennedy
1b6f081619 Allow socket address reuse; fixed #1264
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.
2014-02-14 14:20:38 -08:00
Rob Iwancz
301268f67f Fixes issue in devserver introduced in v3.3
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.
2013-12-04 22:26:39 +11:00
Sorin Sbarnea
3b315fbc53 Fixing #1038 by allowing nice URLs. 2013-08-12 19:23:57 +01:00
Stefan hr Berder
3da4c2e13e add port option to pelican.server 2013-07-07 12:44:21 +02:00
Félix Delval
66aae01493 Adding a message for gracefully shutting down dev server 2013-03-19 12:15:58 +01:00
Félix Delval
7fa0d3063d Creating a more explicit error message at server creation 2013-03-16 19:29:10 +01:00
Alexis Métaireau
519dcdbcb3 Manual pass on sources for better standards. 2013-03-03 20:12:31 -08:00
Dirk Makowski
71995d5e1b Port pelican to python 3.
Stays compatible with 2.x series, thanks to an unified codebase.
2013-01-11 03:20:09 +01:00