ckEditor works well on local host but not on pythonanywhere

39 views
Skip to first unread message

Maurice Waka

unread,
Jun 5, 2021, 6:58:26 AM6/5/21
to web2py-users
I have this code that works well on localhost.

from plugin_ckeditor import CKEditor
ckeditor.define_tables()
track_changes(True)

db = DAL( "postgres://mauricewaka:b3t1232a##@localhost:5432/wakadb")#, migrate=False)

auth = Auth(db, hmac_key=Auth.get_or_create_key())
auth.define_tables(username=True, signature=False)
crud, service, plugins = Crud(db), Service(), PluginManager()
current.db = db
current.auth = auth

def widget(**kwargs):
    return lambda field, value, kwargs=kwargs: SQLFORM.widgets[field.type].widget(field, value, **kwargs)

db.define_table( "books",
                Field('name', 'string'),
                Field('definitions', 'text', length= 1000000, default="We'll update soon.", notnull=True, widget=ckeditor.widget, represent=lambda content, row: XML(content, sanitize=True)),
                #Field('definitions', 'text', length= 1000000, default="We'll update soon.", notnull=True), #Field is available for edit/posting data
                )

When I try the app on 'pythonanywhere.com' the fields are hidden from the user and cant edit. When I remove the widget, then the fields is available. Obviously there is an issue with ckEditor. The version I used is ckEditor4.
What could be the issue?

Maurice Waka

unread,
Jun 7, 2021, 3:54:19 AM6/7/21
to web2py-users
I noted that it was a browser compatibility issue.
Works well on chrome but not on opera.
Regards

Reply all
Reply to author
Forward
0 new messages