Click here to Skip to main content
15,878,231 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
flask run --host=0.0.0.0
Traceback (most recent call last):
  File "/home/aalam/Flask_Blog/venv/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/cli.py", line 1047, in main
    cli.main()
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/cli.py", line 911, in run_command
    raise e from None
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/cli.py", line 897, in run_command
    app = info.load_app()
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/cli.py", line 308, in load_app
    app = locate_app(import_name, name)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/cli.py", line 218, in locate_app
    __import__(module_name)
  File "/home/aalam/Flask_Blog/run.py", line 1, in <module>
    from flaskblog import create_app
  File "/home/aalam/Flask_Blog/flaskblog/__init__.py", line 6, in <module>
    from flaskblog.config import Config
  File "/home/aalam/Flask_Blog/flaskblog/config.py", line 3
    SQLALCHEMY_DATABASE_URI = 'sqlite:///site.db'

IndentationError: unexpected indent

What I have tried:

I am trying to deploy my application on my server. When I run the application on my local machine it works. But when I try to deploy it on my server I get the above error.
Posted
Updated 6-Feb-23 9:41am
v3
Comments
Richard MacCutchan 6-Feb-23 9:34am    
Look at the last few messages, they tell you exactly what is wrong, and where.
Andre Oosthuizen 6-Feb-23 9:37am    
The error says the following - Unexpected indent - This line of code has more spaces at the beginning than the one before it, but the one before it does not begin a sub block. In a block, all lines of code must begin with the same string of whitespace. See this link to view a possible solution -- https://www.numpyninja.com/post/how-to-fix-indentation-error-in-python#:~:text=Errors%20due%20to%20indentation%20in%20Python%3A&text=You%20may%20encounter%20the%20following,the%20same%20string%20of%20whitespace.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900