I have created a django project called "blogprojesi". I want to import the urls.py file inside the application I created with the name "inf" to the urls.py file inside this project, but I am getting the following error ImportError: cannot import name 'inf' from 'blogprojesi' (.....\blogprojesi\blogprojesi_init_.py)
I guess somehow it doesn't see the inf app. I tried the Re_path thing but it didn't work. How can I solve this?
**urls.py file inside the "blogprojesi"**
from django.contrib import admin
from django.urls import path,include
from blogprojesi import inf
from blogprojesi.inf import urls
urlpatterns = [
path('admin/', admin.site.urls),
path('',inf,include('inf.urls')),
]
**Contents of urls.py file inside inf application**
from django.urls import path
from . import views
urlpatterns = [
path("",views.index),
path("index",views.index),
path("blogs",views.blogs),
path("blogs/<int:id>",views.blog_details),
]
**Contents of views.py file inside inf application**
from http.client import HTTPResponse
from django.http.response import HttpResponse
from django.shortcuts import render
def index(request):
return HttpResponse("Home Page")
def blogs(request):
return HttpResponse("blogs")
def blog_details(request,id):
return HttpResponse("blog detail: "+id)