Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Blueprint
- auth = Blueprint("auth", __name__)
- from . import views
- from app.auth import auth
- from app.models import *
- from manage import app
- @auth.route('/')
- def index():
- page = request.args.get("page", 1, type=int)
- articles = Article.query.order_by(Article.update_time.desc()).paginate(
- page, app.config["ARTICLES_PER_PAGE"], False)
- next_url = url_for('auth.index', page=articles.next_num if articles.has_next else None)
- prev_url = url_for('auth.index', page=articles.prev_num if articles.has_prev else None)
- return render_template('index.html', articles=articles.items,
- next_url=next_url, prev_url=prev_url)
- from flask import Blueprint
- main = Blueprint("main", __name__)
- from . import views
- from app.main import main
- from app.models import *
- from manage import app
- @main.route('/')
- def index():
- page = request.args.get("page", 1, type=int)
- articles = Article.query.order_by(Article.update_time.desc()).paginate(
- page, app.config["ARTICLES_PER_PAGE"], False)
- next_url = url_for('main.index', page=articles.next_num if articles.has_next else None)
- prev_url = url_for('main.index', page=articles.prev_num if articles.has_prev else None)
- return render_template('index.html', articles=articles.items,
- next_url=next_url, prev_url=prev_url)
- Traceback (most recent call last):
- File "C:/Users/bohn/Desktop/1pycharm workspace/BlogPoweredByFlask/manage.py", line 7, in <module>
- app = create_app()
- File "C:UsersbohnDesktop1pycharm workspaceBlogPoweredByFlaskapp__init__.py", line 30, in create_app
- from app.main import main
- File "C:UsersbohnDesktop1pycharm workspaceBlogPoweredByFlaskappmain__init__.py", line 5, in <module>
- from . import views
- File "C:UsersbohnDesktop1pycharm workspaceBlogPoweredByFlaskappmainviews.py", line 5, in <module>
- from manage import app
- File "C:UsersbohnDesktop1pycharm workspaceBlogPoweredByFlaskmanage.py", line 7, in <module>
- app = create_app()
- File "C:UsersbohnDesktop1pycharm workspaceBlogPoweredByFlaskapp__init__.py", line 33, in create_app
- from app.auth import auth
- File "C:UsersbohnDesktop1pycharm workspaceBlogPoweredByFlaskappauth__init__.py", line 5, in <module>
- from . import views
- File "C:UsersbohnDesktop1pycharm workspaceBlogPoweredByFlaskappauthviews.py", line 9, in <module>
- from manage import app
- ImportError: cannot import name 'app'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement