title: Django - Import views from separate apps
body: <p>I'm new to Django and working my way through "The Django Book" by Holovaty and Kaplan-Moss.  I have a project called "mysite" that contains two applications called "books" and "contact."  Each has its own view.py file.  In my urls.py file I have the following:</p>
  
  <pre><code>from books import views
  from contact import views
  ...
  urlpatterns = patterns('',
  ...
  (r'^search/$', views.search),
  (r'^contact/$', views.contact),
  ...
  </code></pre>
  
  <p>When I run my code I get this error:</p>
  
  <p>NameError at /search/
  ...
  Exception value: 'module' object has no attribute 'search'</p>
  
  <p>What I believe is happening is that since views from contact was imported last, Django is looking at contact's view which does not contain search (search is in books' view).</p>
  
  <p>What is the proper way to import the views.py file from two distinct applications within a Django urls file?</p>
  
  <p>Thanks for your help!</p>