Re: Django urls error

2023-04-23 Thread Nitesh Solanki
myproject (main app)
myapp (additional app)

Code: myproject/urls.py

from django.contrib import admin
from django.urls import path, include

from .views import HomeView

urlpatterns = [
path('admin/', admin.site.urls),
path('', HomeView, name='home'), ### will refer to main app views.py. 
These routes are commonly written in main app only
path('hello/', include('myapp.urls')),
] -- 
Code: myproject/settings.py
# Application definition

INSTALLED_APPS = [
...
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp', ### added to inform the django project that we have installed 
a new app named 'myapp'
]

-- 
Code: myproject/views.py
### refers to all the common route associated to main app (myproject)
from django.http import HttpResponse

def HomeView(request):
return HttpResponse('Home page!')
-- 
Code: myapp/urls.py
### refers to all route which are associated with our new app 'myapp'. All 
routes declared here, can be accessed by adding a prefix '/hello/' ### 
because we have declared a word 'hello/' to refer 'myapp' in the 
'myproject/urls.py'
from django.urls import path
from .views import hello_delhi_capitals

urlpatterns = [
path('', hello_delhi_capitals, name='hello_delhi_capitals'),
]
-- 
Code: myapp/urls.py
### refers to all the common route associated to 'myapp' app 
from django.http import HttpResponse

def hello_delhi_capitals(request):
return HttpResponse('Hello Delhi Capitals!')
After running the project two urls will work here 
http://127.0.0.1:8000/
http://127.0.0.1:8000/hello/
On Sunday, 23 April, 2023 at 6:43:37 am UTC+5:30 ritik sahoo wrote:

> Exactly 
>
> On Tue, 18 Apr, 2023, 3:46 am Tarun Miri,  wrote:
>
>> You may not write any string on the urls.py of myapp/urls.py 
>> Ex path('',hello_delhi_capitals,name="hello_delhi_capitals"),
>>
>> On Sat, 15 Apr, 2023, 7:29 am Muhammad Juwaini Abdul Rahman, <
>> juw...@gmail.com> wrote:
>>
>>> In your urls.py you use '/hello' but in your browser you type '/home'.
>>>
>>> On Sat, 15 Apr 2023 at 06:07, lalit upadhyay  
>>> wrote:
>>>
 *I have copied my code here. Plz fix this error:*


 view.py
 from django.http import HttpResponse


 def hello_delhi_capitals(request):
 return HttpResponse('Hello Delhi Capitals!')



 myproject/urls.py

 from django.contrib import admin
 from django.urls import path, include

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



 myapp/urls.py



 from django.urls import path
 from .views import hello_delhi_capitals

 urlpatterns = [
 path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
 ]

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
  
 
 .

>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAFKhtoTQB506MC1OwxvHhT23R5kK-0uC5cxcDm3YS3Q6SYM-Pg%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CA%2BznC8P5goz9Wzfreknw7vhpChMxjxb4P2jZOa%2BpP68%3D0r3FKA%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: Django urls error

2023-04-22 Thread ritik sahoo
Exactly

On Tue, 18 Apr, 2023, 3:46 am Tarun Miri,  wrote:

> You may not write any string on the urls.py of myapp/urls.py
> Ex path('',hello_delhi_capitals,name="hello_delhi_capitals"),
>
> On Sat, 15 Apr, 2023, 7:29 am Muhammad Juwaini Abdul Rahman, <
> juwa...@gmail.com> wrote:
>
>> In your urls.py you use '/hello' but in your browser you type '/home'.
>>
>> On Sat, 15 Apr 2023 at 06:07, lalit upadhyay 
>> wrote:
>>
>>> *I have copied my code here. Plz fix this error:*
>>>
>>>
>>> view.py
>>> from django.http import HttpResponse
>>>
>>>
>>> def hello_delhi_capitals(request):
>>> return HttpResponse('Hello Delhi Capitals!')
>>>
>>>
>>>
>>> myproject/urls.py
>>>
>>> from django.contrib import admin
>>> from django.urls import path, include
>>>
>>> urlpatterns = [
>>> path('admin/', admin.site.urls),
>>> path('hello/', include('myapp.urls')),
>>> ]
>>>
>>>
>>>
>>> myapp/urls.py
>>>
>>>
>>>
>>> from django.urls import path
>>> from .views import hello_delhi_capitals
>>>
>>> urlpatterns = [
>>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>>> ]
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAFKhtoTQB506MC1OwxvHhT23R5kK-0uC5cxcDm3YS3Q6SYM-Pg%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BznC8P5goz9Wzfreknw7vhpChMxjxb4P2jZOa%2BpP68%3D0r3FKA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJwehCs6WBMTpbta-goxpivNFJ_pkDYoU%2BEfPi4hp%3D_aFtUk6w%40mail.gmail.com.


Re: Django urls error

2023-04-17 Thread Tarun Miri
You may not write any string on the urls.py of myapp/urls.py
Ex path('',hello_delhi_capitals,name="hello_delhi_capitals"),

On Sat, 15 Apr, 2023, 7:29 am Muhammad Juwaini Abdul Rahman, <
juwa...@gmail.com> wrote:

> In your urls.py you use '/hello' but in your browser you type '/home'.
>
> On Sat, 15 Apr 2023 at 06:07, lalit upadhyay 
> wrote:
>
>> *I have copied my code here. Plz fix this error:*
>>
>>
>> view.py
>> from django.http import HttpResponse
>>
>>
>> def hello_delhi_capitals(request):
>> return HttpResponse('Hello Delhi Capitals!')
>>
>>
>>
>> myproject/urls.py
>>
>> from django.contrib import admin
>> from django.urls import path, include
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('hello/', include('myapp.urls')),
>> ]
>>
>>
>>
>> myapp/urls.py
>>
>>
>>
>> from django.urls import path
>> from .views import hello_delhi_capitals
>>
>> urlpatterns = [
>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>> ]
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFKhtoTQB506MC1OwxvHhT23R5kK-0uC5cxcDm3YS3Q6SYM-Pg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BznC8P5goz9Wzfreknw7vhpChMxjxb4P2jZOa%2BpP68%3D0r3FKA%40mail.gmail.com.


Re: Django urls error

2023-04-17 Thread Tahir Munir Faraz
do not write hello at the project level This is not correct
path('hello/', include('myapp.urls')),
The code below is correct
path('' ",include("myapp.urls"),

On Sun, 16 Apr 2023 at 21:34, oluwafemi damilola 
wrote:

> Your path is 'hello/', but in your browser you are going to 'home', that
> path does not exist
>
> On Fri, 14 Apr 2023 at 23:07, lalit upadhyay 
> wrote:
>
>> *I have copied my code here. Plz fix this error:*
>>
>>
>> view.py
>> from django.http import HttpResponse
>>
>>
>> def hello_delhi_capitals(request):
>> return HttpResponse('Hello Delhi Capitals!')
>>
>>
>>
>> myproject/urls.py
>>
>> from django.contrib import admin
>> from django.urls import path, include
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('hello/', include('myapp.urls')),
>> ]
>>
>>
>>
>> myapp/urls.py
>>
>>
>>
>> from django.urls import path
>> from .views import hello_delhi_capitals
>>
>> urlpatterns = [
>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>> ]
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALo4fb8kC34MgtuhdDz5MVDotBXvDe-crQLTiWBxLF1q0QmbEw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ%2BiHWZXdE0BmuoUob%3DK%2Bibh82_8u%2BWAgSrTr4Tkz_wR89aQ3A%40mail.gmail.com.


Re: Django urls error

2023-04-16 Thread oluwafemi damilola
Your path is 'hello/', but in your browser you are going to 'home', that
path does not exist

On Fri, 14 Apr 2023 at 23:07, lalit upadhyay 
wrote:

> *I have copied my code here. Plz fix this error:*
>
>
> view.py
> from django.http import HttpResponse
>
>
> def hello_delhi_capitals(request):
> return HttpResponse('Hello Delhi Capitals!')
>
>
>
> myproject/urls.py
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('hello/', include('myapp.urls')),
> ]
>
>
>
> myapp/urls.py
>
>
>
> from django.urls import path
> from .views import hello_delhi_capitals
>
> urlpatterns = [
> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
> ]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALo4fb8kC34MgtuhdDz5MVDotBXvDe-crQLTiWBxLF1q0QmbEw%40mail.gmail.com.


Re: Django urls error

2023-04-16 Thread oluwafemi damilola
If you are still getting the error if you visit the 'hello' path, then you
should visit 'hello/hello/'


On Sun, 16 Apr 2023 at 11:19, oluwafemi damilola 
wrote:

> Your path is 'hello/', but in your browser you are going to 'home', that
> path does not exist
>
> On Fri, 14 Apr 2023 at 23:07, lalit upadhyay 
> wrote:
>
>> *I have copied my code here. Plz fix this error:*
>>
>>
>> view.py
>> from django.http import HttpResponse
>>
>>
>> def hello_delhi_capitals(request):
>> return HttpResponse('Hello Delhi Capitals!')
>>
>>
>>
>> myproject/urls.py
>>
>> from django.contrib import admin
>> from django.urls import path, include
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('hello/', include('myapp.urls')),
>> ]
>>
>>
>>
>> myapp/urls.py
>>
>>
>>
>> from django.urls import path
>> from .views import hello_delhi_capitals
>>
>> urlpatterns = [
>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>> ]
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALo4fb_uM5Z%2BgptqxAzD_w9x%3Dez5KVAYMX%3DE3V29k_65fm_sew%40mail.gmail.com.


Re: Django urls error

2023-04-15 Thread 'Kasper Laudrup' via Django users

On 14/04/2023 21.48, lalit upadhyay wrote:

*

I have copied my code here.



The code is from a project called "myproject"


Plz fix this error:



The error is from a project called "Tesing".

You can ignore all other answers you've been given so far until you 
figure out how that could be.


Kind regards,
Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5844b278-648a-794d-55b2-45bf980c8948%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Django urls error

2023-04-15 Thread Karthik V A
Bro, From myapp/ urla.py


 Url pattern =[
Path('hello', views.hello_delhi_capitals, name = hello_delhi_capitals)]


On Sat, 15 Apr, 2023, 8:35 pm b1t,  wrote:

> ou haven't defined the home url that you are trying to access
>
> On Saturday, 15 April 2023 at 03:37:38 UTC+5:30 lalit upadhyay wrote:
>
>> *I have copied my code here. Plz fix this error:*
>>
>>
>> view.py
>> from django.http import HttpResponse
>>
>>
>> def hello_delhi_capitals(request):
>> return HttpResponse('Hello Delhi Capitals!')
>>
>>
>>
>> myproject/urls.py
>>
>> from django.contrib import admin
>> from django.urls import path, include
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('hello/', include('myapp.urls')),
>> ]
>>
>>
>>
>> myapp/urls.py
>>
>>
>>
>> from django.urls import path
>> from .views import hello_delhi_capitals
>>
>> urlpatterns = [
>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>> ]
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2a78750c-9099-41c7-bc5c-5be0a8c06221n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHjRVdTmDwZ9cp1UTKGO_JNrrc1Kk0hD6w8zsC-VJgB3kLp90w%40mail.gmail.com.


Re: Django urls error

2023-04-15 Thread Lawal Tobiloba Samuel
You are suppose to use localhost:8000/hello/hello.
Because, you added hello as you path when you are including the app urls to
the project url and also you made hello the path to the view of
hello_delhi_ Which makes 2 hello's..

Use localhost:8000/hello/hello

On Sat, Apr 15, 2023, 9:27 AM lalit upadhyay 
wrote:

>
> *I have replaced URL ‘home/’ to ‘hello/’ but still i got same error*
> On Saturday, April 15, 2023 at 7:29:15 AM UTC+5:30 Muhammad Juwaini Abdul
> Rahman wrote:
>
>> In your urls.py you use '/hello' but in your browser you type '/home'.
>>
>> On Sat, 15 Apr 2023 at 06:07, lalit upadhyay 
>> wrote:
>>
>>> *I have copied my code here. Plz fix this error:*
>>>
>>>
>>> view.py
>>> from django.http import HttpResponse
>>>
>>>
>>> def hello_delhi_capitals(request):
>>> return HttpResponse('Hello Delhi Capitals!')
>>>
>>>
>>>
>>> myproject/urls.py
>>>
>>> from django.contrib import admin
>>> from django.urls import path, include
>>>
>>> urlpatterns = [
>>> path('admin/', admin.site.urls),
>>> path('hello/', include('myapp.urls')),
>>> ]
>>>
>>>
>>>
>>> myapp/urls.py
>>>
>>>
>>>
>>> from django.urls import path
>>> from .views import hello_delhi_capitals
>>>
>>> urlpatterns = [
>>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>>> ]
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e42af2a7-abc4-41dd-a7f6-5f7c8af1630an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAscozVQWvak5OWMMbVEfcu5dDVzj%3DR5e0OK5Mv1xmR0B_pSag%40mail.gmail.com.


Re: Django urls error

2023-04-15 Thread b1t
You define hello/ in your base urls.py file and again in your  
myapp/urls.py so that's create a URL like this "127.0.0.1/hello/hello".
instead use this in your myapp/urls.py 
urlpatterns = [
path('', hello_delhi_capitals, name='hello_delhi_capitals'),
]

On Saturday, 15 April 2023 at 13:57:36 UTC+5:30 lalit upadhyay wrote:

>
> *I have replaced URL ‘home/’ to ‘hello/’ but still i got same error*
> On Saturday, April 15, 2023 at 7:29:15 AM UTC+5:30 Muhammad Juwaini Abdul 
> Rahman wrote:
>
>> In your urls.py you use '/hello' but in your browser you type '/home'.
>>
>> On Sat, 15 Apr 2023 at 06:07, lalit upadhyay  
>> wrote:
>>
>>> *I have copied my code here. Plz fix this error:*
>>>
>>>
>>> view.py
>>> from django.http import HttpResponse
>>>
>>>
>>> def hello_delhi_capitals(request):
>>> return HttpResponse('Hello Delhi Capitals!')
>>>
>>>
>>>
>>> myproject/urls.py
>>>
>>> from django.contrib import admin
>>> from django.urls import path, include
>>>
>>> urlpatterns = [
>>> path('admin/', admin.site.urls),
>>> path('hello/', include('myapp.urls')),
>>> ]
>>>
>>>
>>>
>>> myapp/urls.py
>>>
>>>
>>>
>>> from django.urls import path
>>> from .views import hello_delhi_capitals
>>>
>>> urlpatterns = [
>>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>>> ]
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/05527619-3284-4b85-940c-0b698acebef8n%40googlegroups.com.


Re: Django urls error

2023-04-15 Thread አብርሃም መስፍን
remove 'hello' from myapp.py to access the site  on 'hello' or you can
access it at 'hello/hello'

On Sat, Apr 15, 2023, 11:57 AM lalit upadhyay 
wrote:

> I haven't used admin/ in my urls.py in myapp
> from django.urls import path
>
> from . import views
>
> urlpatterns = [
> path('', views.index, name="index"),
> ]
>
> On Saturday, April 15, 2023 at 2:01:53 PM UTC+5:30 Karthik V A wrote:
>
>> Remove admin/ url pattern at urls.py in myapp
>>
>> On Sat, 15 Apr, 2023, 1:58 pm lalit upadhyay, 
>> wrote:
>>
>>>
>>> *I have replaced URL ‘home/’ to ‘hello/’ but still i got same error*
>>> On Saturday, April 15, 2023 at 7:29:15 AM UTC+5:30 Muhammad Juwaini
>>> Abdul Rahman wrote:
>>>
 In your urls.py you use '/hello' but in your browser you type '/home'.

 On Sat, 15 Apr 2023 at 06:07, lalit upadhyay 
 wrote:

> *I have copied my code here. Plz fix this error:*
>
>
> view.py
> from django.http import HttpResponse
>
>
> def hello_delhi_capitals(request):
> return HttpResponse('Hello Delhi Capitals!')
>
>
>
> myproject/urls.py
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('hello/', include('myapp.urls')),
> ]
>
>
>
> myapp/urls.py
>
>
>
> from django.urls import path
> from .views import hello_delhi_capitals
>
> urlpatterns = [
> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
> ]
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
> 
> .
>
 --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/e42af2a7-abc4-41dd-a7f6-5f7c8af1630an%40googlegroups.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2354be77-36e2-4674-af00-194e8067924en%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJZmvP-pguyioKJCiNom%2Bb6RC-6SHOOAsqrKkUVSV3rAsF7LNA%40mail.gmail.com.


Re: Django urls error

2023-04-15 Thread Shaikh Mudassir
In  *myproject/urls.py *you have defined a path *hello/* for *myapp *and 
then again you define *hello/ *for the hello_delhi_capitals method. 
Now, You have two solution
1. You call *http://127.0.0.1:8000/home/home *
2.  You can remove */home* in *myproject/urls.py *
like this *path(**'', include('myapp.urls'))*

On Saturday, April 15, 2023 at 2:01:53 PM UTC+5:30 Karthik V A wrote:

> Remove admin/ url pattern at urls.py in myapp 
>
> On Sat, 15 Apr, 2023, 1:58 pm lalit upadhyay,  
> wrote:
>
>>
>> *I have replaced URL ‘home/’ to ‘hello/’ but still i got same error*
>> On Saturday, April 15, 2023 at 7:29:15 AM UTC+5:30 Muhammad Juwaini Abdul 
>> Rahman wrote:
>>
>>> In your urls.py you use '/hello' but in your browser you type '/home'.
>>>
>>> On Sat, 15 Apr 2023 at 06:07, lalit upadhyay  
>>> wrote:
>>>
 *I have copied my code here. Plz fix this error:*


 view.py
 from django.http import HttpResponse


 def hello_delhi_capitals(request):
 return HttpResponse('Hello Delhi Capitals!')



 myproject/urls.py

 from django.contrib import admin
 from django.urls import path, include

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



 myapp/urls.py



 from django.urls import path
 from .views import hello_delhi_capitals

 urlpatterns = [
 path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
 ]

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
  
 
 .

>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/e42af2a7-abc4-41dd-a7f6-5f7c8af1630an%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/21e4cd13-aa48-471f-8d1f-566550a37ddbn%40googlegroups.com.


Re: Django urls error

2023-04-15 Thread Lawal Tobiloba Samuel
What I notice is that wgen you are creating ur urls at the project level,
you used "hello/" and you include the the app level urls.


If you want to request the route from the browser, you are suppose to use
localhost:8000/hello, not localhost:home.



Remember: you did not create a route for "home"

On Fri, Apr 14, 2023, 11:07 PM lalit upadhyay 
wrote:

> *I have copied my code here. Plz fix this error:*
>
>
> view.py
> from django.http import HttpResponse
>
>
> def hello_delhi_capitals(request):
> return HttpResponse('Hello Delhi Capitals!')
>
>
>
> myproject/urls.py
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('hello/', include('myapp.urls')),
> ]
>
>
>
> myapp/urls.py
>
>
>
> from django.urls import path
> from .views import hello_delhi_capitals
>
> urlpatterns = [
> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
> ]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAscozW1D25hAXp0qK85vpJi-e0LQ3t4PWvA5yOhtSy%3D93PPRg%40mail.gmail.com.


Re: Django urls error

2023-04-15 Thread Lawal Tobiloba Samuel
So if you want to request you page, it will look like this,
localhost:hello/hello.


At the app level of the urls, you can leave that path empty like this.
path(" ", views.delih.., name = "deliii")


Then you can request you web page as localhost:/hello

On Sat, Apr 15, 2023, 12:38 AM Lawal Tobiloba Samuel <
oluwasheun9...@gmail.com> wrote:

> What I notice is that wgen you are creating ur urls at the project level,
> you used "hello/" and you include the the app level urls.
>
>
> If you want to request the route from the browser, you are suppose to use
> localhost:8000/hello, not localhost:home.
>
>
>
> Remember: you did not create a route for "home"
>
> On Fri, Apr 14, 2023, 11:07 PM lalit upadhyay 
> wrote:
>
>> *I have copied my code here. Plz fix this error:*
>>
>>
>> view.py
>> from django.http import HttpResponse
>>
>>
>> def hello_delhi_capitals(request):
>> return HttpResponse('Hello Delhi Capitals!')
>>
>>
>>
>> myproject/urls.py
>>
>> from django.contrib import admin
>> from django.urls import path, include
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('hello/', include('myapp.urls')),
>> ]
>>
>>
>>
>> myapp/urls.py
>>
>>
>>
>> from django.urls import path
>> from .views import hello_delhi_capitals
>>
>> urlpatterns = [
>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>> ]
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAscozVzrDMuUUu80o53WXVYUUTEU-NApazqHxyZaxQeewQ01A%40mail.gmail.com.


Re: Django urls error

2023-04-15 Thread b1t
ou haven't defined the home url that you are trying to access

On Saturday, 15 April 2023 at 03:37:38 UTC+5:30 lalit upadhyay wrote:

> *I have copied my code here. Plz fix this error:*
>
>
> view.py
> from django.http import HttpResponse
>
>
> def hello_delhi_capitals(request):
> return HttpResponse('Hello Delhi Capitals!')
>
>
>
> myproject/urls.py
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('hello/', include('myapp.urls')),
> ]
>
>
>
> myapp/urls.py
>
>
>
> from django.urls import path
> from .views import hello_delhi_capitals
>
> urlpatterns = [
> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
> ]
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2a78750c-9099-41c7-bc5c-5be0a8c06221n%40googlegroups.com.


Re: Django urls error

2023-04-15 Thread b1t
You are trying to access the home/ URL which u haven't defined yet

On Saturday, 15 April 2023 at 03:37:38 UTC+5:30 lalit upadhyay wrote:

> *I have copied my code here. Plz fix this error:*
>
>
> view.py
> from django.http import HttpResponse
>
>
> def hello_delhi_capitals(request):
> return HttpResponse('Hello Delhi Capitals!')
>
>
>
> myproject/urls.py
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('hello/', include('myapp.urls')),
> ]
>
>
>
> myapp/urls.py
>
>
>
> from django.urls import path
> from .views import hello_delhi_capitals
>
> urlpatterns = [
> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
> ]
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6e7b6f45-0bb6-41ac-95d6-c2bedfa22690n%40googlegroups.com.


Re: Django urls error

2023-04-15 Thread lalit upadhyay


I haven't used admin/ in my urls.py in myapp
from django.urls import path

from . import views

urlpatterns = [
path('', views.index, name="index"),
]

On Saturday, April 15, 2023 at 2:01:53 PM UTC+5:30 Karthik V A wrote:

> Remove admin/ url pattern at urls.py in myapp 
>
> On Sat, 15 Apr, 2023, 1:58 pm lalit upadhyay,  
> wrote:
>
>>
>> *I have replaced URL ‘home/’ to ‘hello/’ but still i got same error*
>> On Saturday, April 15, 2023 at 7:29:15 AM UTC+5:30 Muhammad Juwaini Abdul 
>> Rahman wrote:
>>
>>> In your urls.py you use '/hello' but in your browser you type '/home'.
>>>
>>> On Sat, 15 Apr 2023 at 06:07, lalit upadhyay  
>>> wrote:
>>>
 *I have copied my code here. Plz fix this error:*


 view.py
 from django.http import HttpResponse


 def hello_delhi_capitals(request):
 return HttpResponse('Hello Delhi Capitals!')



 myproject/urls.py

 from django.contrib import admin
 from django.urls import path, include

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



 myapp/urls.py



 from django.urls import path
 from .views import hello_delhi_capitals

 urlpatterns = [
 path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
 ]

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
  
 
 .

>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/e42af2a7-abc4-41dd-a7f6-5f7c8af1630an%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2354be77-36e2-4674-af00-194e8067924en%40googlegroups.com.


Re: Django urls error

2023-04-15 Thread Karthik V A
Remove admin/ url pattern at urls.py in myapp

On Sat, 15 Apr, 2023, 1:58 pm lalit upadhyay, 
wrote:

>
> *I have replaced URL ‘home/’ to ‘hello/’ but still i got same error*
> On Saturday, April 15, 2023 at 7:29:15 AM UTC+5:30 Muhammad Juwaini Abdul
> Rahman wrote:
>
>> In your urls.py you use '/hello' but in your browser you type '/home'.
>>
>> On Sat, 15 Apr 2023 at 06:07, lalit upadhyay 
>> wrote:
>>
>>> *I have copied my code here. Plz fix this error:*
>>>
>>>
>>> view.py
>>> from django.http import HttpResponse
>>>
>>>
>>> def hello_delhi_capitals(request):
>>> return HttpResponse('Hello Delhi Capitals!')
>>>
>>>
>>>
>>> myproject/urls.py
>>>
>>> from django.contrib import admin
>>> from django.urls import path, include
>>>
>>> urlpatterns = [
>>> path('admin/', admin.site.urls),
>>> path('hello/', include('myapp.urls')),
>>> ]
>>>
>>>
>>>
>>> myapp/urls.py
>>>
>>>
>>>
>>> from django.urls import path
>>> from .views import hello_delhi_capitals
>>>
>>> urlpatterns = [
>>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>>> ]
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e42af2a7-abc4-41dd-a7f6-5f7c8af1630an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHjRVdQ%3Dki-wfi%3DHYFpkF9P4cYgYEX6%3DWTD%3D3aWzBHCvB_7LLg%40mail.gmail.com.


Re: Django urls error

2023-04-14 Thread Muhammad Juwaini Abdul Rahman
In your urls.py you use '/hello' but in your browser you type '/home'.

On Sat, 15 Apr 2023 at 06:07, lalit upadhyay 
wrote:

> *I have copied my code here. Plz fix this error:*
>
>
> view.py
> from django.http import HttpResponse
>
>
> def hello_delhi_capitals(request):
> return HttpResponse('Hello Delhi Capitals!')
>
>
>
> myproject/urls.py
>
> from django.contrib import admin
> from django.urls import path, include
>
> urlpatterns = [
> path('admin/', admin.site.urls),
> path('hello/', include('myapp.urls')),
> ]
>
>
>
> myapp/urls.py
>
>
>
> from django.urls import path
> from .views import hello_delhi_capitals
>
> urlpatterns = [
> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
> ]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFKhtoTQB506MC1OwxvHhT23R5kK-0uC5cxcDm3YS3Q6SYM-Pg%40mail.gmail.com.