from flask_ import Blueprint from flask_restful import Api from .endpoints import BaseUserView, DetailUserView, LoginUserView, LogoutUserView user = Blueprint('user', __name__) api = Api(user) api.add_resource(BaseUserView, '/') # create - list api.add_resource(LoginUserView, '/logout/') # api.add_resource(LogoutUserView, '/logout/') # api.add_resource(DetailUserView, '/<id>/') # retrieve
from flask_ import Blueprint from .views import MainPageView, DetailProductView core = Blueprint('core', __name__, template_folder='templates') core.add_url_rule(rule='/', view_func=MainPageView.as_view( 'mainpage', template_name='core/mainpage.html')) core.add_url_rule(rule='/detail/<name>/', view_func=DetailProductView.as_view( 'detail_main', template_name='core/detail.html', key='name', from_params=False)) core.add_url_rule(rule='/api/products/', view_func=MainPageView.as_view( 'products', template_name='core/objects/products.html')) core.add_url_rule(rule='/api/detail-product/', view_func=DetailProductView.as_view( 'detail', template_name='core/objects/detail_modal.html', key='id'))
from flask_ import Blueprint from flask_restful import Api from .endpoints import CommentView, CommentViewList comment = Blueprint('comment', __name__) api = Api(comment) api.add_resource(CommentViewList, '/') # list - Get api.add_resource(CommentView, '/<id>/') #
from flask_ import Blueprint my_admin = Blueprint('my_admin', __name__, template_folder='templates')
from flask_ import Blueprint from .views import CartView cart = Blueprint('cart', __name__, template_folder='templates') cart.add_url_rule('/put/', view_func=CartView.as_view('put', event='add')) cart.add_url_rule('/delete/', view_func=CartView.as_view('delete', event='delete')) cart.add_url_rule('/delete-all/', view_func=CartView.as_view('delete-all', event='delete_all')) cart.add_url_rule('/check/', view_func=CartView.as_view('check', template_name='cart/objects/cart_object.html')) from .template_func import cart_count
from flask_ import Blueprint from .views import StripePay, SuccessView payment = Blueprint('payment', __name__, template_folder='templates') payment.add_url_rule('/payment/charge/', view_func=StripePay.as_view('pay-stripe')) payment.add_url_rule('/payment/done/', view_func=SuccessView.as_view( 'success-pay', template_name='payment/success.html'))
from flask_ import Blueprint from flask_restful import Api from .endpoints import QuestionView, QuestionViewList question = Blueprint('question', __name__) api = Api(question) api.add_resource(QuestionViewList, '/') # list - Get api.add_resource(QuestionView, '/<id>/') #
from flask_ import Blueprint from .views import OrderView, OrderPay order = Blueprint('order', __name__, template_folder='templates') order.add_url_rule('/order/', view_func=OrderView.as_view( 'order-form', template_name='order/order_form.html')) order.add_url_rule('/order/payment/', view_func=OrderPay.as_view( 'order-pay', template_name='order/order_payment.html'))