Re: Only getting 500 error, not 404
Yeah, um, about that. I haven't figured out how to config the email to do that. Can't find good documentation on that. I've tried to set what I thought were the relevant settings, but it didn't seem to have any effect. Can anyone point me to some better docs about that? I DID look in the server log though, and it appears that it's simply not finding 404.html. I haven't created my own custom 404.html, so I would expect it to have no trouble finding the default one. Any idea why it might not be finding it? Thanks, Mark On 3/3/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 3/4/07, puzzler <[EMAIL PROTECTED]> wrote: > > Any idea why I'm not getting 404 errors for these situations? > > Assuming you've set up the ADMINS setting so it emails you tracebacks > on these errors, what's in the traceback? > > -- > "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: Only getting 500 error, not 404
OK, I fixed it by placing a 404.html in the templates directory. I guess Django doesn't come with a default page. I'm still curious about the email settings. Here's what I have, with real info deleted to avoid spamming: ADMINS = ( ('My Name','[EMAIL PROTECTED]), ) EMAIL_HOST='mail3.webfaction.com' EMAIL_HOST_USER='username' EMAIL_HOST_PASSWORD='password' EMAIL_PORT='25' DEFAULT_FROM_EMAIL='[EMAIL PROTECTED]' SERVER_FROM_EMAIL='[EMAIL PROTECTED]' 'username' is my default webfaction mailbox, and 'password' is the corresponding password. --Mark On 3/3/07, Mark Engelberg <[EMAIL PROTECTED]> wrote: > Yeah, um, about that. I haven't figured out how to config the email > to do that. Can't find good documentation on that. I've tried to set > what I thought were the relevant settings, but it didn't seem to have > any effect. Can anyone point me to some better docs about that? > > I DID look in the server log though, and it appears that it's simply > not finding 404.html. I haven't created my own custom 404.html, so I > would expect it to have no trouble finding the default one. Any idea > why it might not be finding it? > > Thanks, > > Mark > > On 3/3/07, James Bennett <[EMAIL PROTECTED]> wrote: > > > > On 3/4/07, puzzler <[EMAIL PROTECTED]> wrote: > > > Any idea why I'm not getting 404 errors for these situations? > > > > Assuming you've set up the ADMINS setting so it emails you tracebacks > > on these errors, what's in the traceback? > > > > -- > > "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 -~--~~~~--~~--~--~---
Duplicating model/view structure across several Django apps
So I've got several applications which share the same model/view structure. I have kept the applications separate because conceptually I want them separate in the admin interface, I want them to store their respective info in separate tables in the database, and most importantly, I want to retain the ability to tweak one without affecting the others if it becomes necessary at a later time. But for now, they are all identical, and I want to avoid duplicating the model/view code. I think I understand how to keep the view code in one place, routing the URLs from all the apps to the same views.py and templates. However, it is less clear how to avoid duplicating the models. It appears that to install an app, you need to have a unique subdirectory with its own model.py. I tried having a fairly empty model.py that merely imports everything from a master "model.py", but Django doesn't seem to see the imported models (for example, syncdb doesn't seem to be aware of the imported models). I'm thinking that on Unix, it might be possible to set up a symbolic link to a master model.py, so it appears that there are multiple model.py files (one in each app directory), but in fact, there is only one. However, I'm testing this on a Windows machine before deploying it, so I'd like to find a solution that also works under Windows. Any suggestions? Thanks, Mark --~--~-~--~~~---~--~~ 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: Duplicating model/view structure across several Django apps
Well, as far as I can tell, for each entry in my INSTALLED_APPS (from settings.py), it looks in that directory, and expects to find a models.py there. So I'm looking for an alternative to duplicating the same models.py file in multiple directories. --Mark On 3/12/07, akonsu <[EMAIL PROTECTED]> wrote: > > hello, > > but model.py is imported it as any module. what prevents you from just > having it on the PYTHONPATH and not necessarily in the application > directory? > > may be i misunderstood the question... > > konstantin > > On Mar 12, 9:37 pm, "Mark Engelberg" <[EMAIL PROTECTED]> wrote: > > So I've got several applications which share the same model/view > > structure. I have kept the applications separate because conceptually > > I want them separate in the admin interface, I want them to store > > their respective info in separate tables in the database, and most > > importantly, I want to retain the ability to tweak one without > > affecting the others if it becomes necessary at a later time. > > > > But for now, they are all identical, and I want to avoid duplicating > > the model/view code. I think I understand how to keep the view code > > in one place, routing the URLs from all the apps to the same views.py > > and templates. > > > > However, it is less clear how to avoid duplicating the models. It > > appears that to install an app, you need to have a unique subdirectory > > with its own model.py. I tried having a fairly empty model.py that > > merely imports everything from a master "model.py", but Django doesn't > > seem to see the imported models (for example, syncdb doesn't seem to > > be aware of the imported models). I'm thinking that on Unix, it might > > be possible to set up a symbolic link to a master model.py, so it > > appears that there are multiple model.py files (one in each app > > directory), but in fact, there is only one. However, I'm testing this > > on a Windows machine before deploying it, so I'd like to find a > > solution that also works under Windows. > > > > Any suggestions? > > > > Thanks, > > > > Mark > > > > > --~--~-~--~~~---~--~~ 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: Duplicating model/view structure across several Django apps
As I mentioned in my initial post, I've tried that. I stored the main models.py in a subdirectory of my DjangoRoot called Static. Then, I created a directory for each app, and included in it a simple models.py file which just said: from DjangoRoot.Static.models import * This did not work. Django does not process these imported models. But yes, if I could make this work, it would be an acceptable solution. --Mark On 3/12/07, akonsu <[EMAIL PROTECTED]> wrote: > > yes, i was thinking that may be models.py might import actual models > from elsewhere? if it can you will still have separate one-line > models.py but i think it is acceptable. no? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Sort by output of arbitrary method
According to the tutorial: "You can click on the column headers to sort by those values -- except in the case of the was_published_today header, because sorting by the output of an arbitrary method is not supported. " Well, I understand that it would not be as efficient to sort on an attribute that isn't a field of the database, but is there an easy way to make the admin do this anyway? Barring that, since most databases support min max and average, is there a way to sort on those aspects of a field? Thanks, Mark --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Adding a field to a model
I know that, unfortunately, there's no painless way to migrate all the data in your database when you add a new optional field to your model. Pity. So what is the MOST painless way to do this? --Mark --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
List of unchecked checkboxes?
I'm trying to understand how to process checkboxes. I found this thread useful: http://groups.google.com/group/django-users/browse_thread/thread/5f7b06a23af50c56 However, I don't know how to get a list of _unchecked_ checkboxes. This is important, because I'm generating the list of ids dynamically. I want to approve the checked items, and delete the unchecked items. Make sense? Thanks, --Mark --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Which button was clicked?
When there are multiple submit buttons, how do you extract the clicked one from the request.POST? Thanks, Mark --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
get_application_name() ?
I'm writing some model code which needs to be reusable in several different applications. I'm running into a lot of name clashing issues, and need to use related_name to disambiguate relationships. To accomplish this, I need some way in my model code to find out the name of the application that it is a part of, so it can use that name for disambiguation purposes. Is there a way to do that? In other words, is there something called get_application_name() or something similar? Thanks, Mark --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---