hey there everyone! recently i started learning django and here is what i do: i create a virtual envirnment, i create a project and in the project directory i make my app. then i go to the views.py and add a simple “hello world” function like this: def home(request): return httpresponse(“hello world”) ( i have imported all the necessaty modules and packages and upper or lowecase words are correct in my own code.) then i go to the url.py(in my app directory) and import that in my url patterns. and then i import the url in my project too and add the app in settings.py. now this should show me a web page with " hello world" written on. but the problem is that it doesnt… no matter what i do it just shows me the default installation page with that rocket image on. i have followed thousands of tutorials by now step by step doing exactly what they say and i get nothing. please help me. thanks
Hi parhamsnk,
Have you included your app urls to urlpatterns in your project url.py?
from django.urls import path, include
urlpatterns = [
path("admin/", admin.site.urls),
path("", include("your_app.urls")),
]
Welcome!
As a general note here, it’s a lot more helpful if you actually post the code you’re talking about rather than describing it, along with showing the commands that you’re entering to create the project and app and to run your project.
Note: When posting code here, surround each file’s worth of code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted.
Second, rather than following “thousands of tutorials”, I suggest you work your way through the Official Django Tutorial - and at any step where you are encountering an issue, ask for help here. I have found it’s usually more confusing for people when they try to mix resources early on.