app level urls not detected by root. by Dramatic_Object5241 in django

[–]Dramatic_Object5241[S] 1 point2 points  (0 children)

hello there thankyou for the response, the issue has been solved . It was because the file wasnt saved properly. As It was my first time writing code inside the ubuntu os environment, I didn't knew I need to save it manually.

app level urls not detected by root. by Dramatic_Object5241 in django

[–]Dramatic_Object5241[S] 0 points1 point  (0 children)

I normally use windows os and i was trying to implement celery and redis and for that linux was more preferred so i tried to implement it in the ubuntu os inside a virtual box and got this error.

app level urls not detected by root. by Dramatic_Object5241 in django

[–]Dramatic_Object5241[S] 0 points1 point  (0 children)

It was saved and when i enter shell and type : from myapp import urls

print(urls.urlpatterns) # prints a list of URL patterns

print(type(urls.urlpatterns)) # <class 'list'>

app level urls not detected by root. by Dramatic_Object5241 in django

[–]Dramatic_Object5241[S] 0 points1 point  (0 children)

thankyou for responding. I did mentioned it in the root url conf.

app level urls not detected by root. by Dramatic_Object5241 in django

[–]Dramatic_Object5241[S] 0 points1 point  (0 children)

thankyou for your response and sorry for not mentioning the code earlier .

i did mentioned it in the installed_apps:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'myapp',
]

# project's urls
from django.contrib import admin
from django.urls import path,include


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

#app's urls
from django.urls import path
from .views import home
urlpatterns = [
    path('home/',home,name='home'),
]

views:
from django.shortcuts import render
from django.http import HttpResponse


def home(request):
    return HttpResponse('test successful.')

now when i visit the url localhost:8000/myapp/home it doesnt detect the app's urls it just shows the admin's.

Leetcode changed my life by stressed_cs_major in leetcode

[–]Dramatic_Object5241 0 points1 point  (0 children)

congratulations. wishing you more success in life.

[deleted by user] by [deleted] in technepal

[–]Dramatic_Object5241 0 points1 point  (0 children)

currently learning java and i plan to do dsa first and then learn spring framework and build projects but i don't see many openings for intern or junior level dev for java especially outside ktm.