Providing initial data for Django App on Koyeb

Hello. I’d like to migrate my Django App from Heroku to Koyeb.

However, there was a problem in the process of putting pre-prepared initial data into the database of the Django App.

In Heroku, the initial data could be put into the DB with a single line of the command, heroku run python manage.py loaddata <fixturename> -a <APP_NAME>(How to provide initial data for models | Django documentation | Django).

But it doesn’t work the same way on Koyeb (maybe it’s a virtual environment problem).

If I have to activate Python’s virtual environment, I don’t know how to activate it in the Koyeb console.

Is there a way to execute Django’s loaddata command in Koyeb console?

In Koyeb, I don’t know how to provide the initial data for Django App.

Hi @jytorch :wave:

Can you run the following command to load and set the environment:

source .profile.d/python.sh

Then you should be able to properly exec ./manage.py and load your initial data.

Let me know if it solves the issue.

1 Like

python.sh does not run properly.

I think it’s probably because of the permission issue, what should I do?

Can you use bash instead of sh? It should fix your issue.

1 Like

Thank you, the virtual environment is well activated.

However, the process is interrupted while loading the initial data. (I searched, and I think it’s Out of Memory issue.)

Can’t I solve this problem?

Glad to hear that it worked!

About the new issue you are facing, changing your service instance size to a bigger one should solve the problem.

1 Like