jake-walker / wtforms-hcaptcha Goto Github PK
View Code? Open in Web Editor NEWCustom WTForms field that handles hCaptcha display and validation.
License: GNU General Public License v3.0
Custom WTForms field that handles hCaptcha display and validation.
License: GNU General Public License v3.0
Hi!
How do u send user's ip who post form? Thank you
form:
class ExtendedLoginForm(FlaskForm):
"""
Login form
"""
username = StringField('Имя пользователя', [DataRequired(message='Required field'),
Length(min=4, max=25, message='Ur name must be in from 4 to 25 symbols')])
password = PasswordField('Пароль',
[Length(min=8, max=25, message='Login or password incorrect'),
DataRequired(message='Required field')])
captcha = HcaptchaField(site_key=Config.HCAPTCHA_SITE_KEY, secret_key=Config.HCAPTCHA_SECRET_KEY)
remember = BooleanField('Запомнить меня', default=True)
View:
....
@anonymous_user_required
@auth_bp.post('/login')
def login():
login_form = ExtendedLoginForm()
register_form = ExtendedRegisterForm()
....
Traceback from docker log
Traceback (most recent call last):
mmt | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 136, in handle
mmt | self.handle_request(listener, req, client, addr)
mmt | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 179, in handle_request
mmt | respiter = self.wsgi(environ, resp.start_response)
mmt | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2088, in __call__
mmt | return self.wsgi_app(environ, start_response)
mmt | File "/usr/local/lib/python3.8/site-packages/werkzeug/middleware/proxy_fix.py", line 187, in __call__
mmt | return self.app(environ, start_response)
mmt | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
mmt | response = self.handle_exception(e)
mmt | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app
mmt | response = self.full_dispatch_request()
mmt | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request
mmt | rv = self.handle_user_exception(e)
mmt | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
mmt | rv = self.dispatch_request()
mmt | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
mmt | return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
mmt | File "/var/mmt/auth/routes.py", line 68, in login
mmt | login_form = ExtendedLoginForm()
mmt | File "/usr/local/lib/python3.8/site-packages/wtforms/form.py", line 208, in __call__
mmt | return type.__call__(cls, *args, **kwargs)
mmt | File "/usr/local/lib/python3.8/site-packages/flask_wtf/form.py", line 87, in __init__
mmt | super().__init__(formdata=formdata, **kwargs)
mmt | File "/usr/local/lib/python3.8/site-packages/wtforms/form.py", line 274, in __init__
mmt | self.process(formdata, obj, data=data, **kwargs)
mmt | File "/usr/local/lib/python3.8/site-packages/wtforms/form.py", line 131, in process
mmt | field.process(formdata)
mmt | File "/usr/local/lib/python3.8/site-packages/wtforms_hcaptcha/fields.py", line 54, in process
mmt | raise ValueError("IP Address is required.")
mmt | ValueError: IP Address is required.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.