Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/ |
Using the URLconf defined in meeting_planner.urls
, Django tried these URL patterns, in this order:
The empty path didn't match any of these.
You're seeing this error because you have DEBUG = True
in your Django settings file. Change that to False
, and Django will display a standard 404 page.
Can someone please help me with this? I am stuck.
This is my code: (meeting_planner/website/views.py):
from django.shortcuts import render
from django.http import HttpRequest
# Create your views here.
def welcome(request):
return HttpRequest("Welcome to the Meeting Planner Website!")
(meeting_planner/meeting_planer/urls.py):
from django.contrib import admin
from django.urls import path
from website import views
from django.conf.urls import url,include
from website.views import welcome
urlpatterns = [
path('admin/', admin.site.urls),
path('welcome.html', welcome)
]
--
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/3d38a2c2-3449-4c2f-839e-244b9295f55d%40googlegroups.com.
path('welcome.html', welcome)
should be :path('', welcome)
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1203797502.769610.1588615897439%40mail.yahoo.com.
urlpatterns = [
path('admin/', admin.site.urls),
path('', welcome)
]
Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/welcome |
Using the URLconf defined in meeting_planner.urls
, Django tried these URL patterns, in this order:
The current path, welcome
, didn't match any of these.
You're seeing this error because you have DEBUG = True
in your Django settings file. Change that to False
, and Django will display a standard 404 page.
--
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/d02b62d5-caa4-4f5e-a128-e46bd6fa1e08%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1203797502.769610.1588615897439%40mail.yahoo.com.
__init__() takes 1 positional argument but 2 were given
Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/welcome/ |
Django Version: | 3.0.5 |
Exception Type: | TypeError |
Exception Value: | __init__() takes 1 positional argument but 2 were given |
Exception Location: | C:\Users\deeptish\PycharmProjects\GettingStartedDjango\meeting_planner\website\views.py in welcome, line 6 |
Python Executable: | C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\Scripts\python.exe |
Python Version: | 3.7.7 |
Python Path: | ['C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\meeting_planner', 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip', 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\DLLs', 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37\\lib', 'C:\\Users\\deeptish\\AppData\\Local\\Programs\\Python\\Python37', 'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv', 'C:\\Users\\deeptish\\PycharmProjects\\GettingStartedDjango\\venv\\lib\\site-packages'] |
Server time: | Mon, 4 May 2020 18:40:54 +0000 |
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\exception.py
in inner
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
in _get_response
C:\Users\deeptish\PycharmProjects\GettingStartedDjango\venv\lib\site-packages\django\core\handlers\base.py
in _get_response
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAL-j-zc8L27BKFgPhgtQ5JX-xMrukh8ZQCej_4v6jd6_%3DpiZmw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJOjMFej%3Dco2qe_B05qpSTQwkTBFRQ30kQ%2BGnoacA0KtR%2B0u7Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJOjMFej%3Dco2qe_B05qpSTQwkTBFRQ30kQ%2BGnoacA0KtR%2B0u7Q%40mail.gmail.com.
look closely at the routes "django" is telling you that it tried:
[admin/, welcome.html/]
... these are truly the two paths that you specified, why on earth are you trying to visit a non-existing path(http://127.0.0.1:8000/)
... kindly visit (http://127.0.0.1:8000/welcome.html)
and face your next error in the "views.py" file ('HttpRequest' instead of 'HttpResponse')
--
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/f9c805f3-c264-46c6-ab20-153b3c7b9291%40googlegroups.com.