title: when I execute the python manage.py runserver, CMD throws AttributeError:
body: <p>I am new to Django! So I built a simple blog application using python/Django, MySQL as the back end using the XAMPP control panel. It was running as expected on http://localhost:8000. However, at the end of project when I added a Button functionality &amp; restarted(python manage.py runserver) the server using the CMD. The CMD threw: AttributeError: module 'posts.views' has no attribute 'details'.</p>
  <p>Your help wold be appreciated!</p>
  <p>-Attached is the project on GitHub.</p>
  <p>urls.py file:</p>
  <pre><code>from django.conf.urls import url
  from . import views
  
  urlpatterns = [
  url(r'^$', views.index, name='index'),
  url(r'^details/(?P&lt;id&gt;\d+)/$', views.details, name='details')
  ]
  </code></pre>
  <p>views.py file:</p>
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponse
  
  from .models import Posts
  
  # Create your views here.
  def index(request):
  # return HttpResponse('HELLO FROM POSTS')
  
  posts = Posts.objects.all()[:10]
  
  context = {
     'title': 'Latest Posts',
     'posts': posts
  }
  
  return render(request, 'posts/index.html', context)
  
  def details(request, id):
     post = Posts.object.get(id=id)
  
     context = {
         'post': post
     }
  
     return render(request, 'posts/details.html', context)
  </code></pre>
  <p>details.py file:</p>
  <pre><code>{% extends 'posts/layout.html' %}
  
  {% block content%}
  &lt;h3 class=&quot;center-align red lighten-3&quot;&gt;{{post.title}}&lt;/h3&gt;
  &lt;div class = &quot;card&quot;&gt;
  &lt;div class=&quot;card-content&quot;&gt;
      {{post.body}}
  &lt;/div&gt;
  &lt;div class=&quot;card-action&quot;&gt;
      {{post.created_at}}
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;a href=&quot;/posts&quot; class=&quot;btn&quot;&gt;Go Back&lt;/a&gt;
  {% endblock %}
  </code></pre>
  <p>Error stacktrace:</p>
  <pre><code>(py1) C:\Users\Ajmal .M\Google Drive\GitHub\Projects\djangoproject&gt;python manage.py runserver
  Watching for file changes with StatReloader
  Performing system checks...
  
  Exception in thread django-main-thread:
  Traceback (most recent call last):
  File &quot;c:\users\ajmal .m\appdata\local\programs\python\python38\lib\threading.py&quot;, line 932, in 
  _bootstrap_inner
  self.run()
  File &quot;c:\users\ajmal .m\appdata\local\programs\python\python38\lib\threading.py&quot;, line 870, in run
  self._target(*self._args, **self._kwargs)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\utils\autoreload.py&quot;, line 53, in wrapper
  fn(*args, **kwargs)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\core\management\commands\runserver.py&quot;, 
  line 117, in inner_run
  self.check(display_num_errors=True)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\core\management\base.py&quot;, line 392, in 
  check
  all_issues = self._run_checks(
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\core\management\base.py&quot;, line 382, in 
  _run_checks
  return checks.run_checks(**kwargs)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\core\checks\registry.py&quot;, line 72, in 
  run_checks
  new_errors = check(app_configs=app_configs)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\core\checks\urls.py&quot;, line 13, in 
  check_url_config
  return check_resolver(resolver)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\core\checks\urls.py&quot;, line 23, in 
  check_resolver
  return check_method()
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\urls\resolvers.py&quot;, line 407, in check
  for pattern in self.url_patterns:
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\utils\functional.py&quot;, line 48, in __get__
  res = instance.__dict__[self.name] = self.func(instance)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\urls\resolvers.py&quot;, line 588, in 
  url_patterns
  patterns = getattr(self.urlconf_module, &quot;urlpatterns&quot;, self.urlconf_module)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\utils\functional.py&quot;, line 48, in __get__
  res = instance.__dict__[self.name] = self.func(instance)
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\urls\resolvers.py&quot;, line 581, in 
  urlconf_module
  return import_module(self.urlconf_name)
  File &quot;c:\users\ajmal .m\appdata\local\programs\python\python38\lib\importlib\__init__.py&quot;, line 127, 
  in import_module
  return _bootstrap._gcd_import(name[level:], package, level)
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1014, in _gcd_import
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 991, in _find_and_load
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 975, in _find_and_load_unlocked
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 671, in _load_unlocked
  File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 783, in exec_module
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
  File &quot;C:\Users\Ajmal .M\Google Drive\GitHub\Projects\djangoproject\djangoproject\urls.py&quot;, line 5, in 
  &lt;module&gt;
  url(r'^$', include('posts.urls')),
  File &quot;C:\Users\Ajmal .M\Envs\py1\lib\site-packages\django\urls\conf.py&quot;, line 34, in include
  urlconf_module = import_module(urlconf_module)
  File &quot;c:\users\ajmal .m\appdata\local\programs\python\python38\lib\importlib\__init__.py&quot;, line 127, 
  in import_module
  return _bootstrap._gcd_import(name[level:], package, level)
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1014, in _gcd_import
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 991, in _find_and_load
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 975, in _find_and_load_unlocked
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 671, in _load_unlocked
  File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 783, in exec_module
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
  File &quot;C:\Users\Ajmal .M\Google Drive\GitHub\Projects\djangoproject\posts\urls.py&quot;, line 6, in 
  &lt;module&gt;
  url(r'^details/(?P&lt;id&gt;\d+)/$', views.details, name='details')
  AttributeError: module 'posts.views' has no attribute 'details'
  </code></pre>
  <p><a href="https://github.com/Alex-Moh/Google-Drive" rel="nofollow noreferrer">GitHub Link for the Project files</a></p>