Python Forum
AttributeError: 'ellipsis' object has no attribute 'register_blueprint'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AttributeError: 'ellipsis' object has no attribute 'register_blueprint'
#1
_init__.py", line 42, in create_app
app.register_blueprint(auth.bp)
I have initialized the database and everything made all the html files but it gives me this error!I run the site from the terminal and from pycharm.
this is my init file
import os

from flask import Flask


def create_app(test_config=None):
    """ Application factory function """
    # create and configure the app
    app = Flask(__name__, instance_relative_config=True)
    app.config.from_mapping(
        SECRET_KEY='dev',
        DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
    )

    if test_config is None:
        # load the instance config, if it exists, when not testing
        app.config.from_pyfile('config.py', silent=True)
    else:
        # load the test config if passed in
        app.config.from_mapping(test_config)

    # ensure the instance folder exists
    try:
        os.makedirs(app.instance_path)
    except OSError:
        pass

    # a simple page that says hello
    @app.route('/hello')
    def hello():
        return 'Hello, World! Now We are Introducing Mr. Narendra Singh Parihar.THE BOSS !!'

    from . import db
    db.init_app(app)

    return app
def create_app():
    app = ...
    # existing code omitted

    from . import auth
    app.register_blueprint(auth.bp)

    return app
whats wrong with it?It tells me that the error happens in the init file i have initialised the database and such.
Reply
#2
please post the original, unmodified and complete error traceback. It contains valuable information leading up to the error.
Reply
#3
(Dec-29-2021, 01:18 AM)Larz60+ Wrote: please post the original, unmodified and complete error traceback. It contains valuable information leading up to the error.
Error:
File "/home/myusername/.local/bin/flask", line 8, in <module> sys.exit(main()) File "/home/myusername//.local/lib/python3.8/site-packages/flask/cli.py", line 994, in main cli.main(args=sys.argv[1:]) File "/home/myusername/.local/lib/python3.8/site-packages/flask/cli.py", line 600, in main return super().main(*args, **kwargs) File "/home/myusername/.local/lib/python3.8/site-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/home/myusername/.local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/myusername/.local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/myusername/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/home/myusername/.local/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/home/myusername/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/home/myusername.local/lib/python3.8/site-packages/flask/cli.py", line 849, in run_command app = DispatchingApp(info.load_app, use_eager_loading=eager_loading) File "/home/myusername/.local/lib/python3.8/site-packages/flask/cli.py", line 324, in __init__ self._load_unlocked() File "/home/myusername.local/lib/python3.8/site-packages/flask/cli.py", line 350, in _load_unlocked self._app = rv = self.loader() File "/home/myusername/.local/lib/python3.8/site-packages/flask/cli.py", line 406, in load_app app = locate_app(self, import_name, name) File "/home/myusername/.local/lib/python3.8/site-packages/flask/cli.py", line 276, in locate_app return find_best_app(script_info, module) File "/home/myusername/.local/lib/python3.8/site-packages/flask/cli.py", line 68, in find_best_app app = call_factory(script_info, app_factory) File "/home/myusername/.local/lib/python3.8/site-packages/flask/cli.py", line 123, in call_factory return app_factory(*args, **kwargs) File "/home/myusername/flaskr/__init__.py", line 42, in create_app app.register_blueprint(auth.bp) AttributeError: 'ellipsis' object has no attribute 'register_blueprint
Larz60+ write Dec-29-2021, 12:08 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to fix "'dict_values' object has no attribute 'inject_wsgi'" in session_transacti devid 0 1,177 Aug-13-2023, 07:52 AM
Last Post: devid
  AttributeError: 'NoneType' object in a parser - stops it apollo 4 4,023 May-28-2021, 02:13 PM
Last Post: Daring_T
  AttributeError: ResultSet object has no attribute 'get_text' KatMac 1 4,384 May-07-2021, 05:32 PM
Last Post: snippsat
  Python 3.9 : BeautifulSoup: 'NoneType' object has no attribute 'text' fudgemasterultra 1 8,907 Mar-03-2021, 09:40 AM
Last Post: Larz60+
  'NavigableString' object has no attribute 'h2' RandomCoder 5 5,396 May-20-2020, 09:01 AM
Last Post: Larz60+
  AttributeError: 'str' object has no attribute 'xpath' nazmulfinance 4 10,475 Nov-11-2019, 05:15 PM
Last Post: nazmulfinance
  AttributeError: 'str' object has no attribute 'xpath' nazmulfinance 0 3,057 Nov-10-2019, 09:13 PM
Last Post: nazmulfinance
  form.populate_obj problem "object has no attribute translate" pascale 0 3,651 Jun-12-2019, 07:30 PM
Last Post: pascale
  Error object has no attribute text hcyeap 3 13,908 May-21-2019, 07:12 AM
Last Post: buran
  AttributeError: 'Response' object has no attribute 'replace' Truman 12 23,379 Mar-20-2019, 12:59 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020