leware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddlew
Hello,
I have setup a Django project that is being served via Nginx + gunicorn,
however, I would like to handle graceful database failures.
For example, if the ORM cannot query the database I would like to return a
custom error message.
==> gunicorn.log <==
[2017-06-07 06:06:01 +] [13] [DE
You can define a function that returns the path to upload the image, in
this function you receive as argument the object being saved (instance) and
the name of the file (filename). You can return whatever you want as a path
(that include the filename)
def upload_path(instance, filename):
retur
>> > objects from both models and order them by date, getting result_set
>> > that
>> > might look like this:
>>
>> > movie1
>> > movie2
>> > book1
>> > movie3
>> > book2
>>
>> > is this possible?
>> > if
I need to modify models of the same type as the model I'm saving. I
tried overriding the save method but I get a concurency error (I
think) when I save the other model objects of same type.
Can this be done or should I consider a (long) workaround?
Thanks
--~--~-~--~~~
10x, I eventualy solved the problem. I think I was doing some caching
and so the values didn't resemble the id's I was reading from the
database
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
I'm using a ModelChoiceField on a form and it seems the value
attributes of the generated option tags are simply their numeric order
in the queryset. How can I set the value attribute to some useful
information like id or the __unicode__ representation itself?
Thanks
--~--~-~--~~-
Can the function called by @user_passes_text get any extra argument
except user? Like request maybe?! I'm thinking of using the decorator
on a view function but I need variables from request to determine if
the user is granted access or not.
Thanks
--~--~-~--~~~---~--~
I see that verbose_name is also an interesting option
--~--~-~--~~~---~--~~
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 g
Ok, this is what I was looking for. It doesn't allow me to completly
override the description, instead it just appends my text but I guess
it's good enough.
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Dja
In the admin interface users can browse documentation related to
models and such, using the documentation link. I see that every field
can have a description there. However the model definition chapter in
djangobook says nothing about adding description to fields. Does
anyone now how I can change
Ticket opened here:
http://code.djangoproject.com/ticket/7084
--~--~-~--~~~---~--~~
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 fr
So new lines on blocktrans tags get a \r\n on Windows as opposed to
just \n on Linux. That's what's causing the whole problem. Maybe the
make-messages.py could be modified to check if os.name is nt or os2
and if so read the target file, replace \r with '', write the new
content to a temporary file
Not shure yet but this could be a Windows only issue. I'll get back
later with some tests.
--~--~-~--~~~---~--~~
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@google
Hi,
I'm also trying to update the .po for Romanian. I was runing make-
messages.py -l ro to update the .po and got the same error as
chatchai.
I presume this is a bug in bookmarklets.html, right?
Thanks
Mihai
--~--~-~--~~~---~--~~
You received this message becau
I'm trying to declare two identical blocks in a template that I'm
extending from other templates. This throws the TemplateSyntaxError.
Any ideea on how I can get arround this? I can think of a couple of
examples when it would be useful to repeat a block in a template.
Thanks
--~--~-~--~--
I'm following the official Django tutorial for ver 0.96. I got to the
part where the admin pages are generated and noticed that none of the
javascript helpers mentioned in the tutorial get displayed on my pages
(the date - time control, or the show link for collapsible fields,
etc.).
I use 0.96.1
17 matches
Mail list logo