Could not import site.views. Error was: No module named views
<p>DIRS</p>

<p><strong>./ksp</strong></p>

<pre><code>__init__.py
jquery.pngFix.js
manage.py
passenger_wsgi.py
settings.py
site/
site_media/
templates/
tmp/
urls.py
</code></pre>

<p><strong>./ksp/site</strong>  </p>

<pre><code>__init__.py
models.py
models_.py
myforms.py
urls.py
views.py
views_back.py
</code></pre>

<p>FILES</p>

<p><strong>./ksp/passenger_wsgi.py:</strong></p>

<pre><code>import os, sys
sys.path.insert(0,'/usr/lib/python2.7/site-packages/django-1.3')
sys.path.append('/home/p/pravicom/ksp/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
</code></pre>

<p><strong>./ksp/urls.py:</strong></p>

<pre><code>from django.conf.urls.defaults import *
urlpatterns = patterns('',
    ('', include('site.urls')),
)
</code></pre>

<p><strong>./ksp/site/urls.py:</strong></p>

<pre><code>import views
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib.auth.views import login, logout

urlpatterns = patterns('',
    (r'^$', 'views.ShowMain'),
#....
)

urlpatterns += patterns('',
    (r'^site_media/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)
</code></pre>

<p><strong>./ksp/site/views.py:</strong></p>

<pre><code>from django.shortcuts import render_to_response
from models import *
from myforms import *
from django.http import HttpResponseRedirect, HttpRequest
from django import forms
from django.template import RequestContext
from django.contrib.auth.models import User
from django.contrib import auth
from django.contrib.auth.decorators import login_required
import os, urlparse, Image, sys
from django.core.paginator import Paginator, InvalidPage, EmptyPage


def custom_proc(request):
    return{
        'user': request.user
    }

def ShowMain(request):
    all_posts = Posts.objects.all().order_by('-id')

    return render_to_response("index.html", {'all_posts':all_posts}, context_instance=RequestContext(request, processors=[custom_proc]))
</code></pre>

<p><strong>./ksp/settings.py:</strong></p>

<pre><code>...
ROOT_URLCONF = 'urls'
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
#    'django.contrib.sites',
#    'django.contrib.flatpages',
    'django.contrib.comments',
    'site',
)
...
</code></pre>

<p>Result:</p>

<p>Exception Type: ViewDoesNotExist
Exception Value:<br>
Could not import site.views. Error was: No module named views</p>
