How To Have Django Packages in Flask


web development

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.

What the fuss about django packages?

Shopyo allows you to use apps in your project. Shopyo apps are in the format

demo/
├── forms.py
├── global.py
├── info.json
├── models.py
├── static
├── templates
│   └── demo
│       ├── blocks
│       │   └── sidebar.html
│       └── dashboard.html
├── tests
│   ├── test_demo_functional.py
│   └── test_demo_models.py
└── view.py

Until now, shopyo apps could not be installed but used locally. Now, the project has been updated to allow it! You can examine shopyo-demo the first shopyo app to get a feel of what it’s like. Yes, you even have a sandbox to test the app, just like Django apps.

What to change from older projects?

init.py has a new variable called installed_packages which should contain the installed app you want to add.

Then, nothing to change really, just imports and in info.json make sure to set module name as shopyo_<your module name> Conclusion


Having such a system for Flask is very convenient instead of having to build components from scratch time and again. Sites like djangopackages.com are very useful to find what we need real quick.

Written by

Abdur-Rahmaan Janhangeer

Chef

Python author of 7+ years having worked for Python companies around the world

Suggested Posts

Why Choose Flask Over FastAPI

FastAPI positions itself as one of the best choices for API development in Python. The project is po...

Read article

An Advanced Flask App: Shopyo

Shopyo is an Open Source Flask-based, Python-powered inventory solution and upcoming point of sales...

Read article

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 s...

Read article
Free Flask Course