title: NameError: name 'BookAdmin' is not defined - Django
body: <p>I'm using Django and Python 3.6 I had this Error: NameError: name 'BookAdmin' is not defined and </p>
  
  <p>this my code (models.py) in 'store' app.</p>
  
  <pre><code>from django.db import models
  from django.utils import timezone
  
  class Book(models.Model):
       title = models.CharField(max_length=200)
       author = models.CharField(max_length=200)
       description = models.TextField()   
       publish_date = models.DateField(default=timezone.now)
  </code></pre>
  
  <p>and in admin.py</p>
  
  <pre><code>from django.contrib import admin
  
  from .models import Book
  
  class BookAdmin(admin.ModelAdmin):
      list_display = ('title', 'author')
  
      admin.site.register(Book, BookAdmin)
  </code></pre>
  
  <p>And the Error is </p>
  
  <pre><code>    File "C:\venv\lib\site-packages\django\__init__.py", line 27, in setup
      apps.populate(settings.INSTALLED_APPS)
    File "C:\venv\lib\site-packages\django\apps\registry.py", line 115, in populate
      app_config.ready()
    File "C:\venv\lib\site-packages\django\contrib\admin\apps.py", line 23, in ready
      self.module.autodiscover()
    File "C:\venv\lib\site-packages\django\contrib\admin\__init__.py", line 26, in autodiscover
      autodiscover_modules('admin', register_to=site)
    File "C:\venv\lib\site-packages\django\utils\module_loading.py", line 50, in autodiscover_modules
      import_module('%s.%s' % (app_config.name, module_to_search))
    File "C:\venv\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 978, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 961, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 950, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 655, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 678, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 205, in _call_with_frames_removed
    File "C:\venv\bookstore\store\admin.py", line 5, in &lt;module&gt;
      class BookAdmin(admin.ModelAdmin):
    File "C:\venv\bookstore\store\admin.py", line 8, in BookAdmin
      admin.site.register(Book, BookAdmin)
  NameError: name 'BookAdmin' is not defined
  </code></pre>