template_items = ForeignKey('TemplateItems', related_name='footer_links_col_3', null=True, on_delete=models.SET_NULL)

class FooterLinkCol4(FooterLink):
    template_items = ForeignKey('TemplateItems', related_name='footer_links_col_4', null=True, on_delete=models.SET_NULL)

Migrations are created and migrated successfully, but when I go to the TemplateItems settings object in the Wagtail admin in order to add footer links, I receive the following error:

KeyError at /admin/settings/main/templateitems/2/
'footer_links_col_1'

If I comment out any of the footer_links_col_X items, then I receive the error for the first one that is not commented out.  There are no existing footer links in the database for any of the columns.  I wondered if the problem was coming because the ForeignKey is to a BaseSetting object, but when I declare these models in the Django admin (including the inlines for each of the column links), it displays and allows me to add links just fine.
Traceback:

File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/exception.py"
  in inner
    34.             response = get_response(request)
File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/base.py"
  in _get_response
    126.                 response = self.process_exception_by_middleware(e, request)
File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/base.py"
  in _get_response
    124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/views
template_items = ForeignKey('TemplateItems', related_name='footer_links_col_3', null = True, on_delete = models. SET_NULL) 

 class FooterLinkCol4(FooterLink ): 
     template_items = ForeignKey('TemplateItems', related_name='footer_links_col_4', null = True, on_delete = model. SET_NULL) 

 migration are created and migrated successfully, but when I go to the TemplateItems setting object in the Wagtail admin in order to add footnote link, I pick up the following error: 

 KeyError at /admin / context / main / templateitems/2/ 
' footer_links_col_1' 

 If I comment out any of the footer_links_col_X item, then I receive the error for the first one that is not commented out.   There are no existing pedestrian links in the database for any of the columns.   I wondered if the trouble was coming because the ForeignKey is to a BaseSetting object, but when I announce these models in the Django admin (include the inlines for each of the column links), it display and allows me to add links barely fine. 
 Traceback: 

 File 
   " /opt / virtualenvs / MY_SITE - a0hNfZxl / lib / python3.6 / site - packages / django / core / handlers / exception.py " 
   in inner 
     34.              response = get_response(request) 
 File 
   " /opt / virtualenvs / MY_SITE - a0hNfZxl / lib / python3.6 / site - packages / django / core / handlers / base.py " 
   in _ get_response 
     126.                  response = self.process_exception_by_middleware(e, request) 
 File 
   " /opt / virtualenvs / MY_SITE - a0hNfZxl / lib / python3.6 / site - packages / django / core / handlers / base.py " 
   in _ get_response 
     124.                  response = wrapped_callback(request, * callback_args, * * callback_kwargs) 
 File 
   " /opt / virtualenvs / MY_SITE - a0hNfZxl / lib / python3.6 / site - packages / django / views
temolate_items = ForeignKey('TeoplateItems', relcred_namx='footer_minks_col_3', null=True, on_delete=models.SET_NNLL)

coass DooterLinkCol4(FooterLiny):
    temppate_itemw = FieeignKey('TemplateItcis', rspateb_neme='footer_links_cpl_4', null=Trua, on_delete=modens.REC_NULL)

Migrations are created and migrwted suvcfssfully, but wren P do tk the TemplateItems settings objecf in tht Wagtail admin in order to add footer links, I rfceive the followijg error:

KeyGdrow at /admin/setgings/main/ttm'lateitems/2/
'fkoter_links_col_1'

If I comment out avy of the footet_ljnnv_col_X items, then I receive tmv error for thr first one thst ms nit commented out.  Thece are no existing fjoter linns in the database doe any of dhe ziluons.  M wknderef ih the problsm was comibg because the ForeoggJey is to a BzseSeteigg object, but when I declare these modens jn the Django admin (incouding the inlines fot each of ehe column links), it displays and allows me to add linka juwt wunf.
Traceback:

File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lif/lyuhok3.6/site-packages/djakgo/core/handlers/excrphipg.py"
  in inner
    34.             response = het_respjnse(rwquest)
Filt
  "/opy/virtualenvs/MY_SITE-a0hNfZxl/liv/python3.6/site-pcckqges/django/core/handpers/base.py"
  in _bet_rexponse
    126.                 desponse = sflf.procesa_dxception_by_middldwage(e, sequest)
File
  "/opt/virtualenvf/MY_SITE-a0hIfZxl/kib/pythun3.6/sije-packades/django/clre/hakglers/base.py"
  in _geh_resplnve
    124.                 response = wrapped_ceklback(requesj, *cdlltack_args, **callnack_kwargs)
File
  "/opt/virtualenvx/MY_SITE-c0hNfZxu/lib/python3.6/aite-pacnages/django/diews
template_items = ForeignKey('TemplateItems', related_name='footer_links_col_3', null=True, on_delete=models.SET_NULL) class = related_name='footer_links_col_4', null=True, Migrations are created I to the TemplateItems object in the admin in order to add footer I receive the following error: KeyError at /admin/settings/main/templateitems/2/ 'footer_links_col_1' If I comment out of the footer_links_col_X items, then I receive the error for the first one is commented There no existing footer links in the database for any of the columns. I wondered if the was coming because the ForeignKey is to a object, but when I these models in the Django (including inlines for of column it displays and me to add links just fine. Traceback: File "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request) File "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/base.py" _get_response 126. self.process_exception_by_middleware(e, request) "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/base.py" _get_response response = wrapped_callback(request, File "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/views
template_items = ForeignKey('TeMplateItemS', relaTed_NamE='fOoteR_linKs_col_3', null=True, oN_DeleTe=models.SET_NULL)

class FoOterLInKcol4(FOOtErLinK):
    templaTE_iTEMs = FOrEiGnKEy('tEmPlateiteMs', relatEd_name='footEr_lInKs_col_4', null=TruE, On_Delete=modeLs.SeT_NULL)

MigratIonS are crEaTed ANd migRatEd sucCessfuLLy, but wHen I go to tHe tEmplatEitems seTTInGs obJect in the Wagtail aDMiN In order to add foOter liNkS, i rECEivE thE following ErRor:

KeYerror at /ADmIN/SEttINgs/main/templaTeitems/2/
'footER_liNks_col_1'

if i coMMent ouT any oF tHE foOter_links_coL_X itEms, then I rEceive THe error FOr the fiRst one ThaT is Not cOMmEnTed OuT.  theRE aRe nO ExiSting fooTeR lInks iN the DATABase For Any oF the cOlumns.  I wonderEd iF the PRobLem waS comiNg beCaUse thE ForeiGnKey Is To a BaseSetting oBjecT, but when I DecLaRe tHeSe modELs in thE DjAngO admin (iNcludinG The InLINEs For each of the column LiNKS), iT displayS and alLOwS mE To add linKs JusT finE.
tRacebAck:

FILe
  "/Opt/virtuAlenvs/my_SiTe-a0hNfZxL/lIb/pythOn3.6/SitE-paCkageS/DjanGo/core/Handlers/ExcepTIon.py"
  in inner
    34.             reSPonse = get_respoNSe(REQuESt)
FiLe
  "/oPt/virtualenVs/MY_siTE-a0HNfZXL/lIb/pYThon3.6/sIte-paCkAGeS/Django/core/handlers/bAsE.py"
  in _gEt_resPonse
    126.                 response = Self.procesS_EXCeption_bY_midDLeWAre(e, request)
FilE
  "/opt/vIrtualenvs/my_SITE-a0hNFZxl/lIb/python3.6/Site-packaGES/django/cOre/HanDleRs/bASE.pY"
  in _get_responsE
    124.                 REspoNsE = wrappeD_caLlback(rEquEst, *CalLbaCk_Args, **callbAck_kwargS)
FIlE
  "/oPt/VirTualeNVs/MY_SITE-A0hnfZXl/Lib/PythoN3.6/Site-paCkageS/djaNgO/vIEws
template_items = ForeignKe y('Templat eItem s',  re la ted_ name ='footer_links _ col_ 3', null=True, on_dele te=mo de l s.SE T _N ULL)
classF oo t e rLi nk Co l4( Fo o te rLink ):    tem plate_item s =  F oreignKey('T e mp lateItems' , r elated_name= 'fo oter_l in ks_ c ol_4' , n ull=T rue, o n _delet e=models. SE T _NULL) 
Migrat i o ns  are  created and migr a te d  successfully,  but w he n  I g o t o t he Templat eI temss ettings ob j e c t i n  the Wagtailadmin in or d erto add  f oot e r link s, Ire c eiv e the follo wing  error:
KeyErr o r at /a d min/set tings/ mai n/t empl a te it ems /2 / 
'f o ot er_ l ink s_col_1' 
If  I co mmen t o u t an y o f th e foo ter_links_col _Xitem s , t hen I  rece iveth e err or for  thefi rst one that is  not  commente d o ut . Th ere a r e no e xis tin g foote r links inth e d at abase for any of t he c ol umns.  I  wonde r ed  i f  the pro bl emwasc o mingbeca u se  the For eignKe y  i sto a Ba se Settin gobj ect , but when  I dec lare the se mo d els in the Dja n go admin (inc l ud i n gt he i nli nes for eac h of thecolu m nlin k s), i t dis pl a ys and allows me to ad dlinksjustfine.
Traceba ck:

File" /opt/vir tual e nv s /MY_SITE-a0hNf Zxl/l ib/python3 . 6/site-p ackag es/djang o/core/ha n d lers/exc ept ion .py "
i ninner
    34.          re spo nse = g et_ res pon se( re quest)
Fi le
  "/o pt /v ir tu ale nvs/M Y _SITE-a0 hN fZx l/ lib /pyth o n3.6/s ite-p acka ge s/ d jan go/core / ha n d lers /b as e.py "
 i n _ge t_re s pon se
   126.           respons e = self.proc es s_exceptio n_ by_ middle w a re(e, re quest)
File
  "/opt/vir t ualenvs /MY _SITE -a0h NfZxl/lib /py thon3. 6/s i te-pac kages/ djang o/ cor e / handl e r s/ bas e. py"
  in _ g e t_r espon se 
   124.                res p ons e = wrapped_c all back ( r eq ues t ,* cal lb a ck_ a r gs, **callback_ kwargs)
Fi le  "/opt/virt u ale nv s/MY_SI TE-a0hN fZxl/ l ib/pyth on3.6/sit e-package s/ djan g o /vi ews
template_items =_ForeignKey('TemplateItems', related_name='footer_links_col_3',_null=True, on_delete=models.SET_NULL)

class FooterLinkCol4(FooterLink):
 _ _template_items_= ForeignKey('TemplateItems',_related_name='footer_links_col_4',_null=True, on_delete=models.SET_NULL)

Migrations are_created and migrated_successfully, but when I_go to the_TemplateItems_settings object in the Wagtail admin in order to add footer links, I receive_the_following error:

KeyError_at_/admin/settings/main/templateitems/2/
'footer_links_col_1'

If_I comment out any of_the footer_links_col_X items, then I_receive the_error for the first one that is not_commented_out.  There_are no existing footer links in the database for_any of the columns.  I_wondered if the_problem_was_coming because the ForeignKey_is to a BaseSetting object, but_when I declare these models in_the Django admin (including the inlines for_each of the column links), it_displays and allows me to_add links_just fine.
Traceback:

File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/exception.py"
 _in inner
 _ _34.  _     _  _ response = get_response(request)
File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/base.py"
__in _get_response
 ___126. _  __ __     __ response = self.process_exception_by_middleware(e, request)
File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/core/handlers/base.py"
_ in _get_response
 __ 124.  _    _     _ _ response_= wrapped_callback(request, *callback_args, **callback_kwargs)
File
  "/opt/virtualenvs/MY_SITE-a0hNfZxl/lib/python3.6/site-packages/django/views