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=
Traceback (most recent call last):
  File "/home/aalam/Flask_Blog/venv/bin/flask", line 8, in <module>
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/", line 1047, in main
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/", 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/", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/click/", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/", line 911, in run_command
    raise e from None
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/", line 897, in run_command
    app = info.load_app()
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/", line 308, in load_app
    app = locate_app(import_name, name)
  File "/home/aalam/Flask_Blog/venv/lib/python3.10/site-packages/flask/", line 218, in locate_app
  File "/home/aalam/Flask_Blog/", line 1, in <module>
    from flaskblog import create_app
  File "/home/aalam/Flask_Blog/flaskblog/", line 6, in <module>
    from flaskblog.config import Config
  File "/home/aalam/Flask_Blog/flaskblog/", 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.
Updated 6-Feb-23 9:41am
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 --,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