title: AttributeError type object has no attribute
body: <p>So I'm trying to open and print data from this JSON file using this code in my view:</p>
  
  <pre><code>    from django.shortcuts import render
  import json
  
  class OnlicarView():
      import json
      from pprint import pprint
  
      with open('C:/Python34/Scripts/onlicar/mytest/onlicar/static/json/vehicles.json') as data_file:
          data = json.load(data_file)
  
      pprint(data)
  </code></pre>
  
  <p>Here is my app url:</p>
  
  <pre><code>from django.conf.urls import url
  from onlicar import views
  
  urlpatterns = [
      url(r'^onlicar/$', views.OnlicarView.as_view(), name='onlicar_signup'
         )
  ]
  </code></pre>
  
  <p>Here is my root url:</p>
  
  <pre><code>from django.conf.urls import url, include
  from django.contrib import admin
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^onlicar/', include('onlicar.urls'))
  </code></pre>
  
  <p>I am having trouble with the app url. I am getting an error saying that there is an Attribute Error and I don't know how to fix it.</p>
  
  <p>Because I am getting the data from a JSON file there is nothing in my models at the moment. Am I meant to have something in the models?</p>
  
  <p>My JSON file is printing now, but how do I render it to HTML instead?</p>
  
  <p>Here is the error:</p>
  
  <pre><code>Unhandled exception in thread started by &lt;function check_errors.&lt;locals&gt;.
   at 0x03F9C4B0&gt;
  Traceback (most recent call last):
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\utils\autore
  ", line 226, in wrapper
      fn(*args, **kwargs)
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\core\managem
  mands\runserver.py", line 121, in inner_run
      self.check(display_num_errors=True)
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\core\managem
  e.py", line 374, in check
      include_deployment_checks=include_deployment_checks,
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\core\managem
  e.py", line 361, in _run_checks
      return checks.run_checks(**kwargs)
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\core\checks\
  y.py", line 81, in run_checks
      new_errors = check(app_configs=app_configs)
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\core\checks\
  ", line 14, in check_url_config
      return check_resolver(resolver)
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\core\checks\
  ", line 24, in check_resolver
      for pattern in resolver.url_patterns:
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\utils\functi
  ", line 35, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\urls\resolve
   line 313, in url_patterns
      patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_m
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\utils\functi
  ", line 35, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\urls\resolve
   line 306, in urlconf_module
      return import_module(self.urlconf_name)
    File "C:\Python34\Scripts\onlicar\lib\importlib\__init__.py", line 109,
  ort_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 2254, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 2226, in _find_and_load_unlo
    File "&lt;frozen importlib._bootstrap&gt;", line 1200, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1129, in _exec
    File "&lt;frozen importlib._bootstrap&gt;", line 1471, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 321, in _call_with_frames_re
    File "C:\Python34\Scripts\onlicar\mytest\mytest\urls.py", line 21, in &lt;
  
      url(r'^onlicar/', include('onlicar.urls'))
    File "C:\Python34\Scripts\onlicar\lib\site-packages\django\conf\urls\__
  py", line 50, in include
      urlconf_module = import_module(urlconf_module)
    File "C:\Python34\Scripts\onlicar\lib\importlib\__init__.py", line 109,
  ort_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "&lt;frozen importlib._bootstrap&gt;", line 2254, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 2237, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 2226, in _find_and_load_unlo
    File "&lt;frozen importlib._bootstrap&gt;", line 1200, in _load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 1129, in _exec
    File "&lt;frozen importlib._bootstrap&gt;", line 1471, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 321, in _call_with_frames_re
    File "C:\Python34\Scripts\onlicar\mytest\onlicar\urls.py", line 5, in &lt;
  
      url(r'^onlicar/$', views.OnlicarView.as_view(), name='onlicar_signup'
  AttributeError: type object 'OnlicarView' has no attribute 'as_view'
  </code></pre>