It means that there is no line in urls.py of the main application with the 
name as 'display_laptop'. Probably you are confused with the action and 
name. Action should be a callable and should be imported in urls.py file. 
Name is the name of the route and it appears within quote (normally).

Typically a url is: [url_pattern, callable, {additional parameters or 
empty}, name='display_laptop']

if you are going to write a function called display_laptop, import it into 
the urls.py and in the above url, replace callable with display_laptop (no 
quote); that is:

from .... import display_laptop

urlpatterns = [ [.....], [url_pattern, display_laptop,{..}, 
name='display_laptop'],....]


Cheers.
=============================================

On Monday, August 12, 2019 at 4:59:40 PM UTC+5:30, goitom negash wrote:
>
> the following error is displayed when i try to write a function named as 
> display_laptop to display the available laptops in the backend.
> NoReverseMatch at /
>
> Reverse for 'display_laptop' not found. 'display_laptop' is not a valid view 
> function or pattern name.
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/
> Django Version: 2.2.3
> Exception Type: NoReverseMatch
> Exception Value: 
>
> Reverse for 'display_laptop' not found. 'display_laptop' is not a valid view 
> function or pattern name.
>
> Exception Location: 
> C:\Users\Goitom\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py
>  
> in _reverse_with_prefix, line 668
> Python Executable: 
> C:\Users\Goitom\AppData\Local\Programs\Python\Python37-32\python.exe
> Python Version: 3.7.4
> Python Path: 
>
> ['C:\\Users\\Goitom\\Desktop\\shop',
>  
> 'C:\\Users\\Goitom\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip',
>  'C:\\Users\\Goitom\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
>  'C:\\Users\\Goitom\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
>  'C:\\Users\\Goitom\\AppData\\Local\\Programs\\Python\\Python37-32',
>  'C:\\Users\\Goitom\\AppData\\Roaming\\Python\\Python37\\site-packages',
>  
> 'C:\\Users\\Goitom\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages']
>
> Server time: Mon, 12 Aug 2019 11:12:59 +0000
>

-- 
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/7aa458f9-6766-467e-8d4c-8680e991197b%40googlegroups.com.

Reply via email to