title: Relative imports require the 'package' argument
body: <p>I want to use Sphinx so it can automatically generate a pydoc for my python code but I'm getting an error. What an I doing wrong?</p>
  
  <p><strong>conf.py</strong> sphinx config file</p>
  
  <pre><code>import sys
  import os
  from django.conf import settings
  os.environ['DJANGO_SETTINGS_MODULE'] = '../cloud_server.settings'
  
  sys.path.insert(0, os.path.abspath('../cloud_server/cloud_api'))
  </code></pre>
  
  <p><strong>views.py</strong> django file</p>
  
  <pre><code>from django.contrib.auth.models import User, Group
  from rest_framework import viewsets
  from cloud_api.serializers import UserSerializer, GroupSerializer
  
  
  class UserViewSet(viewsets.ModelViewSet):
      """
      API endpoint that allows users to be viewed or edited.
      """
      queryset = User.objects.all()
      serializer_class = UserSerializer
  
  
  class GroupViewSet(viewsets.ModelViewSet):
      """
      API endpoint that allows users to be viewed or edited.
      """
      queryset = Group.objects.all()
      serializer_class = GroupSerializer
  </code></pre>
  
  <p><strong>Typeerror</strong> error thrown when I'm trying to make the html file.</p>
  
  <pre><code>    C:\Users\ogward\STUDPROJ\docs\code.rst:3: WARNING: autodoc: failed to import module u'views'; the following exception wa
  s raised:
  Traceback (most recent call last):
    File "C:\Python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\ext\autodoc.py", line 335, in import_object
      __import__(self.modname)
    File "C:\Users\ogward\STUDPROJ\cloud_server\cloud_api\views.py", line 1, in &lt;module&gt;
      from django.contrib.auth.models import User, Group
    File "C:\Python27\lib\site-packages\django\contrib\auth\__init__.py", line 6, in &lt;module&gt;
      from django.middleware.csrf import rotate_token
    File "C:\Python27\lib\site-packages\django\middleware\csrf.py", line 14, in &lt;module&gt;
      from django.utils.cache import patch_vary_headers
    File "C:\Python27\lib\site-packages\django\utils\cache.py", line 26, in &lt;module&gt;
      from django.core.cache import get_cache
    File "C:\Python27\lib\site-packages\django\core\cache\__init__.py", line 69, in &lt;module&gt;
      if DEFAULT_CACHE_ALIAS not in settings.CACHES:
    File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 54, in __getattr__
      self._setup(name)
    File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 49, in _setup
      self._wrapped = Settings(settings_module)
    File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 128, in __init__
      mod = importlib.import_module(self.SETTINGS_MODULE)
    File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 33, in import_module
      raise TypeError("relative imports require the 'package' argument")
  TypeError: relative imports require the 'package' argument
  looking for now-outdated files... none found
  pickling environment... done
  checking consistency... done
  preparing documents... done
  writing output... [ 50%] code
  writing output... [100%] index
  
  writing additional files... genindex search
  copying static files... done
  copying extra files... done
  dumping search index... done
  dumping object inventory... done
  build succeeded, 1 warning.
  </code></pre>