Is it possible to create Django Admin account with free plan?

The tutorial Getting Started with Django on Render | Render says that creation of a Django Admin account can be done with the Render Shell.
But the Render Shell is not available for free plan services.
Is there any other alternatives methods to create Django Admin account with free plan?

Hi there,

Thanks for reaching out.

You could probably workaround this by adding it to your build script to run the admin creation command:

python manage.py createsuperuser

To make sure it’s not run on every deploy, maybe wrap it in an env var check, maybe something like:

if [[-z $CREATE_SUPERUSER]]; then python manage.py createsuperuserfi

Set the env var CREATE_SUPERUSER, deploy to have the command run, then remove the CREATE_SUPERUSER env var, so it’s not run again.

Hope that helps

Alan

Thanks!

But how it is supposed to work if the createsuperuser command is interactive?

I’ve tried to add your snippet to my ‘build.sh’ script, but this just gives me this message in the logs:

Superuser creation skipped due to not running in a TTY. You can run `manage.py createsuperuser` in your project to create one manually.

Ah apologies, I’m not a Python/Django expert.

A quick search seemed to come up with a workaround: https://vuyisile.com/how-to-automate-creating-a-django-super-user/

Alan