I'm running mod_wsgi, and I'm wondering if anybody else who uses mod_wsgi
has experienced problems with Django directing requests to 500.html
template when the server returns 500 status code.
Is there any configuration that needs to be set? When running mod_python,
this was wroking fine.
Bruno,
Thanks, this helps a lot.
> > > While we're at it : what's your use case for adding the domain name to
> > > the url ?
>
> > I'm doing this in a custom tag to produce a sidebar menu of recent
> > posts.
>
> Recent posts belonging to the same site ? I assume so, since you use
>
Instead of calling render_to_response on an empty template file you
could simply return an empty django.http.HttpResponse and avoid the
templating system overhead.
I would generally send *something* in the response, even if just
{"success": true}, to leave space for specific error reporting
Has anyone else had any problems debugging javascript in Firebug on a
django site? I've got two sites running just about identical code; in
the PHP version I can stop at breakpoints, step through my javascript
function normally. In the Django version, although firebug shows my
breakpoints -
Hi everyone,
I have a view to do some re-ordering of a list via ajax:
@staff_member_required
def reorder(request):
collections = Collection.objects.all()
if request.method == 'POST':
pk_ids = request.POST['pk_ids'].split(',')
length = len(pk_ids)
for collection
Yep, that was it. Thanks for the insight.
On Wed, Oct 1, 2008 at 10:14 AM, Erik Allik <[EMAIL PROTECTED]> wrote:
>
> Are you using the MyISAM or InnoDB storage type? MyISAM does not
> support integrity constraints, afaik.
>
> Erik
>
> On 01.10.2008, at 16:44, Chris wrote:
>
>>
>> I'm running
What you could do is create the intermediary table explicitly using
the through keyword:
http://docs.djangoproject.com/en/dev//topics/db/models/#extra-fields-on-many-to-many-relationships
then you can do queries on the table.
Alex
On Oct 1, 7:17 pm, "Dan W." <[EMAIL PROTECTED]> wrote:
> This
This is my first time building an app with django and so far I've been
more than happy with it. However, I can't seem to figure out how to
sufficiently optimize queries for ManyToMany relationships. Here is a
model to illustrate my problem:
class Book(models.Model):
name =
Have you tried setting the order within your model? I think that is
the only simple way to tackle this at this time.
class Meta:
ordering = ("fruit",)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
On Tue, Sep 23, 2008 at 3:07 AM, proteus guy <[EMAIL PROTECTED]> wrote:
> Here's a fun one for you testing gurus! I have a Django app that uses an
> irc server to communicate events to a system. My models utilize the django
> model save signal to post an irc message when something is updated.
Hi all,
In the admin interface, if I want the options in a dropdown for a
ForeignKey field to be alphabetized by option rather than ordered by
the value (the numeric ID), how would I do that?
For example, I want something like this...
-
Apples
Bananas
Grapes
Oranges
...instead of
OK... thinking about this, I guess add() on a ManyToManyField is just
a wrapper around the save() method of the model your saving it on to.
I can do what I need inside save() and that works fine. Probably more
transparent as well.
Ta.
Andy.
On Oct 1, 9:13 pm, AndyH <[EMAIL PROTECTED]> wrote:
>
On Wed, Oct 1, 2008 at 3:55 PM, Denis Morozov <[EMAIL PROTECTED]> wrote:
>
> Try
> {% if form.errors %}
> Your username and password didn't match.
> Please try again.
> {% endif %}
>
Note this is not an error in the book but rather an indication
If I can get something working, I'll share! Still fiddling around with it.
On Wed, Oct 1, 2008 at 2:48 PM, john Moylan <[EMAIL PROTECTED]> wrote:
> Hi Chris,
>
> I'd love to see your finished code - if you can/want to share?
>
> J
>
> 2008/9/30 Chris Stromberger <[EMAIL PROTECTED]>
>
> OK,
Hi all,
I have an application based around the admin. Is there a way to find
out which users have logged on to the application? I know I could
add logs to the views, but I have several requests that simply go to
the
admin, and do not have "views" associated with them.
I know the database has
I am adding a login page to my app and it keep saying that it can't
find the login.html
This might be a long post, but I want to give any needed info.
I put in urlpatterns = patterns('intranet.timesheets.views', to
set my app path as thr root, but datebrowse and admin comes from
django. Can
On Oct 1, 10:25 pm, bruno desthuilliers
<[EMAIL PROTECTED]> wrote:
> I think this has to do with '/cms/' being defined in both your domain
> name and your apache conf's location directive. Since you tell Django
> the django.root is /cms/, it must add it to build an effectively
> *absolute* url -
Hello,
Is it possible to override the add() method that appears to be on a
ManyToManyField attribute. For example:
cheese = Topping(name="cheese")
cheese.save()
pizza.toppings.add( cheese )
I want to override this add method to add extra code before calling
the original add().
I tired to do
Hi Kelvin,
I just ran into that problem, too.
However the hint to MEDIA_URL was correct!
You must add the following to the very bottom of your urls.py:
if settings.DEBUG:
urlpatterns += patterns('',
(r'^static/(?P.*)$', 'django.views.static.serve',
{'document_root':
Hi Chris,
I'd love to see your finished code - if you can/want to share?
J
2008/9/30 Chris Stromberger <[EMAIL PROTECTED]>
> OK, nevermind on the admin page issue. Was being caused
> by TEMPLATE_STRING_IF_INVALID being set to something other than ''.
> Would still love to see an example of
I have written some sample.
it works for me, hope it will be usefull:
from django.contrib.admin.widgets import AdminFileWidget
from django.utils.safestring import mark_safe
class AdminImageFieldWithThumbWidget(AdminFileWidget):
def render(self, name, value, attrs=None):
thumb_html =
On 1 oct, 21:57, John Allen <[EMAIL PROTECTED]> wrote:
> My experimental Django site is has URLs like
>
> http://allenlux.dyndns.org/cms/weblog/2008/aug/23/website-now-using-r...
>
> where everything lives under the folder /cms/ ie the Apache
> configuration looks like
>
>
> SetHandler
Try
{% if form.errors %}
Your username and password didn't match.
Please try again.
{% endif %}
On Oct 1, 10:53 pm, F Pighi <[EMAIL PROTECTED]> wrote:
> Hello folks, in these days I'm trying to learn a little bit of Django
> for an imminent
My experimental Django site is has URLs like
http://allenlux.dyndns.org/cms/weblog/2008/aug/23/website-now-using-radiant/
where everything lives under the folder /cms/ ie the Apache
configuration looks like
SetHandler python-program
PythonHandler django.core.handlers.modpython
It's back!
No error on dev server, but crashing like crazy on test with same old
crap:
>> Caught an exception while rendering: Reverse for '> 0x2ae96d979410>' with arguments '()' and keyword arguments '{}' not found
It alternates between that and:
>> Caught an exception while rendering: No
Here's how I've gone from a brand new slicehost slice to dreamy
geodjango server.
Cribbed heavily from other setup tutorials, this collects a bunch of
disparate information into one place.
Stack includes nginx frontend, cmemcache, apache/modwsgi, and postgres
8.3.
Thanks !
As a python/django beginner, I am trying to have something nice from
the Java world. I am implement something like Sitemesh(http://
www.opensymphony.com/sitemesh/). The idea is, I can put some tag in
the template to quickly include some external URL's output to the
current page (with
>
> > I have a model in which a field should be generated automatically. So
> > it shouldn't be shown in the admin add page. Also in the change page
> > it should be shown but should be non-editable. As an example-
>
> Pending ticket 342, another way to do this is to make a custom admin
>
Hello folks, in these days I'm trying to learn a little bit of Django
for an imminent project.
I'm following the book titled "Learning website development with
Django" by Packt, but I've got some problems at chapter 4 with the
login process.
The following is the url.py file:
from
On Wed, Oct 1, 2008 at 1:31 PM, FC <[EMAIL PROTECTED]> wrote:
>
> Ok, I've found out this:
>
> http://code.djangoproject.com/ticket/6510
> Block inheritance works fine within {% if %} tags, but not within {%
> ifequal %} or {% ifnotequal %} tags, as illustrated by the code below.
>
> I guess that
Hi All
I have a load of Institutions, some with departments, some not. So I
created a model that can represent this simple hierarchy. See models
at the bottom.
Fine, but a bit confusing for users, plus if the user just wants to
deal with Institutions alone in the admin, they're faced with
Ok, I've found out this:
http://code.djangoproject.com/ticket/6510
Block inheritance works fine within {% if %} tags, but not within {%
ifequal %} or {% ifnotequal %} tags, as illustrated by the code below.
I guess that is the problem.
Someone knows if this issue is going to be resolved or if I
something like this seems to work:
{{ field.field.form.initial.name }}
keith
On Wed, Oct 1, 2008 at 11:28 AM, lingrlongr <[EMAIL PROTECTED]> wrote:
>
> I want to show a formset as just text in a table in the admin. So I'm
> trying to override the tabular.html template. How can I just
I'm trying to switch a field from using the RadioSelect widget to a
HiddenInput widget and am getting the following *template* error:
AttributeError: type object 'Hidden' has no attribute 'attrs'
Here's my code
class MyForm(forms.ModelForm):
date_choice = forms.ChoiceField(choices=[('today',
That's a valid consideration, but yes, if I enabled that field to be
populated based on another field, I would expect it to change regardless of
it was a add form or a change form. The attribute doesn't read
"sometimes_prepopulate_fields". Nor does it read
"always_prepopulate_fields" for that
I think generally I'm less interested in scaling per-se with this than
the ability to host multiple django sites on a single server without
running out of RAM / CPU. VPS hosting, essentially.
On Oct 1, 4:24 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Not with geodjango directly, but
On Wed, Oct 1, 2008 at 5:25 PM, David Hall <[EMAIL PROTECTED]> wrote:
>
> I've just released an open-source version control application for
> Django. It is available for download from Google code.
>
> http://code.google.com/p/django-reversion/
>
> Features include:
>
> - Roll back to any point
On Oct 1, 12:58 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 1, 2008 at 11:03 AM, FC <[EMAIL PROTECTED]> wrote:
>
> viaje_sg_a.html provides the content for a block named "form_a" but no block
> of that name is declared in the templates being extended. You need to
> declare that
On Wed, Oct 1, 2008 at 11:03 AM, FC <[EMAIL PROTECTED]> wrote:
>
> Hi, I've made some changes to my templates and something is broken but
> I just can't find out why.
> I have a base.html template with my site basic structure. Then a
> viaje.html template which displays an object from the
This discussion has been moved from django-developers.
To answer a pending question: This application is for tracking versions
of data, not performing database schema migrations. Thus:
- django-evolution concerns itself with maintaining versions of
database schemas.
-
Hi, I've made some changes to my templates and something is broken but
I just can't find out why.
I have a base.html template with my site basic structure. Then a
viaje.html template which displays an object from the database, and
finally I have a viaje_sg_a.html template which should add a form
I've just released an open-source version control application for
Django. It is available for download from Google code.
http://code.google.com/p/django-reversion/
Features include:
- Roll back to any point in a model's history - an unlimited undo
facility!
- Recover deleted models -
I've been working with TurboGears 1.0 (kid and SQLObject) and I have
some time to do a rewrite. I'm considering either going to TG 2.0
(genshi and SQLAlchemy) or Django.
I'd love to be able to use SQLAlchemy with Django. I've heard some
people are working with this, but I want to know if
I am not sure, but the lazy_ugettext thingy isn't exactly for this?
"Use the function django.utils.translation.ugettext_lazy() to
translate strings lazily -- when the value is accessed rather than
when the ugettext_lazy() function is called."
from
I want to show a formset as just text in a table in the admin. So I'm
trying to override the tabular.html template. How can I just extract
the value of the field, instead of showing the widget. Here's that
particular part of the template:
{% for fieldset in inline_admin_form %}
On Sep 30, 9:27 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote:
> Yea... I didn't know for sure, but I thought it used to. That's why I
> asked. I wonder why that functionality wasn't there by default...
Because in many cases it would be a usability problem. What if you've
manually adjusted the
On Oct 1, 8:34 am, Ramashish Baranwal <[EMAIL PROTECTED]>
wrote:
> I have a model in which a field should be generated automatically. So
> it shouldn't be shown in the admin add page. Also in the change page
> it should be shown but should be non-editable. As an example-
Pending ticket 342,
On Sep 30, 8:00 pm, maverick <[EMAIL PROTECTED]> wrote:
> Hi, I have a django web application, I want to invoke a request of one
> URL inside this application, e.g. "/getdata/", and capture the output
> of such URL and do some further processing.
>
> Of course I can do that by make a real
Will,
You see the entire list, but which group is selected?
[]s
Diego Ucha
http://www.diegoucha.com/
On 1 out, 11:54, WillF <[EMAIL PROTECTED]> wrote:
> I have a Profile model that has a manytomany relationship with a model called
> Group. When I look at the admin pages for a specific profile
I have a Profile model that has a manytomany relationship with a model called
Group. When I look at the admin pages for a specific profile say for
instance 'testprofile'. For the Groups field I see the entire list of all
groups and not just the ones related to 'testprofile'.
Any ideas as to why
Full example here
http://code.djangoproject.com/wiki/NewformsHOWTO#Q:HowdoIchangetheattributesforawidgetonafieldinmymodel.
class MyModelAdmin(admin.ModelAdmin):
...
def formfield_for_dbfield(self, db_field, **kwargs):
field = super(MyModelAdmin,
I have a bunch of fields that I need to check if they have content
added to them. So essentially I want to be able to tell for each entry
into the db that if every field that I need has been filled out, or
not. I want to be able to use this in my queries so that I can get
applications that are
I have this:
http://dpaste.com/81698/
Which would show the status of the app, based on the field 'status' in
the Model. What I couldn't/can't figure out is how to do it for
multiple fields and also how to not do if it is = to something, just
that if any text is entered into the field then it
On Wednesday, 01 October 2008 16:13:18 Karen Tracey wrote:
> looking-glass icon on
> an admin change page where the ForeignKey field has been included in
> raw_id_fields.
Thanks for the lead!
\d
--~--~-~--~~~---~--~~
You received this message because you are
I'm running MySQL as my backend, and I've noticed Django doesn't
create "real" foreign keys for the ForeignKey column. Just indexes. Is
this by design, or am I somehow misusing ForeignKey()?
I found http://code.djangoproject.com/ticket/5729, which seems to
directly address this. It's marked as
On Wed, Oct 1, 2008 at 9:39 AM, Donn <[EMAIL PROTECTED]> wrote:
> I am expecting there to be at least hundreds of authors, perhaps thousands.
> It
> makes no sense to me to stream them all into a select control in the first
> place.
>
> I am aiming for a new kind of control that let's one
On 1 oct, 15:44, Chris <[EMAIL PROTECTED]> wrote:
> I'm running MySQL as my backend, and I've noticed Django doesn't
> create "real" foreign keys for the ForeignKey column. Just indexes. Is
> this by design, or am I somehow misusing ForeignKey()?
> I found
Are you using the MyISAM or InnoDB storage type? MyISAM does not
support integrity constraints, afaik.
Erik
On 01.10.2008, at 16:44, Chris wrote:
>
> I'm running MySQL as my backend, and I've noticed Django doesn't
> create "real" foreign keys for the ForeignKey column. Just indexes. Is
>
On Tue, Sep 30, 2008 at 4:52 AM, chris <[EMAIL PROTECTED]> wrote:
>
> Hi there,
>
> Just starting to use django, so forgive me if this has been answered
> before (a quick search at djanog-search did not turn up something
> useful).
> What I am trying to do is similar to this (from
>
Thanx, works perfectly!
--~--~-~--~~~---~--~~
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
On Wednesday, 01 October 2008 10:28:13 TiNo wrote:
> If you do all that stuff with jquery, why not have jquery hide the original
> select (or modify it for that matter), and on select of an author, have
> jquery set the selected author as 'selected' in the dropdown box? That way
> there is no
On 1 oct, 09:52, maverick <[EMAIL PROTECTED]> wrote:
> @keith, your suggestion seemed to be make a "real" request? I don't
> want to make real request since it's not light weight enough.
>
> @ Jeff, thanks. I don't want to call from view, I want work with the
> "URL". But your suggestion is
Am 30.09.2008 um 20:21 schrieb Rajesh Dhawan:
>
> You are overriding __init__ but not making sure to call the base
> class's __init__ method which does a whole bunch of stuff whenever a
> new instance of a Model class is created. This is most definitely
> causing your problem. It's best not to
On 1 oct, 13:25, Erik Allik <[EMAIL PROTECTED]> wrote:
> Don't forget to modify the request object that you pass to the view
> accordingly if the view actually uses it or passes it to a function
> that does. Otherwise you may run into weird bugs.
Hem... yes, indeed. Thanks for the correction.
Thanks for your reply!
On Wednesday, 01 October 2008 14:51:04 felix wrote:
> > a. How to get it to validate. (clean and co.)
> when you select the desired whatever it should put it into the form's
> hidden field as an id
> or text field
> so that's what should be cleaned.
Yeah, the problem is
On Wed, Oct 1, 2008 at 8:34 AM, Ramashish Baranwal <
[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a model in which a field should be generated automatically. So
> it shouldn't be shown in the admin add page. Also in the change page
> it should be shown but should be non-editable. As an example-
>
did you look through this:
http://www.djangosnippets.org/snippets/1097/
which is similar
> Now this is where I lose the plot:
> a. How to get it to validate. (clean and co.)
when you select the desired whatever it should put it into the form's
hidden field as an id
or text field
so that's
Exception Value: has more
than 1 ForeignKey to
hmm. I'm not sure.
you might be able to get it to work by fudging something or other.
but when it gets complicated like this, and it gets complicated for
django's ORM, then I think its better to rearrange the approach.
On Oct 1, 2:18 pm,
Hi,
I have a model in which a field should be generated automatically. So
it shouldn't be shown in the admin add page. Also in the change page
it should be shown but should be non-editable. As an example-
class Student(models.Model):
first = models.CharField(max_length=64)
last =
Dear Felix,
Thanks for following up on this. I put the traceback up here:
http://paste.pocoo.org/show/86707/
I will try to follow your advice to work around the error and define
the tables differently, since you are right about the way this should
work in the admin interface. But I still
Thanks a mil!
On Oct 1, 12:25 pm, Erik Allik <[EMAIL PROTECTED]> wrote:
> Don't forget to modify the request object that you pass to the view
> accordingly if the view actually uses it or passes it to a function
> that does. Otherwise you may run into weird bugs.
>
> Erik
>
> On 01.10.2008,
Okay, I've got it.
There's just no seperate rss link or button or something.
You can subscribe to the page as whole...
This is, just put "http://www.djangoproject.com/community; into your
favourite newsreader...
(Found it while browsing the source of djangoproject.com)
-benjamin
Am
Don't forget to modify the request object that you pass to the view
accordingly if the view actually uses it or passes it to a function
that does. Otherwise you may run into weird bugs.
Erik
On 01.10.2008, at 14:13, bruno desthuilliers wrote:
>
> On 1 oct, 09:52, maverick <[EMAIL
Hi,
is there a feed for all the items on http://www.djangoproject.com/community/
,
or do I have to subscribe to every single feed seperatly?
-benjamin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
Bump
\d
--~--~-~--~~~---~--~~
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]
If you do all that stuff with jquery, why not have jquery hide the original
select (or modify it for that matter), and on select of an author, have
jquery set the selected author as 'selected' in the dropdown box? That way
there is no need for a custom validation or insertion, and when somebody
i have posted a patch for the csrf middleware on
http://code.djangoproject.com/ticket/8127.
This patch allows to send the session id within a post request
On 2 Sep., 14:29, tom <[EMAIL PROTECTED]> wrote:
> Because of a known Flash bug, the Uploader running in Firefox in
> Windows does not send
Not with geodjango directly, but I'm intersted by the choices you made
regarding the stack.
I'm actually hosting our project on Amazon EC2 (Fedora) and I'm
evaluating scalr.net (Ubuntu) to provide a full redundoncy/scalable
architecture to our project.
We are serving our static from S3, but we
Hi,
I asked a little earlier, but this is a busy list and perhaps my post was too
obscure. Here is an edited repost in the hopes of catching someone who can
help out:
I am trying to create a custom field (and/or widget) that 'looks up' a foreign
key relation -- i.e. lists the other table and
@keith, your suggestion seemed to be make a "real" request? I don't
want to make real request since it's not light weight enough.
@ Jeff, thanks. I don't want to call from view, I want work with the
"URL". But your suggestion is good, I will look inside django code to
see how to do so.
On
On Wednesday, 01 October 2008 08:59:00 Merrick wrote:
> Also how do I access the form submission if not through
> cleaned_data.get?
I have found this works, but I can't say in what cases:
name = form.data['fullname']
\d
--~--~-~--~~~---~--~~
You received this
Yeah thanks, I guess I wasn't clear. I realize I don't have access to
cleaned_data but I want to validate my url the same way as django does
by default on a form - any pointers on how to accomplish that?
Also how do I access the form submission if not through
cleaned_data.get?
On Sep 30,
I am looking for Solid open source web developers to work in Brisbane;
if you know of anyone or have a friend or colleague who would be
interested please let me know or pass on my contact details,
Cheers - Scott +61 (07) 3023 5222
Main skills we are looking for include:
*software version
83 matches
Mail list logo