⚡️Day 19/20 – Let's Bring Our Django App to Life! 🎯
Day 19 of the #20DoLC
We’re almost there! Can you believe it? 19 days down, 1 more to go! 🚀 This journey has been nothing short of amazing, and now we’re about to cross the finish line of our 20-day challenge with Africa Agility Foundation Cohort 8! But before we celebrate, let’s take one more step towards greatness😊.
Yesterday, we built the foundation of our Django project. But what’s a house without rooms? 🤔 Today, we’re adding our first Django app—think of it as a cool feature inside your project! 🚀
🎬 Step 1: Let's create a Django App
Every great project starts with a small step. Let’s create our app!
🛠️ In your terminal, run:
🔹 Replace myapp with a name that matches your app’s purpose.
What just happened? Django created a new folder (myapp/) filled with everything we need to build something amazing! 🚀
📌 Step 2: Let's tell Django about our App
Now, we need to register our app so Django knows it exists.
Open settings.py and find the INSTALLED_APPS section. Add your app like this:
✅ Now Django knows your app is part of the squad!
💡 Step 3: Let's create our first view
A view is like the director of a movie—it decides what content the audience (users) will see.
Open myapp/views.py and add this:
📢 This function tells Django to display text when a user visits our site.
🌍 Step 4: Set Up URL Routing
URLs are like addresses. If you want people to visit your page, you need an address!
1️⃣ Inside myapp/, create a new file called urls.py and add:
2️⃣ Now, connect it to your project’s urls.py: Open urls.py in your project folder and modify it like this:
🎯 Now, Django knows where to send users when they visit our site!
🚀 Step 5: Run the Django Server
The moment of truth!
Start your Django development server:
Then, open http://127.0.0.1:8000/ in your browser.
🎉 BOOM! You should see: 🚀 Welcome to My First Django App! 🚀
#20DaysinBackendWithAA | #GIT20DayChallenge | #GirlsinTech | #GIT8 | #Python | #20DoLC | #AfricaAgility |#Django
Africa Agility Foundation Ayomide Francis - Akinlolu Dere Oritsejafor
Technology Enthusiast | Software Developer | UI/UX designer
5moYou’re doing great partner!!