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.
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
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,
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
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
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
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
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:
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
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+
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,
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('
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
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
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
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
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,
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
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
19 matches
Mail list logo