title: Django show error : "name 'dif_months_without_date' is not defined" though defined
body: <p>I make the first django app and get error:
  NameError: name 'get_date' is not defined
  My structure:</p>
  <ul>
  <li>app
  <ul>
  <li>person
  <ul>
  <li>views.py</li>
  <li>models.py</li>
  </ul>
  </li>
  <li>my_core
  <ul>
  <li>common.py</li>
  </ul>
  </li>
  </ul>
  </li>
  </ul>
  <p>In common.py, i defined</p>
  <pre><code>def get_date():
      return &quot;something&quot;
  </code></pre>
  <p>When i call get_date() def in views.py, it is ok, but call it in models.py it show error.
  In both views.py and models.py imported :</p>
  <pre><code>from my_core.common import *
  </code></pre>
  <p>What am i missing?
  This is error in console:</p>
  <blockquote>
  <p>Traceback (most recent call last):   File
  &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/handlers/exception.py&quot;,
  line 47, in inner
  response = get_response(request)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/handlers/base.py&quot;,
  line 181, in _get_response
  response = wrapped_callback(request, *callback_args, **callback_kwargs)   File &quot;/Applications/MAMP/htdocs/first-app/app/person/views.py&quot;, line 228,
  in ajax_get_data
  'person_status_list' : PERSON_STATUS   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/backends/django.py&quot;,
  line 61, in render
  return self.template.render(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 170, in render
  return self._render(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 162, in _render
  return self.nodelist.render(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 938, in render
  bit = node.render_annotated(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 905, in render_annotated
  return self.render(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/defaulttags.py&quot;,
  line 315, in render
  return nodelist.render(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 938, in render
  bit = node.render_annotated(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 905, in render_annotated
  return self.render(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/defaulttags.py&quot;,
  line 214, in render
  nodelist.append(node.render_annotated(context))   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 905, in render_annotated
  return self.render(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 988, in render
  output = self.filter_expression.resolve(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 671, in resolve
  obj = self.var.resolve(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 796, in resolve
  value = self._resolve_lookup(context)   File &quot;/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py&quot;,
  line 837, in _resolve_lookup
  current = getattr(current, bit)   File &quot;/Applications/MAMP/htdocs/first-app/app/person/models.py&quot;, line 87,
  in continue_months
  return get_date() NameError: name 'get_date' is not defined</p>
  </blockquote>