Re: Model vanishes from Admin

2006-06-27 Thread [EMAIL PROTECTED]

Okay what solved my problem was removing imports of my models from
urls.py. I had a few generic view wrappers that were short so I had
just defined them in urls.py for now and that was causing a problem
when django was launched from fastcgi or mod_python but not
django-admin.py runserver.


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



Re: Model vanishes from Admin

2006-06-26 Thread [EMAIL PROTECTED]


Malcolm Tredinnick wrote:
> On Sat, 2006-06-24 at 23:57 -0700, [EMAIL PROTECTED] wrote:
> > Not sure if this makes a difference or not, but when I run "manage.py
> > validate" it says that there are 0 errors... and like I said
> > originally... The files on my production server are an exact mirror of
> > what is on my dev server. My models shows up on the dev's admin screen,
> > just not on the production site... so I doubt that it's something as
> > simple as a botched import. Thanks for the patch btw... should come in
> > really handy in the future.
> >
> > Any other ideas?
>
> Something is certainly different between the two setups. How did you
> check that files are the same on the two systems? If you do something
> like
>
> find -type f ! -name \*.pyc | xargs md5sum > MANIFEST
>
> on each server from the root of the project dir, do you get exactly the
> same file produced as a result? Because at this point, I would be
> suspecting something like a subtle whitespace difference.
>
> Also, if you use the manage.py shell and try something like this:
>
> >>> from weblog.models import Entry
> >>> Entry._meta.admin
> 
> >>>
>
> (customise to suit your circumstances), does it produce similar results
> on the two machines? Obviously the big hexadecimal number will be
> different, but it should at least return a result. Maybe just check that
> the equivalent of Entry._meta.admin.fields is the same, too.
>
> This is a really strange problem. To compute the list of admin apps, the
> admin interface just runs through your list of installed apps and
> retrieves every one with an Admin class. So identical settings and code
> files should lead to identical results.
>
> Malcolm

Very strange indeed same thing going on here. It works fine using
django-admin.py runserver. But using both lighttpd + fastcgi and
apache2 + mod_python it fails.

I have run out of time for this afternoon but I tracked it down to
django.db.models.load_app raising an exception on module not having a
model attribute. However, running the import command manually in
django-admin.py shell shows it has a model attribute and doesn't throw
an exception.

I'll look into the problem more tomorrow. But, it is very strange
indeed.


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



Re: Model vanishes from Admin

2006-06-25 Thread Russell Keith-Magee

Ok; here's a few more questions:

1) Update both servers again - has Malcolm's r3202 patch resolved anything?

2) If you run ./manage.py shell, then run:
>>> from django.db import models
>>> print models.get_apps()
>>> print models.get_models()

What do you get (on each server)?

3) Exactly how have you set up your two servers, and how do you sync
from dev to production? In particular, I'm interested in any symbolic
links you might be using to set up directory structures, and any
possible copies of .pyc files that might be migrating from dev to
production.

Russ Magee %-)

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



Re: Model vanishes from Admin

2006-06-25 Thread oggie rob

My guess would be caching or database discrepencies. Have you tried
accessing the production database through the dev server? Also have you
tried to delete .pyc files?

 -rob


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



Re: Model vanishes from Admin

2006-06-25 Thread merlin903


Russell Keith-Magee wrote:
> On 6/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Not sure if this makes a difference or not, but when I run "manage.py
> > validate" it says that there are 0 errors... and like I said
> > originally... The files on my production server are an exact mirror of
> > what is on my dev server. My models shows up on the dev's admin screen,
> > just not on the production site... so I doubt that it's something as
> > simple as a botched import.
>
> Ok; time to push this into debug mode. 'Scuse the stupid questions, I
> just need to eliminate the obvious :-)
>
> 1) Are both your servers updated to r3201?

Yes.

> 2) How are you deploying your dev and production servers (e.g., are
> they both apache, or is it apache for production, and django devserver
> for development)

They're both Apache with FastCGI, and mySQL

>
> Assuming your 'missing' model Foo is in an app called 'myproject.myapp'
> 3) Is myproject.myapp in INSTALLED_APPS on both servers?

Yes.

> 4) Are both servers fully syncdb'd?

Yes.

> 5) Does the database on the production server agree that the app has
> been installed?

Yes.

> 6) If you run ./manage.py shell, then run:
> >>> from myproject.myapp.models import Foo
> >>> f = Foo()
> >>> f.save()
> do you get the same behaviour on both servers?

Yes.

> 7) Are there any differences in the PYTHONPATH for the two machines?

No.

> 
> Russ Magee %-)


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



Re: Model vanishes from Admin

2006-06-25 Thread Malcolm Tredinnick

On Sat, 2006-06-24 at 23:57 -0700, [EMAIL PROTECTED] wrote:
> Not sure if this makes a difference or not, but when I run "manage.py
> validate" it says that there are 0 errors... and like I said
> originally... The files on my production server are an exact mirror of
> what is on my dev server. My models shows up on the dev's admin screen,
> just not on the production site... so I doubt that it's something as
> simple as a botched import. Thanks for the patch btw... should come in
> really handy in the future.
> 
> Any other ideas?

Something is certainly different between the two setups. How did you
check that files are the same on the two systems? If you do something
like

find -type f ! -name \*.pyc | xargs md5sum > MANIFEST

on each server from the root of the project dir, do you get exactly the
same file produced as a result? Because at this point, I would be
suspecting something like a subtle whitespace difference.

Also, if you use the manage.py shell and try something like this:

>>> from weblog.models import Entry
>>> Entry._meta.admin

>>>

(customise to suit your circumstances), does it produce similar results
on the two machines? Obviously the big hexadecimal number will be
different, but it should at least return a result. Maybe just check that
the equivalent of Entry._meta.admin.fields is the same, too.

This is a really strange problem. To compute the list of admin apps, the
admin interface just runs through your list of installed apps and
retrieves every one with an Admin class. So identical settings and code
files should lead to identical results.

Malcolm


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



Re: Model vanishes from Admin

2006-06-25 Thread Russell Keith-Magee

On 6/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Not sure if this makes a difference or not, but when I run "manage.py
> validate" it says that there are 0 errors... and like I said
> originally... The files on my production server are an exact mirror of
> what is on my dev server. My models shows up on the dev's admin screen,
> just not on the production site... so I doubt that it's something as
> simple as a botched import.

Ok; time to push this into debug mode. 'Scuse the stupid questions, I
just need to eliminate the obvious :-)

1) Are both your servers updated to r3201?
2) How are you deploying your dev and production servers (e.g., are
they both apache, or is it apache for production, and django devserver
for development)

Assuming your 'missing' model Foo is in an app called 'myproject.myapp'
3) Is myproject.myapp in INSTALLED_APPS on both servers?
4) Are both servers fully syncdb'd?
5) Does the database on the production server agree that the app has
been installed?
6) If you run ./manage.py shell, then run:
>>> from myproject.myapp.models import Foo
>>> f = Foo()
>>> f.save()
do you get the same behaviour on both servers?
7) Are there any differences in the PYTHONPATH for the two machines?

Russ Magee %-)

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



Re: Model vanishes from Admin

2006-06-25 Thread merlin903

Not sure if this makes a difference or not, but when I run "manage.py
validate" it says that there are 0 errors... and like I said
originally... The files on my production server are an exact mirror of
what is on my dev server. My models shows up on the dev's admin screen,
just not on the production site... so I doubt that it's something as
simple as a botched import. Thanks for the patch btw... should come in
really handy in the future.

Any other ideas?

Russell Keith-Magee wrote:
> On 6/24/06, arthur debert <[EMAIL PROTECTED]> wrote:
>
> > this one got me stuck for hours (grin).
> > if your INSTALLED_APPS is right and your admin inner class too, you
> > probably have an error on an import on your model class.
>
> FYI - To help avoid this problem in the future, I have just committed
> a patch (r3201) that will cause model validation to fail if there is
> an error in a model that is listed in INSTALLED_APPS.
> 
> Yours,
> Russ Magee %-)


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



Re: Model vanishes from Admin

2006-06-24 Thread arthur debert

Hi Russel.

Thanks for the patch. I am sure this one will save newbies a few hours
of starting blankly at the screen.

cheers
Arthur


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



Re: Model vanishes from Admin

2006-06-24 Thread Russell Keith-Magee

On 6/24/06, arthur debert <[EMAIL PROTECTED]> wrote:

> this one got me stuck for hours (grin).
> if your INSTALLED_APPS is right and your admin inner class too, you
> probably have an error on an import on your model class.

FYI - To help avoid this problem in the future, I have just committed
a patch (r3201) that will cause model validation to fail if there is
an error in a model that is listed in INSTALLED_APPS.

Yours,
Russ Magee %-)

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



Re: Model vanishes from Admin

2006-06-23 Thread arthur debert

Hi Steven.

this one got me stuck for hours (grin).
if your INSTALLED_APPS is right and your admin inner class too, you
probably have an error on an import on your model class.

fire up the shell on your server setup. can you import your model
module?


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



Re: Model vanishes from Admin

2006-06-23 Thread Waylan Limberg

First, make sure it is listed in the installed apps in your settings
file. Then, make sure the Admin() innerclass is defined in the model
(and that is has proper whitespacing etc.)

On 6/23/06, Steven Ametjan <[EMAIL PROTECTED]> wrote:
>
> I'm not quite sure how it happened, but one of my models disappeared
> from the Admin interface today, but is still present on my dev server.
>
> To make things even more interesting, just to see if I could fix it,
> I set both my production, and my dev projects to use the same
> directory, and they're both an exact mirror as far as the files go...
> yet it still isn't available on the production site. Any ideas as to
> a) what's causing this, and b) how to fix it?
>
> Steve
>
> >
>


-- 

Waylan Limberg
[EMAIL PROTECTED]

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