On Jan 22, 6:18 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
> whoops.
>
> svn cohttp://code.djangoproject.com/svn/django/trunk/django
>
>      PythonPath "['/home/testrmcom'] + sys.path"

That is not what I said to use. I said to use both that directory as
well as the actual directory containing the settings file. Because you
didn't do that is why you had to change your import.

Graham

> That makes things simpler.
>
> But, I still had to change
> from core.models import Message
> to
> from ridgemoor.core.models import Message
>
> Well, that change seemed to make things better, but I am still getting errors
> when I hit the /admin UI.
>
> Current one:
> Could not import pre.views. Error was: No module named pre.views
>
> Environment:
>
> Request Method: GET
> Request URL:http://dhcp20/admin/
> Django Version: 0.97-pre-SVN-7028
> Python Version: 2.5.2
> Installed Applications:
> ['django.contrib.auth',
>   'django.contrib.contenttypes',
>   'django.contrib.sessions',
>   'django.contrib.sites',
>   'django.contrib.admin',
>   'django.contrib.databrowse',
>   'django.contrib.webdesign',
>   'ridgemoor.core',
>   'ridgemoor.eventcal',
>   'ridgemoor.pre']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>   'django.contrib.sessions.middleware.SessionMiddleware',
>   'django.contrib.auth.middleware.AuthenticationMiddleware',
>   'django.middleware.doc.XViewMiddleware')
>
> Template error:
> In template /home/testrmcom/django/contrib/admin/templates/admin/base.html,
> error at line 28
>     Caught an exception while rendering: Could not import pre.views. Error 
> was:
> No module named pre.views
>     18 :     {% if not is_popup %}
>
>     19 :     <!-- Header -->
>
>     20 :     <div id="header">
>
>     21 :         <div id="branding">
>
>     22 :         {% block branding %}{% endblock %}
>
>     23 :         </div>
>
>     24 :         {% if user.is_authenticated and user.is_staff %}
>
>     25 :         <div id="user-tools">
>
>     26 :         {% trans 'Welcome,' %} <strong>{% if user.first_name %}{{
> user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>.
>
>     27 :         {% block userlinks %}
>
>     28 :         <a href=" {% url django.contrib.admin.views.doc.doc_index %}
> ">{% trans 'Documentation' %}</a>
>
>     29 :         / <a href="{% url django.contrib.auth.views.password_change
> %}">{% trans 'Change password' %}</a>
>
>     30 :         / <a href="{% url django.contrib.auth.views.logout %}">{% 
> trans
> 'Log out' %}</a>
>
>     31 :         {% endblock %}
>
>     32 :         </div>
>
>     33 :         {% endif %}
>
>     34 :         {% block nav-global %}{% endblock %}
>
>     35 :     </div>
>
>     36 :     <!-- END Header -->
>
>     37 :     {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{%
> trans 'Home' %}</a>{% if title %} &rsaquo; {{ title|escape }}{% endif 
> %}</div>{%
> endblock %}
>
>     38 :     {% endif %}
>
> Traceback:
> File "/home/testrmcom/django/template/debug.py" in render_node
>    71.             result = node.render(context)
> File "/home/testrmcom/django/template/defaulttags.py" in render
>    363.             return reverse(self.view_name, args=args, kwargs=kwargs)
> File "/home/testrmcom/django/core/urlresolvers.py" in reverse
>    297.     return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
> *args, **kwargs))
> File "/home/testrmcom/django/core/urlresolvers.py" in reverse
>    282.         if lookup_view in self.reverse_dict:
> File "/home/testrmcom/django/core/urlresolvers.py" in _get_reverse_dict
>    218.                     for key, value in 
> pattern.reverse_dict.iteritems():
> File "/home/testrmcom/django/core/urlresolvers.py" in _get_reverse_dict
>    221.                     self._reverse_dict[pattern.callback] = (pattern,)
> File "/home/testrmcom/django/core/urlresolvers.py" in _get_callback
>    181.             raise ViewDoesNotExist, "Could not import %s. Error was: 
> %s"
> % (mod_name, str(e))
>
> Exception Type: ViewDoesNotExist at /admin/
> Exception Value: Could not import pre.views. Error was: No module named 
> pre.views
>
> Carl K
>
> Graham Dumpleton wrote:
> > You are not following the instructions. I would agree the instructions
> > aren't as clear as they could be, but it does describe what is needed.
> > Specifically the documentation says:
>
> > """Remember: the parent directories of anything you import directly
> > must be on the Python path."""
>
> > You have not done this.
>
> > You only have:
>
> >   PythonPath "['/home/testrmcom/django-svn/django', '/home/testrmcom/
> > ridgemoor'] + sys.path"
>
> > Because you are declaring DJANGO_SETTINGS_MODULE as:
>
> >   SetEnv DJANGO_SETTINGS_MODULE ridgemoor.settings
>
> > then the parent directory of 'ridgemoor' must be added to PythonPath.
>
> >   PythonPath "['/home/testrmcom/django-svn/django', '/home/testrmcom',
> > '/home/testrmcom/ridgemoor'] + sys.path"
>
> > Ie., to setup same path as inbuilt server, you need both the directory
> > the settings.py file is in and the parent of that directory.
>
> > Graham
>
> > On Jan 22, 1:43 am, Carl Karsten <[EMAIL PROTECTED]> wrote:
> >> Graham Dumpleton wrote:
> >>> Post your Apache configuration snippet where you configuremod_python
> >>> for Django.
> >> <VirtualHost *:80>
>
> >>    ServerAdmin [EMAIL PROTECTED]
> >>    ServerName  test
> >>    ServerAlias test.ridgemoor.personnelware.com
>
> >>    DocumentRoot /home/juser/public_html/
>
> >>      SetHandler python-program
> >>      PythonHandler django.core.handlers.modpython
> >>      SetEnv DJANGO_SETTINGS_MODULE ridgemoor.settings
> >>      PythonDebug On
> >>      PythonPath "['/home/testrmcom/django-svn/django',
> >> '/home/testrmcom/ridgemoor'] + sys.path"
>
> >> </VirtualHost>
>
> >>> Post your full urls.py file.
> >> [EMAIL PROTECTED]:~/ridgemoor$ cat urls.py
> >> # urls.py
>
> >> import os
>
> >> from django.conf.urls.defaults import *
>
> >> from django.conf import settings
>
> >> urlpatterns = patterns('',
> >>      (r'^admin/', include('django.contrib.admin.urls')),
> >>      (r'^logout/$', 'django.contrib.auth.views.logout',
> >> {'template_name':'logout.html'} ),
> >>      (r'^eventcal/', include('eventcal.urls')),
> >>      (r'^accounts/login/$', 'django.contrib.auth.views.login', 
> >> {'template_name':
> >> 'login.html'}),
> >>      (r'^msg/', include('msg.urls')),
> >>      (r'^core/', include('core.urls')),
> >>      (r'^pre/', include('pre.urls')),
> >>      (r'^static/(?P<path>.*)$', 'django.views.static.serve', 
> >> {'document_root':
> >> settings.BASE_DIR+'/core/static/', 'show_indexes': True}),
> >>      (r'', include('core.urls')),
> >> )
>
> >>> Indicate the path to the directory containing the settings.py file so
> >>> we can see if it matches with what it is meant to be.
> >> [EMAIL PROTECTED]:~/ridgemoor$ pwd
> >> /home/juser/ridgemoor
>
> >> and here is the current error I am getting:
>
> >> Environment:
>
> >> Request Method: GET
> >> Request URL:http://test.ridgemoor.personnelware.com/admin/
> >> Django Version: 0.97-pre-SVN-7027
> >> Python Version: 2.5.2
> >> Installed Applications:
> >> ['django.contrib.auth',
> >>   'django.contrib.contenttypes',
> >>   'django.contrib.sessions',
> >>   'django.contrib.sites',
> >>   'django.contrib.admin',
> >>   'django.contrib.databrowse',
> >>   'django.contrib.webdesign',
> >>   'ridgemoor.core',
> >>   'ridgemoor.eventcal',
> >>   'ridgemoor.pre']
> >> Installed Middleware:
> >> ('django.middleware.common.CommonMiddleware',
> >>   'django.contrib.sessions.middleware.SessionMiddleware',
> >>   'django.contrib.auth.middleware.AuthenticationMiddleware',
> >>   'django.middleware.doc.XViewMiddleware')
>
> >> Template error:
> >> In template /home/testrmcom/django/contrib/admin/templates/admin/base.html,
> >> error at line 28
> >>     Caught an exception while rendering: Tried new_message in module
> >> ridgemoor.core.views. Error was: 'module' object has no attribute 
> >> 'new_message'
> >>     18 :     {% if not is_popup %}
>
> >>     19 :     <!-- Header -->
>
> >>     20 :     <div id="header">
>
> >>     21 :         <div id="branding">
>
> >>     22 :         {% block branding %}{% endblock %}
>
> >>     23 :         </div>
>
> >>     24 :         {% if user.is_authenticated and user.is_staff %}
>
> >>     25 :         <div id="user-tools">
>
> >>     26 :         {% trans 'Welcome,' %} <strong>{% if user.first_name %}{{
> >> user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>.
>
> >>     27 :         {% block userlinks %}
>
> >>     28 :         <a href=" {% url django.contrib.admin.views.doc.doc_index 
> >> %}
> >> ">{% trans 'Documentation' %}</a>
>
> >>     29 :         / <a href="{% url 
> >> django.contrib.auth.views.password_change
> >> %}">{% trans 'Change password' %}</a>
>
> >>     30 :         / <a href="{% url django.contrib.auth.views.logout %}">{% 
> >> trans
> >> 'Log out' %}</a>
>
> >>     31 :         {% endblock %}
>
> >>     32 :         </div>
>
> >>     33 :         {% endif %}
>
> >>     34 :         {% block nav-global %}{% endblock %}
>
> >>     35 :     </div>
>
> >>     36 :     <!-- END Header -->
>
> >>     37 :     {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{%
> >> trans 'Home' %}</a>{% if title %} &rsaquo; {{ title|escape }}{% endif 
> >> %}</div>{%
> >> endblock %}
>
> >>     38 :     {% endif %}
>
> >> Traceback:
> >> File "/home/testrmcom/django/template/debug.py" in render_node
> >>    71.             result = node.render(context)
> >> File "/home/testrmcom/django/template/defaulttags.py" in render
> >>    363.             return reverse(self.view_name, args=args, 
> >> kwargs=kwargs)
> >> File "/home/testrmcom/django/core/urlresolvers.py" in reverse
> >>    297.     return iri_to_uri(u'/' + 
> >> get_resolver(urlconf).reverse(viewname,
> >> *args, **kwargs))
> >> File "/home/testrmcom/django/core/urlresolvers.py" in reverse
> >>    282.         if lookup_view in self.reverse_dict:
> >> File "/home/testrmcom/django/core/urlresolvers.py" in _get_reverse_dict
> >>    218.                     for key, value in 
> >> pattern.reverse_dict.iteritems():
> >> File "/home/testrmcom/django/core/urlresolvers.py" in _get_reverse_dict
> >>    221.                     self._reverse_dict[pattern.callback] = 
> >> (pattern,)
> >> File "/home/testrmcom/django/core/urlresolvers.py" in _get_callback
> >>    184.             raise ViewDoesNotExist, "Tried %s in module %s. Error 
> >> was:
> >> %s" % (func_name, mod_name, str(e))
>
> >> Exception Type: ViewDoesNotExist at /admin/
> >> Exception Value: Tried new_message in module ridgemoor.core.views. Error 
> >> was:
> >> 'module' object has no attribute
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
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