Does Replit DB not work in production deployment?

Seems like it does not work - from replit import db returns None.

I created a web app in replit using flask and replit DB. Now I’ve been trying all day to deploy this web app without success.
I get this error from the logs tab:

Traceback (most recent call last): File "/home/runner/c535ac90-d901-4e81-824b-50af8dff6113/", line 16, in <module> db[username] = {"username": username, "password": new_password} TypeError: 'NoneType' object does not support item assignment.

Thank you for considering my request.

1 Like

Thanks for reporting, I’ve passed this along to the engineering team :+1:

1 Like

+1 to this request. Without this feature, replits that run just fine on will fail when packaged as deployments.

Yes… This isn’t mentioned at all in the documentation, and it led to some embarrassment as I tested production deployment on my project

Also running into this same issue: “TypeError: ‘NoneType’ object does not support item assignment”

1 Like

Hey everyone, we’re working on this – it is supported but the mechanism is slightly different. We’re working on an update to the library that will use the new mechanism. Should be out soon.


We pushed a fix on version 3.3.0 of the Python package. It should work fine on deployments now.

Please let us know if you run into any issues.

1 Like

This still isn’t working for me. My deployments fail with the following error msg:

“error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on and a staff member will take a look.”

I double checked that I’m using the 3.3.0 python package. And when I comment out my replit db code, it deploys just fine.

Can you try deploying again? Also, do you see any errors in the Logs page?

1 Like