Re: differences between runserver and apache

2008-01-22 Thread Carl Karsten

Graham Dumpleton wrote:
> On Jan 22, 6:18 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> Carl Karsten wrote:
>>> symlinks.  I use them. I bet the default is for Apache not to follow them.  
>>> that
>>> could be my problem.  or at least one of them.
>>> That is enough to start a wiki page.
>>> I am going to divide it into rumors and confirmed rumors.  Anyone have some
>>> rumors for me to post?
>> If so, please dump them here.
>>
>> http://code.djangoproject.com/wiki/devserver_and_apache_differences
> 
> The differences have been dealt with before. See:
> 
>  
> http://groups.google.com/group/django-users/browse_frm/thread/24deb095a2b2e450/f8e703bbb96e9e88?lnk=gst=Graham+setup_environ+PythonPath#f8e703bbb96e9e88
> 
> Your page is just making things more confusing. The dev server has
> nothing to do with PythonPath, you probably mean sys.path, but it is

whoops.  right.  I was thinking 'path' but wanted to make it clear it wasn't 
the 
OS $PATH path.

> more complicated that you know as explained in referenced post.

I'll read the links later today.  have to go drive around in the snow.  wish me 
luck :)

Carl K

> 
> Also, whether Apache follows symlinks has got nothing to do with it.
> That aspect of Apache only comes into play when serving static files
> or you have script files in the directories directly served by Apache,
> neither of which apply to Django unless you so happen to have also
> configured Apache to serve up the Django media files which your
> configuration does not show you are doing.
> 
> If you want a list of the things that can come up when using Apache,
> you are better off reading:
> 
>   http://code.google.com/p/modwsgi/wiki/ApplicationIssues
> 
> This is for mod_wsgi, but lots of the issues such as file access
> permissions etc etc, also apply to mod_python.
> 
> You may also want to read:
> 
>   http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
> 
> which explicitly mentions the need to add both the site and site
> parent directory to sys.path (through whatever means), if you
> reference stuff not through the site name.
> 
> Graham
> 
> 
> > 
> 

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: differences between runserver and apache

2008-01-22 Thread Carl Karsten

I never got it working back then.  I was thinking of bringing up a test Apache 
box right from the start, but it seemed more important to get a prototype site 
functioning.  Now I am ready to actually use Apache, so here we are.

Thanks for your efforts - and like my page says: rumors.  I will note that 
symlinks do not effect finding python files.  Thanks.

Carl K

Graham Dumpleton wrote:
> BTW, Carl.
> 
> I note that you actually directly responded to that old thread I
> referenced explaining the subtle differences, so you would have been
> aware of how to set things up back then, so not sure why you are
> having trouble now. ;-)
> 
> Graham
> 
> On Jan 22, 6:51 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>> On Jan 22, 6:18 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
>>
>>> Carl Karsten wrote:
 symlinks.  I use them. I bet the default is for Apache not to follow them. 
  that
 could be my problem.  or at least one of them.
 That is enough to start a wiki page.
 I am going to divide it into rumors and confirmed rumors.  Anyone have some
 rumors for me to post?
>>> If so, please dump them here.
>>> http://code.djangoproject.com/wiki/devserver_and_apache_differences
>> The differences have been dealt with before. See:
>>
>> http://groups.google.com/group/django-users/browse_frm/thread/24deb09...
>>
>> Your page is just making things more confusing. The dev server has
>> nothing to do with PythonPath, you probably mean sys.path, but it is
>> more complicated that you know as explained in referenced post.
>>
>> Also, whether Apache follows symlinks has got nothing to do with it.
>> That aspect of Apache only comes into play when serving static files
>> or you have script files in the directories directly served by Apache,
>> neither of which apply to Django unless you so happen to have also
>> configured Apache to serve up the Django media files which your
>> configuration does not show you are doing.
>>
>> If you want a list of the things that can come up when using Apache,
>> you are better off reading:
>>
>>  http://code.google.com/p/modwsgi/wiki/ApplicationIssues
>>
>> This is for mod_wsgi, but lots of the issues such as file access
>> permissions etc etc, also apply to mod_python.
>>
>> You may also want to read:
>>
>>  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>>
>> which explicitly mentions the need to add both the site and site
>> parent directory to sys.path (through whatever means), if you
>> reference stuff not through the site name.
>>
>> Graham
> > 
> 

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: differences between runserver and apache

2008-01-22 Thread Graham Dumpleton

On Jan 22, 6:18 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
> Carl Karsten wrote:
> > symlinks.  I use them. I bet the default is for Apache not to follow them.  
> > that
> > could be my problem.  or at least one of them.
>
> > That is enough to start a wiki page.
>
> > I am going to divide it into rumors and confirmed rumors.  Anyone have some
> > rumors for me to post?
>
> If so, please dump them here.
>
> http://code.djangoproject.com/wiki/devserver_and_apache_differences

The differences have been dealt with before. See:


http://groups.google.com/group/django-users/browse_frm/thread/24deb095a2b2e450/f8e703bbb96e9e88?lnk=gst=Graham+setup_environ+PythonPath#f8e703bbb96e9e88

Your page is just making things more confusing. The dev server has
nothing to do with PythonPath, you probably mean sys.path, but it is
more complicated that you know as explained in referenced post.

Also, whether Apache follows symlinks has got nothing to do with it.
That aspect of Apache only comes into play when serving static files
or you have script files in the directories directly served by Apache,
neither of which apply to Django unless you so happen to have also
configured Apache to serve up the Django media files which your
configuration does not show you are doing.

If you want a list of the things that can come up when using Apache,
you are better off reading:

  http://code.google.com/p/modwsgi/wiki/ApplicationIssues

This is for mod_wsgi, but lots of the issues such as file access
permissions etc etc, also apply to mod_python.

You may also want to read:

  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

which explicitly mentions the need to add both the site and site
parent directory to sys.path (through whatever means), if you
reference stuff not through the site name.

Graham


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: differences between runserver and apache

2008-01-21 Thread Graham Dumpleton

BTW, Carl.

I note that you actually directly responded to that old thread I
referenced explaining the subtle differences, so you would have been
aware of how to set things up back then, so not sure why you are
having trouble now. ;-)

Graham

On Jan 22, 6:51 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Jan 22, 6:18 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
>
> > Carl Karsten wrote:
> > > symlinks.  I use them. I bet the default is for Apache not to follow 
> > > them.  that
> > > could be my problem.  or at least one of them.
>
> > > That is enough to start a wiki page.
>
> > > I am going to divide it into rumors and confirmed rumors.  Anyone have 
> > > some
> > > rumors for me to post?
>
> > If so, please dump them here.
>
> >http://code.djangoproject.com/wiki/devserver_and_apache_differences
>
> The differences have been dealt with before. See:
>
> http://groups.google.com/group/django-users/browse_frm/thread/24deb09...
>
> Your page is just making things more confusing. The dev server has
> nothing to do with PythonPath, you probably mean sys.path, but it is
> more complicated that you know as explained in referenced post.
>
> Also, whether Apache follows symlinks has got nothing to do with it.
> That aspect of Apache only comes into play when serving static files
> or you have script files in the directories directly served by Apache,
> neither of which apply to Django unless you so happen to have also
> configured Apache to serve up the Django media files which your
> configuration does not show you are doing.
>
> If you want a list of the things that can come up when using Apache,
> you are better off reading:
>
>  http://code.google.com/p/modwsgi/wiki/ApplicationIssues
>
> This is for mod_wsgi, but lots of the issues such as file access
> permissions etc etc, also apply to mod_python.
>
> You may also want to read:
>
>  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>
> which explicitly mentions the need to add both the site and site
> parent directory to sys.path (through whatever means), if you
> reference stuff not through the site name.
>
> Graham
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: differences between runserver and apache

2008-01-21 Thread Graham Dumpleton

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 :     
>
>     20 :     
>
>     21 :         
>
>     22 :         {% block branding %}{% endblock %}
>
>     23 :         
>
>     24 :         {% if user.is_authenticated and user.is_staff %}
>
>     25 :         
>
>     26 :         {% trans 'Welcome,' %} {% if user.first_name %}{{
> user.first_name|escape }}{% else %}{{ user.username }}{% endif %}.
>
>     27 :         {% block userlinks %}
>
>     28 :         {% trans 'Documentation' %}
>
>     29 :         / {% trans 'Change password' %}
>
>     30 :         / {% 
> trans
> 'Log out' %}
>
>     31 :         {% endblock %}
>
>     32 :         
>
>     33 :         {% endif %}
>
>     34 :         {% block nav-global %}{% endblock %}
>
>     35 :     
>
>     36 :     
>
>     37 :     {% block breadcrumbs %}{%
> trans 'Home' %}{% if title %}  {{ title|escape }}{% endif 
> %}{%
> 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.
> >> 
>
> >>    ServerAdmin [EMAIL PROTECTED]
> >>    ServerName  test
> >>    

Re: differences between runserver and apache

2008-01-21 Thread Carl Karsten

Carl Karsten wrote:
> symlinks.  I use them. I bet the default is for Apache not to follow them.  
> that 
> could be my problem.  or at least one of them.
> 
> That is enough to start a wiki page.
> 
> I am going to divide it into rumors and confirmed rumors.  Anyone have some 
> rumors for me to post?

If so, please dump them here.

http://code.djangoproject.com/wiki/devserver_and_apache_differences

Carl K

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: differences between runserver and apache

2008-01-21 Thread Carl Karsten

whoops.

svn co http://code.djangoproject.com/svn/django/trunk/django

 PythonPath "['/home/testrmcom'] + sys.path"

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 : 


20 : 


21 : 


22 : {% block branding %}{% endblock %}


23 : 


24 : {% if user.is_authenticated and user.is_staff %}


25 : 


26 : {% trans 'Welcome,' %} {% if user.first_name %}{{ 
user.first_name|escape }}{% else %}{{ user.username }}{% endif %}.


27 : {% block userlinks %}


28 : {% trans 'Documentation' %}


29 : / {% trans 'Change password' %}


30 : / {% 
trans 
'Log out' %}


31 : {% endblock %}


32 : 


33 : {% endif %}


34 : {% block nav-global %}{% endblock %}


35 : 


36 : 


37 : {% block breadcrumbs %}{% 
trans 'Home' %}{% if title %}  {{ title|escape }}{% endif 
%}{% 
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.
>> 
>>
>>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"
>>
>> 
>>
>>
>>
>>> Post your full urls.py file.
>> [EMAIL PROTECTED]:~/ridgemoor$ cat urls.py
>> # urls.py
>>
>> 

Re: differences between runserver and apache

2008-01-21 Thread Graham Dumpleton

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.
>
> 
>
>    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"
>
> 
>
>
>
> > 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.*)$', '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 :     
>
>     20 :     
>
>     21 :         
>
>     22 :         {% block branding %}{% endblock %}
>
>     23 :         
>
>     24 :         {% if user.is_authenticated and user.is_staff %}
>
>     25 :         
>
>     26 :         {% trans 'Welcome,' %} {% if user.first_name %}{{
> user.first_name|escape }}{% else %}{{ user.username }}{% endif %}.
>
>     27 :         {% block userlinks %}
>
>     28 :         {% trans 'Documentation' %}
>
>     29 :         / {% trans 'Change password' %}
>
>     30 :         / {% 
> trans
> 'Log out' %}
>
>     31 :         {% endblock %}
>
>     32 :         
>
>     33 :         {% endif %}
>
>     34 :         {% block nav-global %}{% endblock %}
>
>     35 :     
>
>     36 :     
>
>     37 :     {% block breadcrumbs %}{%
> trans 'Home' %}{% if title %}  {{ title|escape }}{% endif 
> %}{%
> 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 

Re: differences between runserver and apache

2008-01-21 Thread Carl Karsten

symlinks.  I use them. I bet the default is for Apache not to follow them.  
that 
could be my problem.  or at least one of them.

That is enough to start a wiki page.

I am going to divide it into rumors and confirmed rumors.  Anyone have some 
rumors for me to post?

Carl K

jonasr wrote:
> I'm having a similar issue. Last week after I moved from .95 to svn
> and started having these problems. However, if I refresh the
> 192.168.0.150/admin 4-5 times, the fifth refresh renders admin as if
> nothing is wrong.
> The records I add or update are added and saved, but after I restart
> apache I'll get this error in the admin:
> Tried update in module tswmls.notes.views. Error was: 'module' object
> has no attribute 'update'
> tswmls is my project name.
> 
> I expect "update" must be an module in admin, because I have no class
> named update in any of my projects. Another apache problem I ran into
> when moving to svn is I had to locate the django svn directory in site-
> packages. Just sym-linking from site-packages to my svn directory did
> not work with mod_python and apache as before. Apache or mod_python
> would not follow the sym-link, I'm not sure which causing this. No
> method of PythonPath tweeking worked, django simply did not run until
> I moved the files into site-packages. At the moment, django runs, but
> every so often I get the admin errors you have.
> 
> My Apache virtual server lines:
> 
> 
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE tswmls.settings
> PythonPath "['/home/webs/djtsw'] + sys.path"
> PythonDebug On
> 
> 
> allow from all
> Options +Indexes
> 
> 
> SetHandler none
> 
> 
> SetHandler none
> 
> DocumentRoot /home/webs/djtsw/public_html
> 
> 
> settings.py located at /home/web/djtsw/tswmls:
> # Absolute path to the directory that holds media.
> # Example: "/home/media/media.lawrence.com/"
> MEDIA_ROOT = '/home/webs/djtsw/public_html/media'
> 
> # URL that handles the media served from MEDIA_ROOT.
> # Example: "http://media.lawrence.com;
> #MEDIA_URL = 'http://media.localhost'
> MEDIA_URL = 'http://192.168.0.150/media'
> 
> # URL prefix for admin media -- CSS, JavaScript and images. Make sure
> to use a
> # trailing slash.
> # Examples: "http://foo.com/media/;, "/media/".
> ADMIN_MEDIA_PREFIX = '/media/'
> 
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '40n7dnlrx#ty0no12c1*j$([EMAIL PROTECTED])&^u_643wk4'
> 
> # List of callables that know how to import templates from various
> sources.
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.load_template_source',
> 'django.template.loaders.app_directories.load_template_source',
> # 'django.template.loaders.eggs.load_template_source',
> )
> 
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.middleware.doc.XViewMiddleware',
> )
> 
> ROOT_URLCONF = 'tswmls.urls'
> 
> TEMPLATE_DIRS = (
> "/home/webs/djtsw/django_templates"
> # Put strings here, like "/home/html/django_templates" or "C:/www/
> django/templates".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
> 
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'django.contrib.admin',
> 'tswmls.polls',
> 'tswmls.notes',
> 'tswmls.tsm',
> 'tswmls.jobs',
> 'tswmls.property',
> 'tswmls.contacts',
> 'tswmls.rental',
> )
> 
> 
> On Jan 21, 8:26 am, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> James Bennett wrote:
>>> On Jan 21, 2008 8:43 AM, Carl Karsten <[EMAIL PROTECTED]> wrote:
 Exception Type: ViewDoesNotExist at /admin/
 Exception Value: Tried new_message in module ridgemoor.core.views. Error 
 was:
 'module' object has no attribute 'new_message'
>>> Most likely is that something that's different between your Python
>>> path under runserver and under Apache is causing something to fail
>>> with an ImportError, which in turn causes reverse URL resolution to
>>> fail, which in turn causes the "url" tag (which is used by the admin)
>>> to fail.
>> I heard runserver adds things to the path.  which would explain why there is 
>> a
>> difference.  Is this correct?
>>
>> I am thinking maybe I am missing a 3rd party module?  which wouldn't be on my
>> path - is that what you mean?
>>
>> Carl K
> > 
> 

--~--~-~--~~~---~--~~
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

Re: differences between runserver and apache

2008-01-21 Thread jonasr

I'm having a similar issue. Last week after I moved from .95 to svn
and started having these problems. However, if I refresh the
192.168.0.150/admin 4-5 times, the fifth refresh renders admin as if
nothing is wrong.
The records I add or update are added and saved, but after I restart
apache I'll get this error in the admin:
Tried update in module tswmls.notes.views. Error was: 'module' object
has no attribute 'update'
tswmls is my project name.

I expect "update" must be an module in admin, because I have no class
named update in any of my projects. Another apache problem I ran into
when moving to svn is I had to locate the django svn directory in site-
packages. Just sym-linking from site-packages to my svn directory did
not work with mod_python and apache as before. Apache or mod_python
would not follow the sym-link, I'm not sure which causing this. No
method of PythonPath tweeking worked, django simply did not run until
I moved the files into site-packages. At the moment, django runs, but
every so often I get the admin errors you have.

My Apache virtual server lines:


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE tswmls.settings
PythonPath "['/home/webs/djtsw'] + sys.path"
PythonDebug On


allow from all
Options +Indexes


SetHandler none


SetHandler none

DocumentRoot /home/webs/djtsw/public_html


settings.py located at /home/web/djtsw/tswmls:
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/home/webs/djtsw/public_html/media'

# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com;
#MEDIA_URL = 'http://media.localhost'
MEDIA_URL = 'http://192.168.0.150/media'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/;, "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '40n7dnlrx#ty0no12c1*j$([EMAIL PROTECTED])&^u_643wk4'

# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
)

ROOT_URLCONF = 'tswmls.urls'

TEMPLATE_DIRS = (
"/home/webs/djtsw/django_templates"
# Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'tswmls.polls',
'tswmls.notes',
'tswmls.tsm',
'tswmls.jobs',
'tswmls.property',
'tswmls.contacts',
'tswmls.rental',
)


On Jan 21, 8:26 am, Carl Karsten <[EMAIL PROTECTED]> wrote:
> James Bennett wrote:
> > On Jan 21, 2008 8:43 AM, Carl Karsten <[EMAIL PROTECTED]> wrote:
> >> Exception Type: ViewDoesNotExist at /admin/
> >> Exception Value: Tried new_message in module ridgemoor.core.views. Error 
> >> was:
> >> 'module' object has no attribute 'new_message'
>
> > Most likely is that something that's different between your Python
> > path under runserver and under Apache is causing something to fail
> > with an ImportError, which in turn causes reverse URL resolution to
> > fail, which in turn causes the "url" tag (which is used by the admin)
> > to fail.
>
> I heard runserver adds things to the path.  which would explain why there is a
> difference.  Is this correct?
>
> I am thinking maybe I am missing a 3rd party module?  which wouldn't be on my
> path - is that what you mean?
>
> Carl K
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: differences between runserver and apache

2008-01-21 Thread Carl Karsten

James Bennett wrote:
> On Jan 21, 2008 8:43 AM, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> Exception Type: ViewDoesNotExist at /admin/
>> Exception Value: Tried new_message in module ridgemoor.core.views. Error was:
>> 'module' object has no attribute 'new_message'
> 
> Most likely is that something that's different between your Python
> path under runserver and under Apache is causing something to fail
> with an ImportError, which in turn causes reverse URL resolution to
> fail, which in turn causes the "url" tag (which is used by the admin)
> to fail.
> 

I heard runserver adds things to the path.  which would explain why there is a 
difference.  Is this correct?

I am thinking maybe I am missing a 3rd party module?  which wouldn't be on my 
path - is that what you mean?

Carl K

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: differences between runserver and apache

2008-01-21 Thread James Bennett

On Jan 21, 2008 8:43 AM, Carl Karsten <[EMAIL PROTECTED]> wrote:
> Exception Type: ViewDoesNotExist at /admin/
> Exception Value: Tried new_message in module ridgemoor.core.views. Error was:
> 'module' object has no attribute 'new_message'

Most likely is that something that's different between your Python
path under runserver and under Apache is causing something to fail
with an ImportError, which in turn causes reverse URL resolution to
fail, which in turn causes the "url" tag (which is used by the admin)
to fail.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: differences between runserver and apache

2008-01-21 Thread Carl Karsten

Graham Dumpleton wrote:
> Post your Apache configuration snippet where you configure mod_python
> for Django.




   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"



> 
> 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.*)$', '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 : 


20 : 


21 : 


22 : {% block branding %}{% endblock %}


23 : 


24 : {% if user.is_authenticated and user.is_staff %}


25 : 


26 : {% trans 'Welcome,' %} {% if user.first_name %}{{ 
user.first_name|escape }}{% else %}{{ user.username }}{% endif %}.


27 : {% block userlinks %}


28 : {% trans 'Documentation' %}


29 : / {% trans 'Change password' %}


30 : / {% 
trans 
'Log out' %}


31 : {% endblock %}


32 : 


33 : {% endif %}


34 : {% block nav-global %}{% endblock %}


35 : 


36 : 


37 : {% block breadcrumbs %}{% 
trans 'Home' %}{% if title %}  {{ title|escape }}{% endif 
%}{% 
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 'new_message'

Which I also now get when I browse: 
http://test.ridgemoor.personnelware.com:8000/admin/

This was working before I started putting it under apache.  everything 
(including conf files) are under svn, so  I could show diffs, but I checked in 
about 15 or so revisions as I got this and that working.

Carl K

> 
> Graham
> 
> On Jan 21, 6:22 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> I developed a site using ./mmanage.py runserver for testing.  

Re: differences between runserver and apache

2008-01-20 Thread Graham Dumpleton

Post your Apache configuration snippet where you configure mod_python
for Django.

Post your full urls.py file.

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.

Graham

On Jan 21, 6:22 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
> I developed a site using ./mmanage.py runserver for testing.  I try to run it
> under apache and it errors.  I hear runserver adds things to sys.path 
> (installed
> apps) and when you run from apache that doesn't happen.  sure enough, I can 
> fix
> it by adding things to PythonPath.
>
> Now I am having 2 problems with
>      (r'^admin/', include('django.contrib.admin.urls')),
>
> 1. if I browse to mysite.com/admin it misses that and gets caught by
>       (r'', include('ridgemoor.core.urls')),
>
> 2, browse to mysite.com/admin/ get error:
>
> Tried new_message in module ridgemoor.core.views. Error was: 'module' object 
> has
> no attribute 'new_message'
>
> I have a feeling this is more pathing problems, but now it doesn't work from
> runserver either, which makes me think I broke something trying to fix the 
> path
> isues.
>
> So before I go 'fixing' more things, some sort of checklist describing what
> changes I need to make would be nice.  Anything like this exist?
>
> Carl K
>
> ps
>
> http://us.pycon.org/2008/registration/open for business.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---