DEV Community

stackbento
stackbento

Posted on

Django Deployment : Day 14

🚀 Django Learning Journey – Day 14

Today was the BIG day — I tried deploying my first ever Django app!
The excitement was real… until the errors started pouring in 😄

🌐 Choosing a Free Tier

After researching deployment options, I chose Render.
Creating an account using GitHub was super smooth…

But everything after that was a rollercoaster 🚀🔥

💡 Important Lessons I Learned Today
1️⃣ The importance of requirements.txt

I finally understood why this file is crucial.
Your project might run locally — but the server needs to know exactly what to install.

2️⃣ Why people name their environment folder .env

Most tutorials use .env instead of venv or virt.
Today I learned the reason: Render automatically picks it up only if it starts with a dot!
Mine didn’t… so Render didn’t detect it 🤦‍♂️

3️⃣ Static files & the root directory

I had to configure a root directory for collecting static files and then run:

python manage.py collectstatic --noinput

I don’t fully understand what --noinput does yet…
But it made the build succeed, so I’ll take the win 🤣

4️⃣ Gunicorn for deployment

Installed gunicorn and updated the start command:

gunicorn todo_app.wsgi:application --bind 0.0.0.0:$PORT

This finally got the app very close to going live.

🎉 The App Actually Went Live!!

Here’s the URL I got on Render:
🌐 https://to-do-list-django-4yp3.onrender.com

I clicked with excitement…
and then…

❌ “DisallowedHost at /”

My jaw dropped.
Locally everything works perfectly — but on the cloud? Not so much.

This was such an important reality check:

“Just because it works on your machine doesn't mean it works on the server.”

I’m now learning why Django requires updating ALLOWED_HOSTS and what a server actually is.

🤝 I Need Some Help

If you’ve deployed Django apps multiple times:

How do you fix this DisallowedHost issue cleanly?

What helped you understand how servers work without getting intimidated?

What shocked you during your first deployment attempt?

🥹 Final Thoughts

Even though today was full of errors…
Seeing my project almost live made me speechless.

The learning curve is steep — but incredibly rewarding.

Thank you all for being part of this journey 🙏
Tomorrow, I’ll tackle the deployment issues again and get this app properly LIVE!

Failed yet proud : https://to-do-list-django-4yp3.onrender.com

Django #Render #WebDevelopment #Python #Deployment #LearningInPublic #100DaysOfCode

Top comments (0)