Git Product home page Git Product logo

whiskyechobravo / kerkoapp Goto Github PK

View Code? Open in Web Editor NEW
59.0 5.0 21.0 201 KB

A web application that provides a faceted search interface for bibliographies managed with Zotero.

Home Page: https://whiskyechobravo.github.io/kerko/

License: BSD 3-Clause "New" or "Revised" License

Python 49.96% Dockerfile 5.13% Makefile 35.87% Jinja 9.03%
zotero flask-application bibliography bibliographies search-interface python flask webapp academia scholar

kerkoapp's Introduction

KerkoApp

KerkoApp is a web application that uses Kerko to provide a user-friendly search and browsing interface for sharing a bibliography managed with the Zotero reference manager.

KerkoApp is built in Python with the Flask framework. It is just a thin container around Kerko and, as such, inherits most of its features directly from Kerko. However, it adds support for TOML configuration files, allowing a good separation of configuration from code.

Although KerkoApp offers many configuration options, more advanced customizations might require building a custom application, possibly using KerkoApp as a starting point, where various aspects of Kerko could be extended or adapted through its Python API.

Demo site

A KerkoApp demo site is available for you to try. You may also view the Zotero library that contains the source data for the demo site.

Learn more

Please refer to the documentation for more details.

kerkoapp's People

Contributors

amv avatar aormazabal avatar davidlesieur avatar mmoole avatar retorquere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kerkoapp's Issues

Error after Flask kerko sync

Hi,

I really appreciate your work, and I'm trying to apply it to a new project of online bibliography. Unfortunately, my knowledge is poor, and I just got an error message after the "Flask kerko sync" step. Here is the message I get, I guess it's not too bad and just the result of my ignorance or a networks's parameter...

Maybe someone here could understand the reason ?
As explained on the Kerkoapp presnetation on Github, I've updated the .env file with my variables, as :

« SECRET_KEY=(secret key I've chosen)
KERKO_TITLE=Bibliographie Velay et Haute-Loire
KERKO_ZOTERO_API_KEY=(here, a key which was ok when I was connecting with the Zotpress plugin for Wordpress)
KERKO_ZOTERO_LIBRARY_ID=4371063 »

Here is the error message :
(venv) [email protected] (python/3.8/development) ~/www/kerkoapp $ flask kerko sync

[2021-07-27 15:11:08,268] INFO in index: Starting index sync.

[2021-07-27 15:11:08,269] INFO in zotero: Requesting all item types...

[2021-07-27 15:11:11,326] ERROR in zotero: HTTPSConnectionPool(host='api.zotero.org', port=443): Max retries exceeded with url: /itemTypes?locale=en-US (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fadee555280>: Failed to establish a new connection: [Errno 111] Connection refused'))

Traceback (most recent call last):

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn

conn = connection.create_connection(

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection

raise err

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection

sock.connect(sa)

ConnectionRefusedError: [Errno 111] Connection refused


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen

httplib_response = self._make_request(

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request

self._validate_conn(conn)

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn

conn.connect()

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/connection.py", line 353, in connect

conn = self._new_conn()

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn

raise NewConnectionError(

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fadee555280>: Failed to establish a new connection: [Errno 111] Connection refused


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

File "/home/gsukkts/venv/lib/python3.8/site-packages/requests/adapters.py", line 439, in send

resp = conn.urlopen(

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen

retries = retries.increment(

File "/home/gsukkts/venv/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment

raise MaxRetryError(_pool, url, error or ResponseError(cause))

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.zotero.org', port=443): Max retries exceeded with url: /itemTypes?locale=en-US (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fadee555280>: Failed to establish a new connection: [Errno 111] Connection refused'))


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

File "/home/gsukkts/venv/lib/python3.8/site-packages/kerko/zotero.py", line 21, in retry_zotero

return wrapped(*args, **kwargs)

File "/home/gsukkts/venv/lib/python3.8/site-packages/kerko/zotero.py", line 65, in load_item_types

return zotero_credentials.item_types()

File "/home/gsukkts/venv/lib/python3.8/site-packages/pyzotero/zotero.py", line 150, in wrapped_f

retrieved = self._retrieve_data(query_string, params=params)

File "/home/gsukkts/venv/lib/python3.8/site-packages/pyzotero/zotero.py", line 432, in _retrieve_data

self.request = requests.get(

File "/home/gsukkts/venv/lib/python3.8/site-packages/requests/api.py", line 76, in get

return request('get', url, params=params, **kwargs)

File "/home/gsukkts/venv/lib/python3.8/site-packages/requests/api.py", line 61, in request

return session.request(method=method, url=url, **kwargs)

File "/home/gsukkts/venv/lib/python3.8/site-packages/requests/sessions.py", line 542, in request

resp = self.send(prep, **send_kwargs)

File "/home/gsukkts/venv/lib/python3.8/site-packages/requests/sessions.py", line 655, in send

r = adapter.send(request, **kwargs)

File "/home/gsukkts/venv/lib/python3.8/site-packages/requests/adapters.py", line 516, in send

raise ConnectionError(e, request=request)

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.zotero.org', port=443): Max retries exceeded with url: /itemTypes?locale=en-US (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fadee555280>: Failed to establish a new connection: [Errno 111] Connection refused'))

[2021-07-27 15:11:11,328] WARNING in zotero: The Zotero API call has failed in load_item_types. New attempt in 120 seconds...

Thanks a lot if you have any clue...

Best regards,

Sylvain (France)

Using Kerko in multi-user settings

Hi!
I was wondering whether it would be possible to use Kerko in multi-user settings, i.e. make it serve content obtained from Zotero using different API keys, depending on user? The context for this question is embedding Kerko in another web app (online text editor)

Thank you in advance!

No items in zotero... since kerko shows files

I had uploaded files on Zotero and ran Kerko. It worked great.

Now on deleting files and even after syncing kerko(using flask kerko sync), I am still getting those files.

Am I missing something?

Running KerkoApp on Windows

Thank you for this contribution, it is very appreciated!

FYI, I am running KerkoApp locally on a Windows platform. I had a couple of issues, not directly related to KerkoApp. I write them down here, in case this experience can be useful to someone else:

  1. Regarding requirements: eventually, I had to create the virtual environment from Conda and make minor changes to run.txt before running pip install -r requirements/run.txt.
  2. I had to pass the command set FLASK_APP=kerkoapp.py to cmd.exe before running flask kerko index.

With these slight changes, my bibliography is now available at http://127.0.0.1:5000/ in my browser! Thanks!

Customized collection facets don't show up

Given the following configs, with the KERKOAPP_COLLECTION_FACETS variable, the facets menu should display the following:

  • Collection 1
  • Collection 2
  • Collection 3
  • ...
  • Collection 8

But instead it displays the default facets:

https://bibliographies.bib.umontreal.ca/remillc/bibliography/

The zoteroapp is installed using a python virtual environment and a WSGI server.

Here are the Zotero link to the group and the .env configuration file used:

Zotero group: https://www.zotero.org/groups/4833782/test-remillc-2/library

# Documentation: https://github.com/whiskyechobravo/kerkoapp#environment-variables

# Kerko variables.
SECRET_KEY=ZWehodY9u0N4LHWNrLhy
KERKO_TITLE=Test 2
KERKO_ZOTERO_API_KEY=njNkHhi4RNsu5QK1ZqdZK6Dl
KERKO_ZOTERO_LIBRARY_ID=4833782
KERKO_ZOTERO_LIBRARY_TYPE=group
KERKO_PRINT_ITEM_LINK=True
KERKO_PRINT_CITATIONS_LINK=True

KERKO_DATA_DIR=/<_path to_>/kerkoapp/data/kerko
BABEL_DEFAULT_TIMEZONE=America/Montreal
BABEL_DEFAULT_LOCALE=fr
KERKO_WHOOSH_LANGUAGE=fr

# KerkoApp variables.
FLASK_APP=kerkoapp.py
FLASK_ENV=production

# Docker container variables.
MODULE_NAME=kerkoapp

# Personnalisations
# KERKO_FACET_COLLAPSING=True
KERKOAPP_COLLECTION_FACETS=F3B5WRMF:0:Collection 1; ACRTRJ9A:1:Collection 2; EGH4IKGP:2:Collection 3; PJSLGI9L:3:Collection 4; C6W5S9LR:4:Collection 5; 39WFSHPN:5:Collection 6; PUDEPTQX:6:Collection 7; ZGMKZ8VH:7:Collection 8
LOGGING_LEVEL=DEBUG

Any help sould be appreciated!

Interested in Docker container?

I am working with a developer on putting the app into a Docker container to make it easier to install. Would you be interested in that when we are done to share with others and perhaps make updates easier?

KeyError: "No field named 'collection_facet_F3B5WRMF'"

Hi,

I'm running Kerkoapp in a Docker container following the readme instructions on a Windows 10 station. The Kerkoapp app runs well with the defaults settings. The problem comes when I add a KERKOAPP_COLLECTION_FACETS variable to the .env file. There, the app shows an error page:

2022-10-26 15-36-22

Configs

Here are the infos to help reproduce the problem. It is a test library so I include the Zoreto API key:

Library: https://www.zotero.org/groups/4833782/test-remillc-2/library

.env file:

SECRET_KEY=ZWehodY9u0N4LHWNrLhy
KERKO_TITLE=Test
KERKO_ZOTERO_API_KEY=njNkHhi4RNsu5QK1ZqdZK6Dl
KERKO_ZOTERO_LIBRARY_ID=4833782
KERKO_ZOTERO_LIBRARY_TYPE=group
KERKO_PRINT_ITEM_LINK=True
KERKO_PRINT_CITATIONS_LINK=True

# KerkoApp variables.
FLASK_APP=kerkoapp.py
FLASK_ENV=production

# Docker container variables.
MODULE_NAME=kerkoapp

KERKOAPP_COLLECTION_FACETS=F3B5WRMF:1:Organismes
# LOGGING_LEVEL=DEBUG

The API key is set for a Read/Write access to the test-remillc-2 group.

Here is a full log:

D:\projets\kerkoapp-docker
λ make run
docker run --env-file D:/projets/kerkoapp-docker/.env --rm -p 8080:80 -v D:/projets/kerkoapp-docker/data:/app/data -v /tmp/kerkoapp-dev-log:/dev/log whiskyechobravo/kerkoapp
Checking for script in /app/prestart.sh
Running script /app/prestart.sh
Running inside /app/prestart.sh, you could add migrations to this file, e.g.:

#! /usr/bin/env bash

# Let the DB start
sleep 10;
# Run migrations
alembic upgrade head

[2022-10-26 19:34:01 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2022-10-26 19:34:01 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
[2022-10-26 19:34:01 +0000] [1] [INFO] Using worker: egg:meinheld#gunicorn_worker
[2022-10-26 19:34:01 +0000] [7] [INFO] Booting worker with pid: 7
[2022-10-26 19:34:01 +0000] [8] [INFO] Booting worker with pid: 8
[2022-10-26 19:34:02 +0000] [9] [INFO] Booting worker with pid: 9
[2022-10-26 19:34:02 +0000] [10] [INFO] Booting worker with pid: 10
[2022-10-26 19:34:02 +0000] [11] [INFO] Booting worker with pid: 11
[2022-10-26 19:34:02 +0000] [12] [INFO] Booting worker with pid: 12
[2022-10-26 19:34:02 +0000] [13] [INFO] Booting worker with pid: 13
[2022-10-26 19:34:02 +0000] [14] [INFO] Booting worker with pid: 14
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.9/site-packages/kerko/exceptions.py", line 20, in wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/kerko/views.py", line 46, in search
    search_results, facet_results, total_count, page_count, last_sync = query.run_query(
  File "/usr/local/lib/python3.9/site-packages/kerko/query.py", line 372, in run_query
    results = searcher.search_page(q, **search_args)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 639, in search_page
    results = self.search(query, limit=pagenum * pagelen, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 786, in search
    self.search_with_collector(q, c)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 817, in search_with_collector
    collector.prepare(self, q, context)
  File "/usr/local/lib/python3.9/site-packages/whoosh/collectors.py", line 699, in prepare
    self.child.prepare(top_searcher, q, context)
  File "/usr/local/lib/python3.9/site-packages/whoosh/collectors.py", line 805, in prepare
    ctr = facet.categorizer(top_searcher)
  File "/usr/local/lib/python3.9/site-packages/whoosh/sorting.py", line 197, in categorizer
    fieldobj = global_searcher.schema[fieldname]
  File "/usr/local/lib/python3.9/site-packages/whoosh/fields.py", line 1385, in __getitem__
    raise KeyError("No field named %r" % (name,))
KeyError: "No field named 'collection_facet_F3B5WRMF'"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/logging/handlers.py", line 954, in emit
    self.socket.send(msg)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/logging/handlers.py", line 875, in _connect_unixsocket
    self.socket.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/logging/handlers.py", line 957, in emit
    self._connect_unixsocket(self.address)
  File "/usr/local/lib/python3.9/logging/handlers.py", line 886, in _connect_unixsocket
    self.socket.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused
Call stack:
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2076, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1434, in handle_exception
    self.log_exception(exc_info)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1457, in log_exception
    self.logger.error(
Message: 'Exception on /bibliography/ [GET]'
Arguments: ()
[2022-10-26 19:34:04,427] ERROR in app: Exception on /bibliography/ [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.9/site-packages/kerko/exceptions.py", line 20, in wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/kerko/views.py", line 46, in search
    search_results, facet_results, total_count, page_count, last_sync = query.run_query(
  File "/usr/local/lib/python3.9/site-packages/kerko/query.py", line 372, in run_query
    results = searcher.search_page(q, **search_args)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 639, in search_page
    results = self.search(query, limit=pagenum * pagelen, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 786, in search
    self.search_with_collector(q, c)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 817, in search_with_collector
    collector.prepare(self, q, context)
  File "/usr/local/lib/python3.9/site-packages/whoosh/collectors.py", line 699, in prepare
    self.child.prepare(top_searcher, q, context)
  File "/usr/local/lib/python3.9/site-packages/whoosh/collectors.py", line 805, in prepare
    ctr = facet.categorizer(top_searcher)
  File "/usr/local/lib/python3.9/site-packages/whoosh/sorting.py", line 197, in categorizer
    fieldobj = global_searcher.schema[fieldname]
  File "/usr/local/lib/python3.9/site-packages/whoosh/fields.py", line 1385, in __getitem__
    raise KeyError("No field named %r" % (name,))
KeyError: "No field named 'collection_facet_F3B5WRMF'"
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.9/site-packages/kerko/exceptions.py", line 20, in wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/kerko/views.py", line 46, in search
    search_results, facet_results, total_count, page_count, last_sync = query.run_query(
  File "/usr/local/lib/python3.9/site-packages/kerko/query.py", line 372, in run_query
    results = searcher.search_page(q, **search_args)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 639, in search_page
    results = self.search(query, limit=pagenum * pagelen, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 786, in search
    self.search_with_collector(q, c)
  File "/usr/local/lib/python3.9/site-packages/whoosh/searching.py", line 817, in search_with_collector
    collector.prepare(self, q, context)
  File "/usr/local/lib/python3.9/site-packages/whoosh/collectors.py", line 699, in prepare
    self.child.prepare(top_searcher, q, context)
  File "/usr/local/lib/python3.9/site-packages/whoosh/collectors.py", line 805, in prepare
    ctr = facet.categorizer(top_searcher)
  File "/usr/local/lib/python3.9/site-packages/whoosh/sorting.py", line 197, in categorizer
    fieldobj = global_searcher.schema[fieldname]
  File "/usr/local/lib/python3.9/site-packages/whoosh/fields.py", line 1385, in __getitem__
    raise KeyError("No field named %r" % (name,))
KeyError: "No field named 'collection_facet_F3B5WRMF'"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/logging/handlers.py", line 954, in emit
    self.socket.send(msg)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/logging/handlers.py", line 875, in _connect_unixsocket
    self.socket.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/logging/handlers.py", line 957, in emit
    self._connect_unixsocket(self.address)
  File "/usr/local/lib/python3.9/logging/handlers.py", line 886, in _connect_unixsocket
    self.socket.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused
Call stack:
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2076, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1434, in handle_exception
    self.log_exception(exc_info)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1457, in log_exception
    self.logger.error(
Message: 'Exception on /bibliography/ [GET]'
Arguments: ()

Hoping to find some help!

Christian

Exclude all child Notes from the full record page

Hi,

I'm trying to exclude all child Notes from the full record page.
I added KERKOAPP_EXCLUDE_DEFAULT_FIELDS=notes to my .env but they still appear.

This, from the documentation, looks like what I'm after:
KERKOAPP_EXCLUDE_DEFAULT_FIELDS: List of fields (identified by key) to exclude from those created by default. If that list contains the value '*', no field will be created by default. Caution: some default fields are required by Kerko or by badges. If required fields are excluded, the application probably won't start. Please refer to the implementation of kerko.composer.Composer.init_default_fields() for the list of default fields.

composer.py contains the following so I used key='notes'.
Have I missed something?
Thanks,
mike

Child notes of the item.

if 'notes' not in exclude:
self.add_field(
FieldSpec(
key='notes',
field_type=STORED,
extractor=extractors.RawNotesExtractor(
include_re=self.default_child_include_re,
exclude_re=self.default_child_exclude_re
)
)
)

.env file not being picked up

I have a .env file in the same directory as the kerkoapp.py, but when I run

python kerkoapp.py

I get

Traceback (most recent call last):
  File "kerkoapp.py", line 5, in <module>
    from app import create_app
  File "/app/app/__init__.py", line 11, in <module>
    from .config import CONFIGS
  File "/app/app/config.py", line 20, in <module>
    class Config():
  File "/app/app/config.py", line 21, in Config
    SECRET_KEY = env.str('SECRET_KEY')
  File "/usr/local/lib/python3.7/site-packages/environs.py", line 53, in method
    'Environment variable "{}" not set'.format(proxied_key or parsed_key)
environs.EnvError: Environment variable "SECRET_KEY" not set

my current .env is simply what's in the README:

FLASK_APP=kerkoapp.py
FLASK_ENV=production
SECRET_KEY=YYYYYYYYY
KERKO_TITLE="Kerko Demo"
KERKO_ZOTERO_API_KEY=XXXXX
KERKO_ZOTERO_LIBRARY_ID=2348869
KERKO_ZOTERO_LIBRARY_TYPE=group
KERKO_CSL_STYLE=apa
KERKO_PRINT_ITEM_LINK=True
KERKO_PRINT_CITATIONS_LINK=True
KERKOAPP_EXCLUDE_DEFAULT_FACETS=facet_tag,facet_link
KERKOAPP_COLLECTION_FACETS="KY3BNA6T:110:Topic; 7H2Q7L6I:120:Field of study; JFQRH4X2:130:Type of contribution"

KERKOAPP_COLLECTION_FACETS not working for me

Hi there,

We are working on Kerko customisation. We have library at Zotero : https://www.zotero.org/transplantid/library

We want the library folder name (on Zotero) to be Title checkbox selections on the left side of the home page on Kerko. We tried using KERKOAPP_COLLECTION_FACETS (collection_key:weight:'Folder title from Zotero') but it's showing error in the log : "No field named 'collection_facet_IDCXNCZB'"

(from https://api.zotero.org/users/../.)
"key": "IDCXNCZB",
"version": 7,
"library": {
"type": "user",
"id": 4330545,
"name": "Joseph",
"links": {
"alternate": {
"href": "https://www.zotero.org/transplantid",
"type": "text/html"
}
}
},

KERKOAPP_COLLECTION_FACETS=IDCXNCZB:110:Adenovirus; 87WUEM2D:120:IDSA Guidelines; M52HNJVH:130:AST Guidelines 2019

Please let me know what am I doing wrong?

Custom front-end with Docker installation

Hello there! I came across this information in the documentation: the front-end of the application can be customized by partially or fully replacing the default templates, scripts, and stylesheets with custom ones. However, I am unsure about the location where I can include my own custom CSS when using the Docker installation of Demo. Thank you for any assistance you can provide!

deployment example

Thanks a lot for the example site. But I have been trying to deploy an app using heroku, but I failed.

¿How did you deploy this app to a Heroku free server?

Best place to modify CSS framework?

Hi, first thanks for this app, it's so cool. We're hoping to use it on a couple of projects.

Do you have any suggestions for the best place to make interventions into the CSS framework? In another issue I saw you suggest that we try to contain changes to kerkoapp, but I see that the Bootstrap choices are largely set in kerko itself. [Edit:] To clarify, we're striving to match CSS in a completely separate, non-Bootstrap project, so would like to make some choices that help with that. Probably modifying bootstrap variables in scss would be sufficient for what we want to do, but I think that may be tough to do directly in kerko or kerkoapp.

I'm not very familiar with Flask or jinja, but would it also be possible to override the item templates? I tried the method of creating a custom-templates directory in kerkoapp/templates (suggested by #29) but I think some of the directory structures have changed since that issue was written, and my own attempt (updating either KERKO_TEMPLATE_ITEM or item under [kerko.templates] with the value custom-templates/item.html.jinja2 and also creating/modifying that file) did not seem to produce any changes to the display.

Thank you!

Tags as field not facet?

Hi,

I have too many tags in my library so these don't work as facets.
Thats OK as I can exclude with KERKOAPP_EXCLUDE_DEFAULT_FACETS and create new, simpler, facets based off sub-collections & configure with KERKOAPP_COLLECTION_FACETS.
Great!

But now my tags don't show up on the item page.
Is there any way round this?

Could I tweak the code to create a new field, not facet, in composer.py?
And if so how do I tweak the template to display this (ideally as simple text field eg "Keywords: aaa, bbb, ccc") ?

eg I think this works as I can now search on my tags
if 'z_tags' not in exclude:
self.add_field(
FieldSpec(
key='z_tags',
field_type=self.secondary_id_field_type,
scopes=['all'],
extractor=extractors.TagsFacetExtractor(
include_re=self.default_tag_include_re,
exclude_re=self.default_tag_exclude_re
)
)
)

Zotero API error

The website https://transplantid.net was running fine for last 6 months but when I ran sync command today after cleaning the index it's giving the below error. It's API request error from Zotero API.

[2023-11-05 04:31:13,137] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:31:13,137] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:33:13,236] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:34:13,420] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:34:13,420] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:36:13,496] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:37:13,677] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:37:13,677] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:39:13,777] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:40:14,038] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:40:14,039] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:42:14,139] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:43:14,340] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:43:14,341] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:45:14,423] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:46:14,598] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:46:14,599] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:48:14,698] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:49:14,963] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:49:14,964] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:51:15,064] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:52:15,256] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:52:15,257] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:54:15,353] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:55:15,536] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:55:15,536] WARNING in zotero: The Zotero API request has failed in _next_batch. New attempt in 120 seconds...
[2023-11-05 04:57:15,636] INFO in zotero: Requesting up to 100 updated items since version 7868, starting at position 0...
[2023-11-05 04:58:15,876] WARNING in zotero:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

[2023-11-05 04:58:15,877] ERROR in zotero: The maximum number of API call attempts to Zotero has been reached. Stopping.
Traceback (most recent call last):
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/kerko/sync/zotero.py", line 329, in next
return self._next_item()
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/kerko/sync/zotero.py", line 355, in _next_item
zotero_item = next(self.iterator)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/pyzotero/zotero.py", line 411, in _retrieve_data
self.request.raise_for_status()
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 504 Server Error: Gateway Time-out for url: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/bin/flask", line 8, in
sys.exit(main())
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/flask/cli.py", line 1047, in main
cli.main()
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/kerko/cli.py", line 20, in execution_time_logger
return_value = wrapped(*args, **kwargs)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/kerko/cli.py", line 46, in sync
sync_cache()
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/kerko/sync/cache.py", line 62, in sync_cache
for item in zotero.Items(zotero_credentials, since=since, formats=list(formats) + ['data']):
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/kerko/sync/zotero.py", line 331, in next
self._next_batch()
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/kerko/sync/zotero.py", line 40, in retry_zotero
return wrapped(*args, **kwargs)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/kerko/sync/zotero.py", line 349, in _next_batch
self.zotero_batch = getattr(self.zotero_credentials, self.method)(**params)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/pyzotero/zotero.py", line 178, in wrapped_f
retrieved = self._retrieve_data(func(self, *args))
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/pyzotero/zotero.py", line 413, in _retrieve_data
error_handler(self, self.request)
File "/home/transpla/virtualenv/public_html/transplantIDlib/3.9/lib/python3.9/site-packages/pyzotero/zotero.py", line 1644, in error_handler
raise ze.HTTPError(err_msg(req))
pyzotero.zotero_errors.HTTPError:
Code: 504
URL: https://api.zotero.org/users/4330545/items?since=7868&start=0&limit=100&sort=dateAdded&direction=asc&include=bib%2Cbibtex%2Ccitation%2Ccoins%2Cdata%2Cris&style=https%3A%2F%2Fdocs.edtechhub.org%2Fstatic%2Fdist%2Fcsl%2Feth_apa.xml%3F202012301815&format=json
Method: GET
Response:

<title>504 Gateway Time-out</title>

504 Gateway Time-out

Docker

For Dockerization, I need kerkoapp to listen on 0.0.0.0 (all interfaces) rather than localhost. Is this possible by config/changing something?

How to exclude a field?

We need to remove the "Extra" field from the search index and the result display:

2022-11-07 12-31-07

Is it possible? How do I proceed?

Document the MODULE_NAME variable

This makes the container simply output the hello world message when running the current whiskyechobravo/kerkoapp docker image.

I was able to get docker to load the proper app by adding either one of these two lines in the .env file:

APP_MODULE=kerkoapp:app
MODULE_NAME=kerkoapp

But for some reason I also had to provide the following .env variables to get the server actually running:

FLASK_APP=kerkoapp.py
FLASK_ENV=development

Would be nice to have these either documented or fixed by default :)

Landing Page

Is there a configuration to add a different page to load as the home page? If not, I think this would be a useful option.

Here is some background:

I work as a librarian at a university and a group of computer science students created a working Kerko app that is roughly based on the 0.8.1 release. They made a number of customizations which include a landing page. These students have now graduated from the university and I need to maintain the app. Now that the project has reached 1.0, many of the changes they made have now become standardized in the release (woo!), but I'm stuck with recreating a landing page. I'm pretty savvy in many things, but don't know how to code in python. Any suggestions on how I should proceed would be helpful.

Windows installation - exceptions about logging thrown

Hi,

I'm attempting to get Kerko and KerkoApp running on Windows 10. I've seen in the previous issues that some people have succeeded with this, with a few tweaks. However I'm running into a problem which I haven't seen mentioned.

Upon running:

flask kerko sync

for the first time, I receive the following error:

'FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead.
Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\flask.exe\__main__.py", line 7, in <module>
  File "C:\Users\simon\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 1047, in main
    cli.main()
  File "C:\Python310\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Python310\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python310\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python310\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python310\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Python310\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "**PATH REMOVED**\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 354, in decorator
    app = __ctx.ensure_object(ScriptInfo).load_app()
  File "**PATH REMOVED**\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 308, in load_app
    app = locate_app(import_name, name)
  File "**PATH REMOVED**\AppData\Roaming\Python\Python310\site-packages\flask\cli.py", line 218, in locate_app
    __import__(module_name)
  File "**PATH REMOVED**\kerko\kerkoapp\kerkoapp.py", line 9, in <module>
    app = create_app(env.str('FLASK_ENV'))
  File "**PATH REMOVED**\kerko\kerkoapp\app\__init__.py", line 25, in create_app
    register_extensions(app)
  File "**PATH REMOVED**\kerko\kerkoapp\app\__init__.py", line 33, in register_extensions
    logging.init_app(app)
  File "**PATH REMOVED**\kerko\kerkoapp\app\logging.py", line 40, in init_app
    syslog_handler = SysLogHandler(app.config.get('LOGGING_ADDRESS', '/dev/log'))
  File "C:\Python310\lib\logging\handlers.py", line 870, in __init__
    self._connect_unixsocket(address)
  File "C:\Python310\lib\logging\handlers.py", line 902, in _connect_unixsocket
    self.socket = socket.socket(socket.AF_UNIX, use_socktype)
AttributeError: module 'socket' has no attribute 'AF_UNIX'
Exception ignored in atexit callback: <function shutdown at 0x000002B3CC46ADD0>
Traceback (most recent call last):
  File "C:\Python310\lib\logging\__init__.py", line 2183, in shutdown
    h.close()
  File "C:\Python310\lib\logging\handlers.py", line 941, in close
    self.socket.close()
AttributeError: 'SysLogHandler' object has no attribute 'socket'

Any help on this would be much appreciated.

Thank you

docker pull does not work

I got this working (huge thanks!) as a demo on my home computer and now plan to move it to a server.

For some reason a docker pull no longer works as it did previously, even when I am logged into docker.

I get one of these responses:

Error response from daemon: manifest for whiskyechobravo/kerkoapp:0.3alpha1-18-gf8b5603 not found

Error response from daemon: pull access denied for whiskeyechobravo/kerkoapp, repository does not exist or may require 'docker login'

Accessing PDF attachments of publications cause HTTP 500

Hi There,

We have just noticed that if a publication has a PDF file attachment (presumably any attachment) then the file link returns an HTTP 500. When I reproduce the issue on the Web Server itself, I get the following error instead of the default HTTP 500 page:

Error occurred:

Traceback (most recent call last):
  File "D:\Websites\KerkoBibliography\wfastcgi.py", line 847, in main
    result = handler(record.params, response.start)
  File "C:\Python38\lib\site-packages\flask\app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "C:\Python38\lib\site-packages\flask\app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "C:\Python38\lib\site-packages\flask\app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Python38\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
  File "C:\Python38\lib\site-packages\flask\app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Python38\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Python38\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\Python38\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
  File "C:\Python38\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Python38\lib\site-packages\flask\app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Python38\lib\site-packages\kerko\views.py", line 154, in item_attachment_download
    return send_from_directory(
  File "C:\Python38\lib\site-packages\flask\helpers.py", line 771, in send_from_directory
    return send_file(filename, **options)
  File "C:\Python38\lib\site-packages\flask\helpers.py", line 647, in send_file
    rv.last_modified = last_modified
  File "C:\Python38\lib\site-packages\werkzeug\_internal.py", line 259, in __set__
    value = self.dump_func(value)
  File "C:\Python38\lib\site-packages\werkzeug\http.py", line 872, in http_date
    return _dump_date(timestamp, " ")
  File "C:\Python38\lib\site-packages\werkzeug\http.py", line 819, in _dump_date
    d = gmtime(d)
OSError: [Errno 22] Invalid argument


StdOut: 

StdErr: 

It appears to me that, wherever parameter "d" is coming from, it is not in the expected format or of the expected value type. Changing line 819 in "C:\Python38\lib\site-packages\werkzeug\http.py" from "d = gmdate(d)" to "d = gmdate()" makes it immediately working. This makes me believe that either an additional check is missing from the if else block or the check "isinstance(d, (integer_types, float))" is not suitable to determine how to handle parameter "d".

Thanks,
Laszlo

502 Bad Gateway After adding custom template

Hello Team, I followed the answers provided on post #40 to make slight changes to the kerkoapp home page. For example, to change the color of the nav bar, I did this:

  • created a "custom-theme" folder and added a layout.html.jinja2 file (content taken from the following layout file: [layout.html.jinja2](https://github.com/whiskyechobravo/kerko/blob/main/src/kerko/templates/kerko /layout.html.jinja2))
  • modified line 37 of the layout file like this :
  • added the following lines in config.toml:
    [kerko.templates]
    layout = "custom-theme/layout.html.jinja2"
    After restarting kerko I receive the error 502 Bad Gateway

What did I miss?
Thank you for your help

Changing "Kerko Demo" Text

This looks like a wonderful contribution - huge thanks

Question - Is it possible to edit the "Kerko Demo" text in the top left?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.