question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'module' object has no attribute 'TextField'

See original GitHub issue
Traceback (most recent call last):
  File "runserver.py", line 5, in <module>
    from portalapp import app
  File "/Users/myuser/myapp/__init__.py", line 4, in <module>
    from flask_ldap_login import LDAPLoginManager
  File "/Users/myuser/myapp/lib/python2.7/site-packages/flask_ldap_login/__init__.py", line 216, in <module>
    class LDAPLoginForm(wtf.Form):
  File "/Users/myuser/myapp/lib/python2.7/site-packages/flask_ldap_login/__init__.py", line 224, in LDAPLoginForm
    username = wtf.TextField('Username', validators=[wtf.Required()])
AttributeError: 'module' object has no attribute 'TextField'

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
srossrosscommented, Sep 24, 2014

@szilvesztercsab I’ve just released flask-ldap-login-0.3.0 with flask-wtf >= 0.8 fix included.

1reaction
tswicegoodcommented, Sep 24, 2014

0.10.2 is the latest release on PyPI – the docs are just out of date.

Looking at the upgrade doc, it looks as though the field imports are no longer supported:

Dropping the imports of wtforms is a big change, it may be lots of pain for you, but the imports are hard to maintain. Instead of importing Fields from Flask-WTF, you need to import them from the original wtforms

Looks like the code needs to change to be future-proof.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Django] AttributeError: 'module' object has no attribute ...
Let's try creating TextField in Django form by updating forms.py . This is because, there is no attribute as the TextField associated with...
Read more >
module 'django.db.models' has no attribute 'TextArea'
Model Have no attribute TextArea(). If you know the maximum length of text that can be entered using text area then you can...
Read more >
Django 3.2 AttributeError: 'TextField' object has no attribute ...
I've an existing project on Django 3.1 and I upgraded my project to Django 3.2. I created an app called payment on my...
Read more >
module 'django.db.models' has no attribute 'TextArea'
Model Have no attribute TextArea(). If you know the maximum length of text that can be entered using text area then you can...
Read more >
Form fields - Django documentation
Widgets of required form fields have the required HTML attribute. ... Raises AttributeError: 'NoneType' object has no attribute 'seek'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found