{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/87375528677f700bddafd5d4eca58205?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"87375528677f700bddafd5d4eca58205","url":"https://api.github.com/users/vanschelven","login":"vanschelven","id":223833},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-11-02T16:27:49Z","comments":0,"closed_at":null,"url":"https://api.github.com/repos/pydanny/django-uni-form/issues/116","body":"Hi,\r\n\r\nWhen using the django-uni-form templatetags through add_to_builtins in settings.py (the most logical location for using add_to_builtins) the server fails to start.\r\n\r\nThis is a new bug since after 0.7.0.\r\n\r\nIt is caused by the use of get_template in the templatetags modules. Since get_template is called at module load-time and get_template requires settings.py to have been fully loaded your code cannot be imported from settings.py.\r\n\r\nAn example of a call to get_template at module root (i.e. not inside some function) is:\r\nhttps://github.com/pydanny/django-uni-form/blob/master/uni_form/templatetags/uni_form_tags.py#L142\r\nBut there are more, grepping will quickly reveal them.\r\n\r\nA simple solution would be to make the associated variables lazily initialized, i.e. set them as None at module-load time and always access them via some getter that checks their value. If necessary I could provide this code for you.","html_url":"https://github.com/pydanny/django-uni-form/issues/116","number":116,"title":"add_to_builtins in settings.py fails","id":2123315,"created_at":"2011-11-02T16:27:49Z"},"action":"opened"}