can’t running flask authentification

I try to implement an authentification app with python, SQLAlchemy and Flask. I found But after I defined set FLASK_APP=project and set FLASK_DEBUG=1, i tried to run my app with flask run, i get the error :

Error: Could not locate a Flask application. You did not provide the "FLASK_APP" environment variable, and a "" or "" module was not 
found in the current directory. :

from flask import Blueprint

main = Blueprint('main', __name__)

def index():
    return 'Index'

def profile():
    return 'Profile' :

from flask import Blueprint
#from . import db

auth = Blueprint('auth', __name__)

def login():
    return 'Login'

def signup():
    return 'Signup'

def logout():
    return 'Logout' :

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

# init SQLAlchemy so we can use it later in our models
db = SQLAlchemy()

def create_app():
    app = Flask(__name__)

    app.config['SECRET_KEY'] = 'secret-key-goes-here'
    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite'


    # blueprint for auth routes in our app
    from auth import auth as auth_blueprint

    # blueprint for non-auth parts of app
    from app import main as main_blueprint

    return app

i exactly following the tuto and i use a venv Have you an idea ?


You can follow these steps for installation (Linux):

create a new folder and goyour folder path :

$ mkdir myproject 
$ cd myproject

install virtualenvironment and create a new virtualenvironment named venv :

$ pip install virtualenv
$ virtualenv venv

activate your venv :

$ source venv/bin/activate

And now install Flask!

$ pip install Flask

If you done, create a new python file named in your directory:

from flask import Flask

app = Flask(__name__)

def hello_world():
    return "<p>Hello, World!</p>"

If you use an editor like pycharm, open editor’s terminal or your local terminal and write code below:

$ export FLASK_APP=proj
$ export FLASK_ENV=development
$ flask run


$ flask run --host=

And in debug mode you can code like this:

from flask import Flask

app = Flask(__name__)

def hello_world():
    return "<p>Hello, World!</p>"

if __name__ == '__main__':'',port=8000,debug=True)

and run :