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.

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

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,

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

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): > ret

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

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. Ki

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:

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

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+

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,

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('

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

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 L

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 HttpRespon

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 HttpR

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,

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 '/h

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('Hell