Looks like I got it figured out ...

The problem was in urls.py file in /var/www/polls/pollngo in this line:

urlpatterns = patterns('polls.views',

I changed it to

urlpatterns = patterns('polls.pollngo.views',

and it started to work!  Yey!


Tonu

Tonu Mikk wrote:
> Hello,
>
> I am trying to port a django project that is working with development 
> server to be served from Apache Virtual Host, but having some trouble 
> configuring the correct directories.  Any help is appreciated.  This is 
> with Django version 1, Apache 2.2 + mod_python.
>
> The virtual host is at polls.dmc.umn.edu .  It has following directives:
> DocumentRoot /var/www/polls
> ServerName polls.dmc.umn.edu
> <Directory "/var/www/polls">
> allow from all
> Options None
> </Directory>
> <Location "/">
>     SetHandler python-program
>     PythonHandler django.core.handlers.modpython
>     PythonPath "['/var/www'] + sys.path"
>     SetEnv DJANGO_SETTINGS_MODULE polls.settings
>     PythonDebug On
> </Location>
>
> The root url in setting.py is  ROOT_URLCONF = 'polls.urls'
> The urls.py in /var/www/polls is
>
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
>     # Example:
>     (r'^', include('polls.pollngo.urls')),
>
> The urls.py in /var/www/polls/pollngo is
> from django.conf.urls.defaults import *
> from django.views.generic.simple import direct_to_template
>
> urlpatterns = patterns('polls.views',
>     (r'^$', 'index'),
>     (r'^poll/(?P<slug>[^\.^/]+)/$', 'question'),
>     (r'^create/$', 'create'),
>     (r'^help/$', 'help'),
>     (r'^results/(?P<slug>[^\.^/]+)/$', 'results'),
>     )
>
>
> The views.py file is in /var/www/polls/pollngo
>
> When I access the page, I get:
> Environment:
>
> Request Method: GET
> Request URL: http://polls.dmc.umn.edu/
> Django Version: 1.0-final-SVN-unknown
> Python Version: 2.5.1
> Installed Applications:
> ['django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.admin',
>  'polls.pollngo']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.middleware.doc.XViewMiddleware')
>
>
> Traceback:
> File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in 
> get_response
>   77.                     request.path_info)
> File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in 
> resolve
>   180.                     sub_match = pattern.resolve(new_path)
> File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in 
> resolve
>   180.                     sub_match = pattern.resolve(new_path)
> File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in 
> resolve
>   123.             return self.callback, args, kwargs
> File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in 
> _get_callback
>   132.             raise ViewDoesNotExist, "Could not import %s. Error 
> was: %s" % (mod_name, str(e))
>
> Exception Type: ViewDoesNotExist at /
> Exception Value: Could not import polls.views. Error was: No module 
> named views
>
>
> >
>   


-- 
Tonu Mikk
Educational Technology Consultant
Digital Media Center - dmc.umn.edu
[EMAIL PROTECTED] 612 625-9221


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to