lektor / lektor

The lektor static file content management system

Home Page:https://www.getlektor.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Admin interface doesn't work when lektor is installed as a local package

isotherm opened this issue · comments

Using Lektor 3.1.3, installed as a user/local package, the admin interface doesn't load properly. The HTML loads, but the CSS and JavaScript it references are all reported as 404 Not Found.

Using strace -f lektor server, I find that lektor is trying to serve the file from what would have been its path, had it been installed system-wide, e.g.:
stat("/usr/lib/python3/dist-packages/lektor/admin/static/gen/styles.css", 0x7f99a51cd7a0) = -1 ENOENT (No such file or directory)

After trying to uninstall and reinstall lektor, I then got an error: Cannot import name 'escape' from 'jinja2'. Researching that led me to manually upgrade Flask, and that appears to have resolved whatever the problem was. It would appear that the Flask module may need a specific version specified in order to avoid this problem.

The current stable release of Lektor is 3.3.6.

3.1.3 was released in January 2019 and is quite old.

As expected, the problem was on my end: Somehow lektor had gotten installed system-wide by some package, and local and system-wide versions of lektor and then jinja2 were conflicting. I leave this comment in case someone happens upon the same problem in the future.

Just as a side note, the versions of Lektor packaged by most distributions are pretty stale, at this point.
The suggested installation method is to use pipx to install from PyPI. Using a per-project virtualenv is another alternative.