Answer the question
In order to leave comments, you need to log in
How to login to shell inside Flask project?
How can I login to a shell in a flask so that dependencies from the environment and modules from the project are available so that I can send requests to the ORM like "python manage.py shell" in Django?
Answer the question
In order to leave comments, you need to log in
You need to create a shell.py script, give the right to execute chmod +x shell.py.
#!/usr/bin/env python
import os
import readline
from pprint import pprint
from flask import *
from myapp import *
from utils import *
from db import *
from models import *
os.environ['PYTHONINSPECT'] = 'True'
then you can use the shell by running the script ./shell.py
Preconfigured interactive shell
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question