Monday, October 31, 2011

Re: Login problems under heavy load

On 24 October 2011 12:01, Tom Evans <tevans.uk@googlemail.com> wrote:
On Fri, Oct 21, 2011 at 6:15 PM, Alpesh Gajbe <alpeshgajbe@gmail.com> wrote:
>
>  File "/usr/local/lib/python2.6/dist-packages/django/http/__init__.py",
> line 296, in read
>   return self._stream.read(*args, **kwargs)
>
> IOError: request data read error
>

tl;dr - the user got bored waiting, pressed 'stop' on their browser.


Although that's almost always true, it *is* possible to see "request data read error" on WSGI that isn't caused by the user hitting stop. See for example the ModWSGI FAQ.

Malcolm 

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: Django tutorial hasn't received an update for 1.3

Hi,

If you've figured this stuff out, how about writing some of the tutorial yourself and submitting a patch?

Trying to teach someone else is the best way to figure out if you really understand something, and you'd be contributing to keeping the Django documentation great.

Malcolm

On 31 October 2011 07:08, Kevin <kveroneau@gmail.com> wrote:
I keep checking the tutorial page for version 1.3 hoping to see some
new content related to the class-based views or at least some of the
promised future tutorials.  The tutorial still has the function-based
views, and no new updates since I first went through it on the 1.2
release.

I know the function views work in 1.3, but shouldn't the tutorial be
using the latest features included in 1.3 so that new users coming to
Django begin learning the newest features, such as class-based views.

I'm still a dinosaur and using Django 1.2 and haven't yet dived into
class-based views, and when I do, I would love a great tutorial on how
to proceed.  I plan on learning Django 1.3's newest features very soon
to keep myself up to speed and see if my current apps are fully
compatible.

Are there any updates on when we will see the following new tutorial
sections:
-    Advanced form processing
-    Using the RSS framework
-    Using the cache framework
-    Using the comments framework
-    Advanced admin features: Permissions
-    Advanced admin features: Custom JavaScript

I figured out most of this on my own, as they are pretty
straightforward, still haven't dived into custom javascript in the
admin yet.

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
Malcolm Box
malcolm.box@gmail.com

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: variables in a dict in a template

On Mon, Oct 31, 2011 at 2:36 AM, kenneth gonsalves
<lawgon@thenilgiris.com> wrote:
> On Sun, 2011-10-30 at 12:00 -0400, Kurtis Mullins wrote:
>> One way to go about it is to create multiple, nested objects. For
>> example:
>>
>> Score - Rounds ---- Holes
>>
>> Then in your template, you'd do something along the lines of:
>>
>> {% for round in game.rounds %} {% for hole in round.holes %}
>> {{ hole.score }} {% endfor %} {% endfor%}
>>
>>
>> Hopefully that helps a little :)
>
> that was my original structure - but there was too much code required,
> and after several years of using it, I still found difficulty in
> understanding and upgrading it. The present structure is simple and
> flexible - the only downside is that I have write some extra html.
> Anyway it is just one template and I suppose I have to live with it.
> --
> regards
> Kenneth Gonsalves

When the going gets complicated, my simple mind reaches for python.
Maybe a custom template filter?

Bill

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: I can't activate the admin site

On 31/10/2011 02:12 μμ, kenneth gonsalves wrote:
>
> but the indentation error seems to be in the django source code?
> Normally one does not fiddle with that.
>

no I wouldn't expect the indentation problem to be located in django code.
unless you are using an unstable version or something....

--
--------------------------------------------------------------
Nick Apostolakis
e-mail: nickapos@oncrete.gr
Web Site: http://nick.oncrete.gr
--------------------------------------------------------------


--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Why are my two django objects of the same type behaving differently?

Help!

I have two objects that i have created using different techniques in
django;

>>> from django.contrib.contenttypes.models import ContentType
>>> from myproject.models import Building

Method A

>>> content_type = ContentType.objects.get(app_label='myproject', model='Building')

>>> content_class = content_type.model_class()

>>> content_query = content_class.objects.raw("Select * from pms_building where name like '%build%' ")

>>> type(content_query)

<class 'django.db.models.query.RawQuerySet'>
>>> content_query[0]
# error ....
# Attribute: 'str' object has no attribute 'items'

Method B

>>> bld = Building.objects.raw("Select * from pms_building where name like '%build%' ")

>>> type(bld)

<class 'django.db.models.query.RawQuerySet'>

>>>bld[0]
<Building: Building A>

My question is why are the two objects of the same type behaving
differently?

Gath

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Re: django-easyfilters for filtering data in a view

If anyone else is having trouble here, my problem was in passing the
template when loaded from an external file--specifying the template
inline worked fine for me.

The context variables are provided in the documentation.


Good luck
-alan


On Oct 30, 9:21 pm, Alan <alan.ill...@gmail.com> wrote:
> I'm trying to put together a view that filters data similar to the
> admin interface's change lists for a model.
>
> Does anyone use django-easyfilters for this purpose?
>
> The documentation is very terse on how to use the get_template()
> method:http://packages.python.org/django-easyfilters/filterset.html
>
> I correctly return a template but I'm not sure how to provide the
> context data from the derived FilterSet class.
>
> Thanks
> -alan

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Can't add superuser

Hi, I'm unable to add superuser. Running latest development trunk of
Django, & Python 2.7

You just installed Django's auth system, which means you don't have
any superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):
File "./manage.py", line 9, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/
__init__.py", line 422, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/
__init__.py", line 361, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/
base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/site-packages/django/core/management/
base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/
base.py", line 351, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/
commands/syncdb.py", line 109, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/usr/local/lib/python2.7/site-packages/django/core/management/
sql.py", line 189, in emit_post_sync_signal
interactive=interactive, db=db)
File "/usr/local/lib/python2.7/site-packages/django/dispatch/
dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/
management/__init__.py", line 73, in create_superuser
call_command("createsuperuser", interactive=True)
File "/usr/local/lib/python2.7/site-packages/django/core/management/
__init__.py", line 148, in call_command
return klass.execute(*args, **defaults)
File "/usr/local/lib/python2.7/site-packages/django/core/management/
base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/
management/commands/createsuperuser.py", line 63, in handle
default_username = get_default_username()
File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/
management/__init__.py", line 105, in get_default_username
default_username = get_system_username()
File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/
management/__init__.py", line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
TypeError: decode() argument 1 must be string, not None


Because of this, I can't use the admin app:
Site matching query does not exist.

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.