I was looking for a Django solution to automatically block requests from
bad IP addresses to some of my apps.
After searching for a while without much luck, I attempted to write a
simple Python script that:
- parses my Apache access log
- block IP that made too many requests within a set interval
Hey guys, anyone know about a django package I can use for comment in
django site? The one I see is Django-comment but it's not maintained
anymore. What other one do you know about? Thanks.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Here's my two cents. Hope it helps some.
from proj.settings import TEMPLATE_DIRS, INSTALLED_APPS
import os
def recursive_search(path):
result = []
for i in os.listdir(path):
if not os.path.isdir(os.path.join(path, i)):
result.append(i)
else:
result.extend(recu
Hi,
I have the following custom field:
from django.utils.translation import ugettext_lazy as _
COUNTRIES = (
('GB', _('United Kingdom')),
('AF', _('Afghanistan')),
('AX', _('Aland Islands')),
('AL', _('Albania')),
('DZ', _('Algeria')),
.
.
.
)
class CountryField(m
I've got a use case where I need to find the fields that are different
between two querysets in the same model and then use those fields to
modify another queryset in that model. The first two represent "masks"
of allowed fields for a specific version while the third is the actual
data. Assessmen
Have you tried sorting them at the template level? A filter like dictsort
might do the trick
https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#dictsort
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discu
I always look at djangopackages.com for questions like this:
http://djangopackages.com/grids/g/commenting/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/
Karen Tracey gmail.com> writes:
>
>
> On Mon, Jan 5, 2009 at 3:37 PM, JonUK flinttechnology.co.uk>
wrote:
>
>
>
> Apologies as this is a repost, but I'm completely stuck!
> I'm using django 1.0.2 and the tagging app to retrieve a tag via a
> database "in" query, and something is causing th
Thanks for weighing in, that is helpful, and last night I was playing around
with a somewhat similar approach. It's not exactly what I was hoping for,
because it still isn't really integrated with the way Django uses template
loaders.
This solution works for TEMPLATE_DIRS and INSTALLED_APPS, bu
Yes, I have to agree entirely..
I bungled the OP. Here is what the code snippet should have been:
>>> from django.contrib.auth.models import User
>>> u = User.objects.get(username='clint')
>>> u.get_all_permissions()
set([u'wb.delete_libraryitem', u'wb.change_libraryitem'])
>>> u.has_perm("wb.add_l
I have a python file that works as well, it connects in another
website, doing something like that:
'response, content = self.http.request('http://www.spoj.pl/', 'POST',
headers=self.headers, body=urlencode(self.bodyLogin))'
It goes inside a class, when I run it in a thread it does not works.
If I
I added the missing form inputs as follows:
if ($('.editable').length > 0) {
$('.action-select').each(function(i, el) {
var item_id = $(el).val();
$('form').append("");
});
}
It seems a bug
On Feb 7, 9:10 pm, Nick wrote:
> Whenever I use list_editable inside of the django admin atte
I think this should work:
>>> COUNTRIES = (
... ('GB', _('United Kingdom')),
... ('AF', _('Afghanistan')),
... ('AX', _('Aland Islands')),
... ('AL', _('Albania')),
... ('DZ', _('Algeria')),)
>>> sorted(COUNTRIES, key=lambda COUNTRIES: COUNTRIES[1])
[('AF', 'Afghanistan'), ('AX', 'Aland Islands')
Sorry I just realized that even though that sorts them correctly, it
doesn't solve your problem.
Have you tried setting the choices in your form, like:
class SomeFormUsingCountryField(forms.Form):
def __init__(self, *args, **kwargs):
super(SomeFormUsingCountryField, self).__init__(*ar
My server config: Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 PHP/
5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.5
configured -- resuming normal operations
There is no error at apache log.
I've tried to put:
try:
...response, content...
...print "NEXT"
except Exception as detail:
..print
Just to give more details that I think can be relevant:
"Hi everyone,
I have a django application that works pretty fine with django web-
server.
I have a python file that uses Http() from httplib2, it works very
well! But when I create a thread and in this thread use this python
file(more precisel
On Saturday, February 11, 2012 7:32:09 PM UTC+2, ajohnston wrote:
>
> Have you tried setting the choices in your form, like:
>
> class SomeFormUsingCountryField(forms.Form):
> def __init__(self, *args, **kwargs):
> super(SomeFormUsingCountryField, self).__init__(*args,
> **kwargs)
I have configured the tinymce, but I can't get the local file browsing...
and leads...?
thanx...
--
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,
> class CountryField(models.CharField):
> def __init__(self, *args, **kwargs):
> kwargs.setdefault('max_length', 2)
> kwargs.setdefault('choices', COUNTRIES)
> super(CountryField, self).__init__(*args, **kwargs)
Btw, the reason this doesn't work is because setdefault do
For those packages, I wonder where I can find a demo about how they look ?
Thanks very much
Best regards
On Sat, Feb 11, 2012 at 8:24 AM, Kevin Harvey wrote:
> I always look at djangopackages.com for questions like this:
> http://djangopackages.com/grids/g/commenting/
>
> --
> You received thi
On 11/02/2012 9:38pm, coded kid wrote:
Hey guys, anyone know about a django package I can use for comment in
django site? The one I see is Django-comment but it's not maintained
anymore. What other one do you know about? Thanks.
Is there something wrong with django.contrib.comments ???
It is b
Hi guys,
I was wandering if anyone has a good example of a unit test where they have
a view which processes a web form. I'm not sure how you'd test something
like that.
Thanks,
mario
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
22 matches
Mail list logo