I’m currently building Remnants Blog on Django and exploring ICP deployment. Has anyone successfully containerized Django apps for canisters? Any best practices or gotchas?
do you mean the Python based REST framework Django? I doubt you will be able to port those 1:1 to ICP.
however, Demergent Labs (cc @lastmjs) is working on Kybra (Pyhton CDK for ICP). so maybe Jordan is able to comment on how feasible this will be in the future.
afaik, the development of Kybra is currently on hold because the team is fully focused on shipping Azle (TypeScript CDK for ICP) into production.
Ah, makes sense now!
Django on ICP sounds like a wild ride. Guess I’ll keep an eye on Kybra when it’s back and maybe get my hands dirty with Azle in the meantime.
@lastmjs, any insider tips for Python folks looking to sneak into the IC world early?
If you want to develop canisters using Python then use Kybra: GitHub - demergent-labs/kybra: Python CDK for the Internet Computer
Kybra focuses on the ICP APIs. You’ll have a good amount of the Python stdlib available, but nothing that uses the C extensions or C API.
Django should be possible but is probably not supported at the moment. It will take a lot of low-level API support to work.
Alright, this is gettin’ somewhere. Kybra looks promising, but I’m wondering — should I start experimenting with Kybra now to get comfortable with ICP’s APIs, or focus on Azle since it’s closer to production-ready?
Would love to hear your thoughts, @Marco and @lastmjs
it really depends on multiple factors I would say:
- how important is it to be production ready?
- Azle is not yet, but will hopefully be soon
- Kybra will probably take a while, but can be used and explored (I guess @lastmjs would be happy about any feedback)
- Rust and Motoko are
- which programming languages are you (already) proficient in?
- if you know Rust → go with Rust

- if you know Rust → go with Rust
- are you willing to learn a new programming language?
- Motoko might long-term be the best choice for ICP, specifically because of orthogonal persistence
you also need to differentiate between backend development and integration in clients (cli, frontend, …)
for the latter one you already have many options, including a python agent which is currently being updated again after it was unmaintained for a while. v2.0.0 has just recently been announced (it will probably be released under a new package name though)
for backend development see the overview of CDKs and for interacting with canisters from different clients, see overview of Agents.
Thanks for laying this out so clearly — really appreciate the insight! ![]()
Right now, I’m not aiming for full production readiness yet, but I do want a foundation that can scale later without needing a full rewrite.Language background: I’m strongest in Python, so Kybra naturally caught my attention. I’m curious to see how far I can push it and will happily share feedback as I explore.That said, I’m also watching what’s happening around Motoko — its orthogonal persistence sounds like a big long-term win for ICP-native apps.I also noticed the recent update around the Python agent v2.0.0
. Sounds like it could open up some cool possibilities for client-side integrations. Given all this, do you think it makes sense to prototype in Kybra for now while staying ready to transition deeper into Motoko once things mature?
Prototyping in Kybra I think makes a lot of sense. You are already most familiar with Python, and you don’t need production-readiness just yet. I think many apps (most?) aren’t even going to need to be production-ready because they won’t hit product-market fit (unfortunately). So prototyping with the least-friction CDK sounds great.
Kybra is a bit behind on some of ICP’s APIs, so if you run into a blocker just let me know. Especially with the AI tools available now, and because Kybra is in beta, I’m hoping anything missing would be pretty trivial to add quickly.
When deciding which CDK to use, I think deciding on which language ecosystem you want to be a part of makes a lot of sense. If you know and love Python, go with Kybra. If you know and love TypeScript/JavaScript, go with Azle.
If you need the most robust, safe, secure, low-memory solution possible, maybe go with Rust.
Azle will be production-ready soon, not sure on Kybra’s timeline. Rust and Motoko are production-ready now.
But seriously, don’t try to over-optimize. Just to keep it real, most apps will never succeed anyway, so why try to over-optimize on infrastructure now? Just build something useful and get traction, you can upgrade later if necessary.
Also I can give you one-on-one help with Kybra if you need it, depending on your app. DM me if interested, I love to do introductory calls or whatever you need to get setup.
Thanks a ton for this, Jordan
— really appreciate the insight and your openness to help.
I’ll stick with Kybra for prototyping LogHub since Python’s my comfort zone. It’s good to know I can iterate fast without worrying about full production readiness yet.
I might take you up on that intro call once I hit the first deployment milestone — could really use some guidance on best practices and avoiding early pitfalls
You can’t deploy a full Django app directly inside a canister (since canisters aren’t like Docker/VMs), but you can integrate Django with ICP. The common approach is:
-
Keep Django for frontend/API work.
-
Use the Python agent (ic-py v2.0.0) to talk to canisters.
-
If you want Django-style canisters, try Kybra (Python CDK).
That way you can prototype fast in Python and later move critical logic to Motoko or Rust when you need production stability.
That’s super helpful, thanks!
I’ve been experimenting with Kybra recently to see how Python can fit into the ICP ecosystem.Quick question though — if we’re using Kybra for prototyping, does deploying via something like ICP Ninja make sense for now, or would you still recommend setting up canisters directly?
ICP Ninja is great for quick prototyping — once you need more control, just switch over to dfx.
By the way, I was experimenting with ICP Ninja myself recently — tried spinning up a prototype and ran into a 404. I shared it in another thread, but since Ninja came up here, figured it’s worth mentioning in case others have seen similar issues.
I am interested in deploying python code to canisters – including django apps, but first smaller apps.
I am concerned though about the status of Kybra, since last commit seems to be about 9 months ago. Is it still under active development?
He moved on, not sure if Demergent Labs is even operational at this point, no more grants so Kybra is stuck in beta.
Thank you for pointing that out. I had not seen it.
Ok, lets think about how to proceed. This is a bummer, I really liked Kybra and it’s promise.
As @ZackDS correctly pointed out, there is currently no active development on Kybra.
We also have the production release of Azle still pending and there is currently no clear answer on when this will happen.
Personally I would prefer moving Azle over the finish line before even thinking about picking up work on Kybra again.
But at this point it is also unclear who would continue to maintain Azle, which is also one of the reasons it is currently kind of stuck in its state.