Skip to content Skip to sidebar Skip to footer

Flask Error: Attributeerror: 'nonetype' Object Has No Attribute 'startswith'

Attempting to fork this flask project with bootstrap and getting it up and running. I've followed the guide to the end on how to set it up, but I receive this error: File 'run.py'

Solution 1:

You get the error because there is no FLASK_APPLICATION_SETTINGS environment variable.

See the configuration step in the readme:

  • If you're using the Makefile, be sure to set your config filename
  • Otherwise, you can either:
    • pass your config file using python manage.py -c config/yourconfig.cfg runserver or else
    • set an environmental variable FLASK_APPLICATION_SETTINGS to point to your config file
  • Check to be sure your SECRET_KEY config setting is indeed secret and cryptographically strong (120+ bits of entropy)
  • The Makefile command make create_cfg sets this SECRET_KEY automatically as part of the config creation

Solution 2:

Got it to work this way:

From the virtualenv, run make in terminal, after this make create_cfg. Then make run starts the server and it runs as it's supposed to.

Post a Comment for "Flask Error: Attributeerror: 'nonetype' Object Has No Attribute 'startswith'"