Code Monkey home page Code Monkey logo

python-movie's Issues

1

Traceback (most recent call last):
File "E:\python-movie-master\app\admin\forms.py", line 5, in
from app.models import Admin,Tag
File "E:\python-movie-master\app_init_.py", line 16, in
from app.admin import admin as admin_blueprint
File "E:\python-movie-master\app\admin_init_.py", line 6, in
import app.admin.views
File "E:\python-movie-master\app\admin\views.py", line 4, in
from app.admin.forms import LoginForm,TagForm,MovieForm,PreviewForm
File "E:\python-movie-master\app\admin\forms.py", line 6, in
tags = Tag.query.all()
File "E:\python-movie-master\venv\lib\site-packages\flask_sqlalchemy\model.py", line 31, in get
cls, session=cls.fsa.session() # type: ignore[arg-type]
File "E:\python-movie-master\venv\lib\site-packages\sqlalchemy\orm\scoping.py", line 217, in call
sess = self.registry()
File "E:\python-movie-master\venv\lib\site-packages\sqlalchemy\util_collections.py", line 640, in call
key = self.scopefunc()
File "E:\python-movie-master\venv\lib\site-packages\flask_sqlalchemy\session.py", line 102, in _app_ctx_id
return id(app_ctx._get_current_object()) # type: ignore[attr-defined]
File "E:\python-movie-master\venv\lib\site-packages\werkzeug\local.py", line 508, in _get_current_object
raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
想问下这个是为什么,是代码哪里有问题吗

看了代码我就呵呵了

app/home/views.py

@home.route("/")
def index():
    return render_template("home/index.html")

@home.route("/animation/")
def animation():
    return render_template("home/animation.html")

@home.route("/search/")
def search():
    return render_template("home/search.html")

@home.route("/play/")
def play():
    return render_template("home/play.html")

特么你全部都是静态文件拿来忽悠人的吧?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.