First app and First Problem?

Hi my friend,
I am new at python and i made these steps but hello world cant run…
First of all i will write what i made…

  • i am using windows 8.1 and open the cmd make new folder on the desktop and name is piton
  • and then cd desktop → cd piton and then pip install virtualenv
  • and then virtualenv sanal_ortam #sanal_ortam is the name of the virtualenv
  • and then cd sanal_ortam and then scripts and activate #everything is ok…
  • i returned the cd piton and pip install django
  • and then django-admin startproject sitem
  • and then cd sitem and python manage.py runserver
    -and django installed and works…

Second part

  • django-admin startapp ilkuygulama
  • i open the visual studio code and ilkuygulama–> views.py file i wrote these codes
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.

def anasayfaView(request):
    return HttpResponse('Hello World.')
  • and then ilkuygulama–>urls.py file i wrote these codes
from django.urls import path
from .views import anasayfaView

urlpatterns=[
    path('', anasayfaView, name="anasayfa")
]
  • and then sitem–>urls.py i wrote these codes
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('ilkuygulama.urls')),
]

and python manage.py runserver i did

but still nothing, still The install worked successfully! Congratulations! page on the browser…

Where i did mistake?

Did you add ilkuygulama to your project’s INSTALLED_APPS settings?

2 Likes

hi my friend, i added to installed app and solved. Thanks a lot :grinning: