Why can't I import a module from within the same directory?
<p>If I have two python modules in a directory <code>main.py</code> and <code>somemodule.py</code>, I can import <code>somemodule</code> by using <code>import somemodule</code>.</p>

<p><code>./
  main.py
  somemodule.py
  __init__.py</code></p>

<p>In django application where we have <code>urls.py</code> and <code>views.py</code>, why won't <code>import views</code> work in this case? But relative import <code>from . import views</code> works?</p>

<p>That's because of python 3 import style and is irrelevant to Django.</p>

<p>Read this for more details:
<a href="http://stackoverflow.com/questions/12172791/changes-in-import-statement-python3">Changes in import statement python3</a></p>

python python-3.x python-import