Hi
I'm considering using nginx as a caching reverse-proxy to improve my
site's performance.
When I have the proxy turned on, the CSRF verification does not work
(at least not for contrib.auth login view).
Probably because the csrf_token in the form is cached and invalid.
I've googled this without
I think you should provide your choices in the form field, not when
creating an instance of the form.
The form would then be something like this:
class StoreLocationHoursForm(BForm):
sl_list= [('-', 'Choose Location'), (u'Super City', u'901
PHILADELPHIA STREET')]
location = forms.ChoiceFie
> Would you execute the save function through celery? Is it safe? or maybe if
> save() is executed asynchronously it can cause some unexpected behavior?
You could use signals to trigger execution of celery tasks, e.g. the
post_save signal:
http://docs.djangoproject.com/en/dev/ref/signals/#django.d
400 Bad request indicates that the server did not understand the
request and that the client should not repeat it without modification.
I'd say it doesn't really matter what status code you use internally,
but 403 Forbidden is probably more expressive for this situation.
403 indicates that the serv
It's called 'changelist'
So you should call reverse('admin:invoice_invoice_changelist')
-Sævar
On Oct 12, 1:39 pm, Marc Aymerich wrote:
> I'm trying to find out what is the reverse url sentence for the "admin list"
> of a specific model of an app. Suppose that we have an app called 'invoice'
>
I'm using Django Socialregistration for this purpose.
http://github.com/flashingpumpkin/django-socialregistration
If the user is already logged in and clicks the facebook button, the
existing account is simply linked to the FB account.
New users have the option to set up a username.
- Sævar
On O
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.ordering
On Sep 19, 10:56 pm, rahul jain wrote:
> Hi there !,
>
> How to change ordering of objects/rows on change list view on admin ?
>
> --Rahul
--
You received this message because you are subscribed to
Where exactly are you expecting them to be posted?
I think the Facebook Comments plugin is only supposed to provide a
comment feature on individual pages so that you don't have to write
your own, it's not an external comment box for your FB page.
- Sævar
On Sep 10, 5:41 pm, Bobby Roberts wrote:
I guess you would have to subclass both RemoteUserMiddleware and
RemoteUserBackend. I'm not sure if this will work, but at least it's
one idea.
In your custom RemoteUserMiddleware you would have to set the header
property to HTTP_AUTHORIZATION so that Django knows where to find the
username.
You could use a widget
http://stackoverflow.com/questions/1827526/django-creating-a-form-field-thats-read-only-using-widgets
Best regards,
Sævar
On Aug 24, 7:02 pm, Rodrigo Lombardo wrote:
> Hi,
>
> I'm new to Django and I'm learning a lot reading the docs and some books.
> I'm trying to genera
I take it that you absolutely need to dynamically access the values
through generated keys?
Not just a regular for loop?
{% for var in some_mapping %}
{{ var }}
{% endfor %}
- Sævar
On Aug 9, 8:56 pm, owidjaya wrote:
> in php i can do this
>
> $some_mapping = array( "var1" : content_var1,
>
On Jul 27, 5:24 am, ringemup wrote:
> You might want to check out grappelli and its Related Lookups feature:
>
> http://code.google.com/p/django-grappelli/
>
> On Jul 26, 4:30 pm, Sævar Öfjörð wrote:
>
>
>
> > Hi
>
> > I have some models (Song and Auth
It would help if you submitted your models
- Sævar
On Jul 28, 2:29 pm, kostia wrote:
> I have a model Favourite with fields User, Project, Date, what means
> that some user put some project as favourite on some date. I take all
> favourites filtered by this user and I want to INNER JOIN that info
It's probably best to do this in a custom Manager.
This code is based on this answer: http://markmail.org/message/kwwuskco4gilej2w
You get the idea
class GetPrevNextManager(models.Manager):
def get_next_by_id(self, object):
qs = self.filter(id__gt=object.id)
if qs.count() > 0:
Hi
I have some models (Song and Author) that are related through an
intermediary model (Authorship) like this:
class Song(models.Model)
authors = models.ManyToManyField('Author', through='Authorship')
class Author(models.Model)
name = models.CharField(max_length=255)
class Authorship(mo
You might want to take a look at overriding admin templates:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates
- Sævar
On Jul 12, 8:38 am, gondor wrote:
> I'm trying to add a simple button to a specific add/change page. This
> button takes the user to another ur
That's something that would be nice to have as a snippet on
djangosnippets.org!
On Jul 8, 11:34 am, "euan.godd...@googlemail.com"
wrote:
> I have created a decorator for Django views which handles AJAX
> tracebacks and sends the traceback back to the AJAX application as
> JSON, e.g.
>
> {'status'
That depends entirely on your cache configuration!
Caching in django: http://docs.djangoproject.com/en/dev/topics/cache/
Automatic caching modules that rely on memcached exist, like Johnny
Cache (http://packages.python.org/johnny-cache/) and Django Cache
Machine (http://github.com/jbalogh/django-c
Have you tried resetting your database and syncing it again?
If there are columns missing it sounds like you added them after you
did a manage.py syncdb
Django will not alter your tables after they have been created. More
info on this here:
http://docs.djangoproject.com/en/dev/ref/django-admin/?fro
I've also tried passing this through
django.shortcuts.render_to_response, but I get the same error.
- Sævar
On Jul 6, 2:41 pm, Sævar Öfjörð wrote:
> Hi, I've been using the default template loaders and it works fine.
> Now I want to add the cached template loader, but I get a
Hi, I've been using the default template loaders and it works fine.
Now I want to add the cached template loader, but I get an error.
I'm using a wrapper function to return responses that include the
request in the context, like this:
# file helpers/helpers.py
from django.template import RequestC
If you are storing un-escaped HTML in your database, you must mark it
as safe when you use it in your templates.
You can use the safe filter for that:
{{ some_variable|safe }}
More information:
http://docs.djangoproject.com/en/dev/ref/templates/builtins/
- Sævar
On Jul 3, 7:31 pm, davidgp wrot
22 matches
Mail list logo