аватар question@mail.ru · 01.01.1970 03:00

__init __ () Takes 1 Positional Argument But 2 Were Given

In Dzhang, a beginner, therefore I ask for help from more experienced people.

This is the Frontened application a la starting page of the project, and the class is a model with references to the rest of the applications. That is, a site hat. From this I am waiting for a working result. And it most likely works, but gives an exception to the headline of my question.

   from  django.db  class   linksinhead  (Models.model):  navigate = models.charfield (max_length =  16 )  link_way = models.charfield (max_length =  16 ) r  def   __ str __  ( self ):   retu  self.navigate  def   get_url  ( self ):   retu   ''/ %I ' self.Link_Waye  '' `nnavigate = the text of our link in the headelink_way = Latinitsa Path to the application__str__ = so that when it is up to the page from the cap, the name was Cyrillic (OPT.) A A Way to the application was in Get_UrlGET_URL = Way to Applications ``   

here fronten/view.py

   from   django.shortcuts  Import  render  from  frontenD.models  impan> linksinheader  from  django.Views.generic  Import  listView  class   headerlinks  ( ListView ):  model = linksinheader    

here fronten/urls.py

   from  django.conf.urls  Import  url  from .  Import  viewsurlpattes = [ url ( r '^$' , views.headerlinks, name =" "" "Header ' ), ]     

But the problem is, when crossing at 0.0.0.0.0.0:8000/frontend/ You make a mistake. And from the admin panel everything is calmly edited and shortened.

Here is the tracing

I hope for you. Your instruction what should I do about it.

аватар answer@mail.ru · 01.01.1970 03:00

class-BASED Views in View calling the corresponding:

  url ( r '^$' , Views.headerlinks.as_View (), name =  'header' ),                                       

Latest

Similar