I have a scenario where I need to dynamically create a table. To dynamically create the table, I wrote code to create the model.py file with the contents of the table I want to create.
As soon as this file is created, I want to execute the makemigrations command from the code itself, for example
from django.core.management import call_command
call_command('makemigrations')
call_command('migrate')
it works fine in my local as well as in the AWS EC2 instance, but it doesn't work in Elastic Beanstalk (eb). and when I try to run the makemigrations command manually from eb ssh, then it gives me the following error.
PermissionError: [Errno 13] Permission denied: '/opt/python/bundle/47/app/quotations/migrations/0036_dynamic_table.py'
Does anyone know how I can handle this situation.
Another thing is that when creating new dynamic models So, how can I push this code to git, since with a new deployment EBS will replace the existing code with new code, so in this way I will lose the files that I created in EBS using these teams
thanks
source
share