Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while registering a user from the panoramix UI #18

Closed
rohitkochar opened this issue Aug 31, 2015 · 7 comments
Closed

Error while registering a user from the panoramix UI #18

rohitkochar opened this issue Aug 31, 2015 · 7 comments

Comments

@rohitkochar
Copy link

I am trying to register a new user from the panoramix UI by clicking on the register button on the Login Menu but i am getting the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/views.py", line 107, in this_form_get
    appbuilder=self.appbuilder
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/baseviews.py", line 156, in render_template
    return render_template(template, dict(list(kwargs.items()) + list(self.extra_args.items())))
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 128, in render_template
    context, ctx.app)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 110, in _render
    rv = template.render(context)
  File "/usr/share/pyshared/jinja2/environment.py", line 894, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/general/model/edit.html", line 2, in top-level template code
    {% import 'appbuilder/general/lib.html' as lib %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/base.html", line 1, in top-level template code
    {% extends base_template %}
  File "/home/sandeeps/panoramix/app/templates/panoramix/base.html", line 1, in top-level template code
    {% extends "appbuilder/baselayout.html" %}
  File "/home/sandeeps/panoramix/app/templates/appbuilder/baselayout.html", line 2, in top-level template code
    {% import 'appbuilder/baselib.html' as baselib %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/init.html", line 46, in top-level template code
    {% block body %}
  File "/home/sandeeps/panoramix/app/templates/appbuilder/baselayout.html", line 19, in block "body"
    {% block content %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/general/model/edit.html", line 23, in block "content"
    {% block edit_form %}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/general/model/edit.html", line 25, in block "edit_form"
    {{ widgets.get('edit')(form_action=form_action)|safe }}
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/widgets.py", line 34, in __call__
    return template.render(args)
  File "/usr/share/pyshared/jinja2/environment.py", line 894, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/general/widgets/form.html", line 40, in top-level template code
    <tr>{{ lib.render_field(field, begin_sep_label, end_sep_label, begin_sep_field, end_sep_field) }}</tr>
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/templates/appbuilder/general/lib.html", line 203, in template
    {{ field(**kwargs)|safe }}
  File "/usr/local/lib/python2.7/dist-packages/wtforms/fields/core.py", line 149, in __call__
    return self.meta.render_field(self, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/wtforms/meta.py", line 53, in render_field
    return field.widget(field, **render_kw)
  File "/usr/local/lib/python2.7/dist-packages/flask_wtf/recaptcha/widgets.py", line 40, in __call__
    raise RuntimeError("RECAPTCHA_PUBLIC_KEY config not set")
**RuntimeError: RECAPTCHA_PUBLIC_KEY config not set

I have checked out the latest code from the github and followed the steps mentioned in ReadMe file for server installation.

**Is it possible to disable authentication and also configure the druid endpoint in the config file instead of creating a admin role and than adding details there?

@rohitkochar
Copy link
Author

Here is my config.py file:

import os
from flask_appbuilder.security.manager import AUTH_OID, AUTH_REMOTE_USER, AUTH_DB, AUTH_LDAP, AUTH_OAUTH
basedir = os.path.abspath(os.path.dirname(__file__))

"""
All configuration in this file can be overridden by providing a local_config
in your PYTHONPATH.

There' a ``from local_config import *`` at the end of this file.
"""

ROW_LIMIT = 5000
WEBSERVER_THREADS = 8

PANORAMIX_WEBSERVER_PORT = 8088

SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'


SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')

CSRF_ENABLED = True

#Whether to run the web server in debug mode or not
DEBUG = True

APP_NAME = "Panoramix"

APP_ICON = "/static/chaudron_white.png"

AUTH_TYPE = AUTH_DB

AUTH_ROLE_ADMIN = 'Admin'
AUTH_ROLE_PUBLIC = 'Public'

AUTH_USER_REGISTRATION = True

AUTH_USER_REGISTRATION_ROLE = "Admin"

BABEL_DEFAULT_LOCALE = 'en'
BABEL_DEFAULT_FOLDER = 'translations'

LANGUAGES = {
    'en': {'flag':'us', 'name':'English'},
    'fr': {'flag':'fr', 'name':'French'},
}
"""
'pt': {'flag':'pt', 'name':'Portuguese'},
'pt_BR': {'flag':'br', 'name': 'Pt Brazil'},
'es': {'flag':'es', 'name':'Spanish'},
'de': {'flag':'de', 'name':'German'},
'zh': {'flag':'cn', 'name':'Chinese'},
'ru': {'flag':'ru', 'name':'Russian'}
"""
UPLOAD_FOLDER = basedir + '/app/static/uploads/'

IMG_UPLOAD_FOLDER = basedir + '/app/static/uploads/'

IMG_UPLOAD_URL = '/static/uploads/'

try:
    from local_config import *
except:
    pass

@mistercrunch
Copy link
Member

I tried to recreate your issue by upgrading to the latest version of Flask App Admin and wasn't able to.

Panoramix uses "Flask App Builder" for everything around authentication / permissions. Dropping in a "local_config.py" allows you to override the default config.py configuration. Please refer to the Flask App Builder docs for more info.
http://flask-appbuilder.readthedocs.org/en/latest/user_registration.html

@rohitkochar
Copy link
Author

Thanks for your help,the documentation really helped.
My setup was missing the RECAPTCHA keys,generated and added them.
Also created the admin user via the "fabmanager" command.

@mistercrunch
Copy link
Member

I'm not sure why I haven't hit the RECAPTCHA bug on my side... How are you creating the users?

@rohitkochar
Copy link
Author

I was trying to register user via the UI i.e by clicking on the Login tab on the right most corner and than clicking Register button.
After clicking the 'Register' the screen that pop ups for recording user credentials also have a RECAPTCHA verification and hence it need those RECAPTCHA keys.

My authentication type is AUTH_DB and i have default role for self registeration set to "Admin" i.e AUTH_USER_REGISTRATION_ROLE = "Admin"

@mistercrunch
Copy link
Member

Oh interesting. With the vanilla settings I've been using the Menu -> Security -> List Users and then clicking the + button to create users. I'm new to "Flask App Builder" though I'm coming from Django and Flask-Admin and I'm very happy with the design decisions behind "Flask App Builder". It seems like I can build a generic app and let the users define their authentication scheme.

@mistercrunch
Copy link
Member

This should be fixed in the current version

john-bodley pushed a commit to john-bodley/superset that referenced this issue Mar 7, 2018
graceguo-supercat pushed a commit to graceguo-supercat/superset that referenced this issue Oct 4, 2021
zhaoyongjie pushed a commit that referenced this issue Nov 24, 2021
zhaoyongjie pushed a commit that referenced this issue Nov 25, 2021
zhaoyongjie pushed a commit that referenced this issue Nov 26, 2021
rguerraZero pushed a commit to rguerraZero/superset that referenced this issue Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants