Fix circular dependencies in dashboard settings
Fix circular dependencies in dashboard settings

Importing horizon.utils from dashboard local_settings.py to generate
SECRET_KEY results in a sequence of imports, and horizon.conf.default
module gets imported at some point. During initialization of default
HORIZON_CONFIG this module uses settings.LOGIN_REDIRECT_URL and
ugettext() call. Both of them need django settings to be ready to use,
therefore settings initialization starts again before it could finish.

Since Python processes module only when it is imported the first time,
this process stops, but the 'inner' settings object contains only
parameters that were set above the point of import of local_settings.
Therefore Django complains about missing SECRET_KEY when it processes
'inner' settings.

The fix moves the import of horizon.conf.default to
LazySetting._setup(). If keys of HORIZON_CONFIG obtained from
horizon.conf are not used within openstask_dashboard settings.py
or local_settings.py, the circular import won't happen.

Fixes bug #1154564

Change-Id: If63ab1920ecc8e646fd5b6cc52c106ae0876fa2d

Dark-Hacker/horizon,watonyweng/horizon,promptworks/horizon,maestro-hybrid-cloud/horizon,coreycb/horizon,newrocknj/horizon,idjaw/horizon,icloudrnd/automation_tools,tellesnobrega/horizon,yjxtogo/horizon,bigswitch/horizon,tanglei528/horizon,redhat-cip/horizon,FNST-OpenStack/horizon,vladryk/horizon,wolverineav/horizon,NeCTAR-RC/horizon,endorphinl/horizon,zouyapeng/horizon,spring-week-topos/horizon-week,bigswitch/horizon,xinwu/horizon,mrunge/openstack_horizon,philoniare/horizon,damien-dg/horizon,tsufiev/horizon,mdavid/horizon,noironetworks/horizon,flochaz/horizon,tanglei528/horizon,dan1/horizon-proto,redhat-cip/horizon,rickerc/horizon_audit,j4/horizon,tuskar/tuskar-ui,Solinea/horizon,flochaz/horizon,tqtran7/horizon,mrunge/openstack_horizon,Tesora/tesora-horizon,blueboxgroup/horizon,saydulk/horizon,blueboxgroup/horizon,FNST-OpenStack/horizon,saydulk/horizon,takeshineshiro/horizon,r-icarus/openstack_microserver,mdavid/horizon,noironetworks/horizon,sandvine/horizon,froyobin/horizon,ChameleonCloud/horizon,openstack/horizon,dan1/horizon-proto,newrocknj/horizon,watonyweng/horizon,eayunstack/horizon,pranavtendolkr/horizon,luhanhan/horizon,luhanhan/horizon,dan1/horizon-proto,endorphinl/horizon-fork,bigswitch/horizon,spring-week-topos/horizon-week,spring-week-topos/horizon-week,blueboxgroup/horizon,saydulk/horizon,openstack/horizon,doug-fish/horizon,Tesora/tesora-horizon,RudoCris/horizon,FNST-OpenStack/horizon,mrunge/horizon_lib,kfox1111/horizon,tuskar/tuskar-ui,henaras/horizon,Mirantis/mos-horizon,wolverineav/horizon,j4/horizon,redhat-openstack/horizon,RudoCris/horizon,icloudrnd/automation_tools,Solinea/horizon,takeshineshiro/horizon,r-icarus/openstack_microserver,philoniare/horizon,VaneCloud/horizon,bac/horizon,endorphinl/horizon-fork,rdo-management/tuskar-ui,tsufiev/horizon,noironetworks/horizon,anthonydillon/horizon,gochist/horizon,ChameleonCloud/horizon,kfox1111/horizon,henaras/horizon,vladryk/horizon,damien-dg/horizon,zouyapeng/horizon,mrunge/horizon_lib,CiscoSystems/horizon,yeming233/horizon,orbitfp7/horizon,ging/horizon,j4/horizon,Metaswitch/horizon,henaras/horizon,icloudrnd/automation_tools,django-leonardo/horizon,davidcusatis/horizon,mandeepdhami/horizon,django-leonardo/horizon,newrocknj/horizon,JioCloud/horizon,redhat-cip/horizon,maestro-hybrid-cloud/horizon,coreycb/horizon,agileblaze/OpenStackTwoFactorAuthentication,CiscoSystems/avos,wangxiangyu/horizon,xme1226/horizon,CiscoSystems/avos,nvoron23/avos,izadorozhna/dashboard_integration_tests,CiscoSystems/horizon,flochaz/horizon,izadorozhna/dashboard_integration_tests,xme1226/horizon,xme1226/horizon,nvoron23/avos,BiznetGIO/horizon,tellesnobrega/horizon,Dark-Hacker/horizon,r-icarus/openstack_microserver,kaiweifan/horizon,rdo-management/tuskar-ui,Mirantis/mos-horizon,maestro-hybrid-cloud/horizon,endorphinl/horizon,endorphinl/horizon-fork,wangxiangyu/horizon,dan1/horizon-proto,Hodorable/0602,watonyweng/horizon,Metaswitch/horizon,ChameleonCloud/horizon,NeCTAR-RC/horizon,liyitest/rr,noironetworks/horizon,Hodorable/0602,promptworks/horizon,Daniex/horizon,luhanhan/horizon,sandvine/horizon,Solinea/horizon,Hodorable/0602,Daniex/horizon,pranavtendolkr/horizon,tqtran7/horizon,yeming233/horizon,doug-fish/horizon,tuskar/tuskar-ui,damien-dg/horizon,pranavtendolkr/horizon,yanheven/console,redhat-cip/horizon,davidcusatis/horizon,anthonydillon/horizon,tellesnobrega/horizon,ChameleonCloud/horizon,kaiweifan/horizon,saydulk/horizon,Daniex/horizon,openstack/horizon,maestro-hybrid-cloud/horizon,coreycb/horizon,rdo-management/tuskar-ui,Dark-Hacker/horizon,Metaswitch/horizon,citrix-openstack-build/horizon,damien-dg/horizon,idjaw/horizon,gerrive/horizon,ging/horizon,FNST-OpenStack/horizon,luhanhan/horizon,openstack-ja/horizon,netscaler/horizon,NCI-Cloud/horizon,netscaler/horizon,JioCloud/horizon,takeshineshiro/horizon,redhat-openstack/horizon,agileblaze/OpenStackTwoFactorAuthentication,mdavid/horizon,wangxiangyu/horizon,liyitest/rr,ikargis/horizon_fod,CiscoSystems/horizon,yeming233/horizon,bigswitch/horizon,aaronorosen/horizon-congress,endorphinl/horizon,yanheven/console,dan1/horizon-x509,doug-fish/horizon,dan1/horizon-x509,BiznetGIO/horizon,newrocknj/horizon,Mirantis/mos-horizon,nvoron23/avos,mrunge/horizon,anthonydillon/horizon,henaras/horizon,bac/horizon,blueboxgroup/horizon,xinwu/horizon,gerrive/horizon,agileblaze/OpenStackTwoFactorAuthentication,wolverineav/horizon,karthik-suresh/horizon,Metaswitch/horizon,kfox1111/horizon,tanglei528/horizon,CiscoSystems/horizon,bac/horizon,mandeepdhami/horizon,watonyweng/horizon,rickerc/horizon_audit,vladryk/horizon,redhat-openstack/horizon,VaneCloud/horizon,yanheven/console,karthik-suresh/horizon,Frostman/eho-horizon,vladryk/horizon,NCI-Cloud/horizon,rickerc/horizon_audit,xinwu/horizon,idjaw/horizon,coreycb/horizon,mandeepdhami/horizon,promptworks/horizon,yeming233/horizon,dan1/horizon-x509,icloudrnd/automation_tools,karthik-suresh/horizon,tellesnobrega/horizon,citrix-openstack-build/horizon,gochist/horizon,mrunge/horizon,django-leonardo/horizon,kaiweifan/horizon,django-leonardo/horizon,Frostman/eho-horizon,orbitfp7/horizon,ging/horizon,openstack/horizon,mrunge/horizon_lib,zouyapeng/horizon,Solinea/horizon,tqtran7/horizon,NCI-Cloud/horizon,eayunstack/horizon,Tesora/tesora-horizon,Daniex/horizon,openstack-ja/horizon,sandvine/horizon,orbitfp7/horizon,CiscoSystems/avos,ikargis/horizon_fod,gerrive/horizon,kfox1111/horizon,ging/horizon,aaronorosen/horizon-congress,mrunge/horizon,VaneCloud/horizon,pranavtendolkr/horizon,flochaz/horizon,mrunge/openstack_horizon,Dark-Hacker/horizon,davidcusatis/horizon,xinwu/horizon,mdavid/horizon,eayunstack/horizon,JioCloud/horizon,NeCTAR-RC/horizon,openstack-ja/horizon,NCI-Cloud/horizon,VaneCloud/horizon,j4/horizon,philoniare/horizon,gochist/horizon,CiscoSystems/avos,orbitfp7/horizon,RudoCris/horizon,promptworks/horizon,tsufiev/horizon,RudoCris/horizon,philoniare/horizon,NeCTAR-RC/horizon,zouyapeng/horizon,yjxtogo/horizon,endorphinl/horizon-fork,rdo-management/tuskar-ui,Tesora/tesora-horizon,karthik-suresh/horizon,froyobin/horizon,yjxtogo/horizon,endorphinl/horizon,liyitest/rr,BiznetGIO/horizon,yjxtogo/horizon,idjaw/horizon,nvoron23/avos,liyitest/rr,tsufiev/horizon,takeshineshiro/horizon,anthonydillon/horizon,sandvine/horizon,Hodorable/0602,tqtran7/horizon,BiznetGIO/horizon,wolverineav/horizon,Frostman/eho-horizon,davidcusatis/horizon,Mirantis/mos-horizon,ikargis/horizon_fod,gerrive/horizon,mandeepdhami/horizon,bac/horizon,agileblaze/OpenStackTwoFactorAuthentication,netscaler/horizon,doug-fish/horizon,wangxiangyu/horizon,redhat-openstack/horizon,dan1/horizon-x509,citrix-openstack-build/horizon,froyobin/horizon,aaronorosen/horizon-congress