Help on Creating a Superuser account on render.

115 views
Skip to first unread message

ALINDA Fortunate

unread,
Apr 6, 2024, 12:28:00 PM4/6/24
to django...@googlegroups.com
Hello I have successfully a django project on render but i have failed to access the admin panel 

Any idea on how to create a superuser account on a free tier of render

Below is my build.sh file
#!/usr/bin/env bash
# Exit on error
set -o errexit



# Modify this line as needed for your package manager (pip, poetry, etc.)
pip install -r requirements.txt

# Convert static asset files
python manage.py collectstatic --no-input

# Apply any outstanding database migrations
python manage.py migrate

if [[ $CREATE_SUPERUSER ]];
then
  python world_champ_2022/manage.py createsuperuser --no-input
fi






--
ALINDA Fortunate
Graduate Of Computer Science
Gulu University
Passionate about Software Development in Python
If you can't explain it simply, you don't understand it well enough.
Kagadi.

Aniket Raj Singh

unread,
Apr 6, 2024, 1:34:06 PM4/6/24
to Django users
So you have used render to host your application, you might have connected an external database (postgreSQL or any other) you might have used the environment setup to set the database up with the postgreSQL hosted either on render itself or on a different server, just connect the database with your application on your local host and create a super user since the database is same on the render's server's application the superuser will be same as the superuser you created on the local server thus you can access the admin panel

ALINDA Fortunate

unread,
Apr 7, 2024, 4:13:44 AM4/7/24
to django...@googlegroups.com
It's my external database is postgres on railway. 

Let me try your opinion and I see.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9dabff6a-7f5a-4d30-a097-a128f68a6feen%40googlegroups.com.

Luis Zárate

unread,
Apr 10, 2024, 12:59:19 PM4/10/24
to django...@googlegroups.com
Maybe something like

python manage.py shell -c "from django.contrib.auth.hashers import make_password;from django.contrib.auth.models import User; admin = User(username='username', email='exa...@example.com', password=make_password('password'), is_superuser=True,is_staff=True);admin.save()"





--
"La utopía sirve para caminar" Fernando Birri


ALINDA Fortunate

unread,
Apr 12, 2024, 1:05:42 AM4/12/24
to django...@googlegroups.com
Thanks so much for your assistance indeed the issue was I had failed to visualise my data on railway since I am using an external database. A friend helped understand that and now I am able to access my admin panel.

Thanks everyone. 

Reply all
Reply to author
Forward
0 new messages