shopyo

How To Have Django Packages in Flask

Django packages in Flask seems like a far-away dream, but shopyo 4.6.0 allows you to install Shopyo apps from pypi. What is Shopyo? Shopyo implements Django functionalities such as the admin panel etc by using existing Flask packages. But, it also implements Django-specifics like the collectstatic command, migrations, apps, even new concepts like boxes etc. …

How To Have Django Packages in Flask Read More »

Build A Note App In Flask As Fast As It Can Get (Using Shopyo)

Shopyo is a framework to get started with Flask really quick. It includes several libraries to get started by default. In this tutorial we will build a simple app to get started with. We used it for FlaskCon 2021 [site, codebase]. First steps The first step is to install the library. python3.9 -m venv venv …

Build A Note App In Flask As Fast As It Can Get (Using Shopyo) Read More »

How to implement beautiful notifications in Flask

Since you already know how to implement notifications, let’s see how to implement beautiful notifications in Flask. Using boostrap, we can do: # shopyoapi.html def notify(message, alert_type=”primary”): “”” Used with flash flash(notify(‘blabla’)) Parameters ———- message: str message to be displayed alert_type: str bootstrap class Returns ——- None “”” alert = “”” <div class=”shopyo-alert alert alert-{alert_type} …

How to implement beautiful notifications in Flask Read More »

How to correctly use the next parameter in login and logout in Flask

Here is a sample login and logout route taken from the shopyo web framework. You can learn here how is get_safe_redirect defined and why it is important @auth_blueprint.route(“/login”, methods=[“GET”, “POST”]) def login(): context = {} login_form = LoginForm() context[“form”] = login_form if login_form.validate_on_submit(): email = login_form.email.data password = login_form.password.data user = User.query.filter( func.lower(User.email) == func.lower(email) …

How to correctly use the next parameter in login and logout in Flask Read More »