Thank you. Yes, but I didn’t use the render.yaml approach. Luckily, I could figure out how to create a superuser automatically from the build script. I could log in to the admin page and create new data. However, render clears the data I created after every auto deploy. It seems like the database instance I created on render doesn’t save the data.
Inside your web service, you can just click on ‘Shell’ in the left hand nav menu to get terminal access, and type ‘manage.py createsuperuser’. No need to create a super user in a build script. You can run migrations, collectstatic or anything else you want to in there will the full django environment up and running. It’s super convenient.
Render won’t clear the data if you’re using an external postgres database. If you’re using a sqlite dB on the service, then yes, it will get deleted and re-created every time you update or restart the service, since the local storage is ephemeral. You’d need to add a disk to the service and put the sqlite file on there otherwise.