Re: Django v3.2 broken admin interface due to malicious JSON value

2023-03-09 Thread 'Johannes Filter' via Django users
Thanks for the hint. I indeed used the fuzzer a while ago with an older 
Python version. I just tried to save this kind of string and I now receive 
the same `ValueError` when the malicious string would get saved to the DB. 
On Wednesday, 8 March 2023 at 01:06:41 UTC+1 Mike Dewhirst wrote:

> On 8/03/2023 7:49 am, hi via Django users wrote:
>
> Hello everybody,
>
> I’ve used a fuzzer on my Django v3.2 project that resulted in a broken 
> admin interface. I’m not sure whether this is a bug or a rough edge case. 
>
> I’m using Python 3.9.13 with Django 3.2.18 with Postgres.
>
> I have a Model with a JSONField and also added the model to my admin view 
> (I don’t use the JSON field on the list view / filter)
>
> ```
> data = models.JSONField(null=True, blank=True)
> ```
>
> The fuzzer added (via an API view) a string with 10,000 characters to the 
> data field. 
>
> Every time I want to open the admin list view (and the malicious object is 
> part of the page), my Django crashes with the following message:
>
>
> It appears the fix introduced the ValueError in the following version to 
> the one you are using hence fuzzing is probably finding a different problem.
>
> Everything I have read in Django docs about collecting external input 
> warns against letting stuff in unfiltered.
>
> Perhaps you do have to prevent malicious strings. I think I would.
>
>
> > ValueError
> > 
> > Exceeds the limit (4300) for integer string conversion: value has 1 
> digits; use sys.set_int_max_str_digits() to increase the limit
>
> I have attached my Sentry stack trace as a screenshot.
>
> If this is an intended behavior, I have to validate the data to prevent 
> malicious strings. But it feels like the admin interface should be able to 
> handle those JSON values.
>
> It looks like the Python releases in Sep 2022 have to do with this 
> bug/edge case: 
> https://mail.python.org/archives/list/pytho...@python.org/message/B25APD6FF27NJWKTEGAFRUDNSVVAFIHQ/
>  
> <https://mail.python.org/archives/list/python-...@python.org/message/B25APD6FF27NJWKTEGAFRUDNSVVAFIHQ/>
>
> Kind Regards,
>
> Johannes
>
>
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/6172A96F-F5FD-4694-9597-DFA815297945%40jfilter.de
>  
> <https://groups.google.com/d/msgid/django-users/6172A96F-F5FD-4694-9597-DFA815297945%40jfilter.de?utm_medium=email_source=footer>
> .
>
>
>
> -- 
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Your
> email software can handle signing.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/474230e5-ad03-4704-b15d-1b231d549945n%40googlegroups.com.


Django v3.2 broken admin interface due to malicious JSON value

2023-03-07 Thread hi via Django users
Hello everybody,

I’ve used a fuzzer on my Django v3.2 project that resulted in a broken admin 
interface. I’m not sure whether this is a bug or a rough edge case.

I’m using Python 3.9.13 with Django 3.2.18 with Postgres.

I have a Model with a JSONField and also added the model to my admin view (I 
don’t use the JSON field on the list view / filter)

```
data = models.JSONField(null=True, blank=True)
```

The fuzzer added (via an API view) a string with 10,000 characters to the data 
field. 

Every time I want to open the admin list view (and the malicious object is part 
of the page), my Django crashes with the following message:

> ValueError
> 
> Exceeds the limit (4300) for integer string conversion: value has 1 
> digits; use sys.set_int_max_str_digits() to increase the limit

I have attached my Sentry stack trace as a screenshot.

If this is an intended behavior, I have to validate the data to prevent 
malicious strings. But it feels like the admin interface should be able to 
handle those JSON values.

It looks like the Python releases in Sep 2022 have to do with this bug/edge 
case: 
https://mail.python.org/archives/list/python-...@python.org/message/B25APD6FF27NJWKTEGAFRUDNSVVAFIHQ/
 
<https://mail.python.org/archives/list/python-...@python.org/message/B25APD6FF27NJWKTEGAFRUDNSVVAFIHQ/>

Kind Regards,

Johannes




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6172A96F-F5FD-4694-9597-DFA815297945%40jfilter.de.


Re: Filtering by custom UUIDField got broken with Django 3.2 upgrade

2022-05-05 Thread Michael Powell
AFAIK, 'dashes' in a character based persisted UUID is divergent behavior. 
UUID are 128 bits wide, apportioned by nibble into a character field, 32 at 
most. So... The migration is yours to correct. Good luck, good hunting, HTH.

On Wednesday, May 4, 2022 at 11:14:02 AM UTC-4 bmila...@gmail.com wrote:

> Hello Django users,
>
> I've recently upgraded the Django version from 2.2 to 3.2 in a project at 
> work. In this project, we've been using a custom version of UUIDField since 
> version 1.x without issues. The purpose of this field is to persist the 
> full UUIDs with dashes into the database (MySQL char(36)).
>
> import uuid
>
> from django.db import models
>
>
> class UUIDField(models.UUIDField):
> """
> Overrides Django UUIDField to store full UUID's including dashes.
> """
> def __init__(self, verbose_name=None, **kwargs):
> super().__init__(verbose_name, **kwargs)
> self.max_length = 36
>
> def get_internal_type(self):
> return "CharField"
>
> def get_db_prep_value(self, value, connection, prepared=False):
> if value is None:
> return None
> if not isinstance(value, uuid.UUID):
> try:
> value = uuid.UUID(value)
> except AttributeError:
> raise TypeError(self.error_messages['invalid'] % {'value': 
> value})
>
> if connection.features.has_native_uuid_field:
> return value
> return str(value)
>
> Now the problem introduced with 3.2 is that filtering by this field 
> doesn't work properly. If I try to filter by a full UUID (with or without 
> dashes) it returns an empty QuerySet. If I provide only one part of the 
> UUID (i.e. one group of characters between the dashes) it works just fine.
>
> Python 3.6.9 (default, Mar 15 2022, 13:55:28)
> [GCC 8.4.0] on linuxType "help", "copyright", "credits" or "license" for more 
> information.
> (InteractiveConsole)>>> from foobar.foo.models import Foo
> >>>>>> Foo.objects.all()
> ]>
> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-caf0-11ec-bdb9-482ae362a4c0')
> 
> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-')
> ]>
> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-c')
> 
> >>>
>
> Here's a little Github Gist 
> <https://gist.github.com/milonoir/080ecfe1d0fa52df0a0c4a6ab265dde0> where 
> I uploaded a simplified model.py and admin.py along with the UUIDField. 
> This is what I used above in the python shell. Any help would be 
> appreciated, I couldn't figure out how to fix it.
>
> (PS: I also raised this in StackOverflow 
> <https://stackoverflow.com/questions/72101751/filtering-by-custom-uuidfield-got-broken-with-django-3-2-upgrade>
>  
> just in case you came across with it.)
>
> Cheers,
> Milan
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cdd244e4-f73f-4cfb-a7cc-0e4fdc130a82n%40googlegroups.com.


Re: Filtering by custom UUIDField got broken with Django 3.2 upgrade

2022-05-05 Thread Jason
and curious why the change in this behavior vs using the db's native uuid 
type directly

On Thursday, May 5, 2022 at 7:27:02 AM UTC-4 Jason wrote:

> when you print the query executed, what is the difference between a 
> working query and the current one?
>
> On Wednesday, May 4, 2022 at 11:14:02 AM UTC-4 bmila...@gmail.com wrote:
>
>> Hello Django users,
>>
>> I've recently upgraded the Django version from 2.2 to 3.2 in a project at 
>> work. In this project, we've been using a custom version of UUIDField since 
>> version 1.x without issues. The purpose of this field is to persist the 
>> full UUIDs with dashes into the database (MySQL char(36)).
>>
>> import uuid
>>
>> from django.db import models
>>
>>
>> class UUIDField(models.UUIDField):
>> """
>> Overrides Django UUIDField to store full UUID's including dashes.
>> """
>> def __init__(self, verbose_name=None, **kwargs):
>> super().__init__(verbose_name, **kwargs)
>> self.max_length = 36
>>
>> def get_internal_type(self):
>> return "CharField"
>>
>> def get_db_prep_value(self, value, connection, prepared=False):
>> if value is None:
>> return None
>> if not isinstance(value, uuid.UUID):
>> try:
>> value = uuid.UUID(value)
>> except AttributeError:
>> raise TypeError(self.error_messages['invalid'] % 
>> {'value': value})
>>
>> if connection.features.has_native_uuid_field:
>> return value
>> return str(value)
>>
>> Now the problem introduced with 3.2 is that filtering by this field 
>> doesn't work properly. If I try to filter by a full UUID (with or without 
>> dashes) it returns an empty QuerySet. If I provide only one part of the 
>> UUID (i.e. one group of characters between the dashes) it works just fine.
>>
>> Python 3.6.9 (default, Mar 15 2022, 13:55:28)
>> [GCC 8.4.0] on linuxType "help", "copyright", "credits" or "license" for 
>> more information.
>> (InteractiveConsole)>>> from foobar.foo.models import Foo
>> >>>>>> Foo.objects.all()
>> ]>
>> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-caf0-11ec-bdb9-482ae362a4c0')
>> 
>> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-')
>> ]>
>> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-c')
>> 
>> >>>
>>
>> Here's a little Github Gist 
>> <https://gist.github.com/milonoir/080ecfe1d0fa52df0a0c4a6ab265dde0> 
>> where I uploaded a simplified model.py and admin.py along with the 
>> UUIDField. This is what I used above in the python shell. Any help would be 
>> appreciated, I couldn't figure out how to fix it.
>>
>> (PS: I also raised this in StackOverflow 
>> <https://stackoverflow.com/questions/72101751/filtering-by-custom-uuidfield-got-broken-with-django-3-2-upgrade>
>>  
>> just in case you came across with it.)
>>
>> Cheers,
>> Milan
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1766da19-69ca-461f-8a50-908118f18d33n%40googlegroups.com.


Re: Filtering by custom UUIDField got broken with Django 3.2 upgrade

2022-05-05 Thread Jason
when you print the query executed, what is the difference between a working 
query and the current one?

On Wednesday, May 4, 2022 at 11:14:02 AM UTC-4 bmila...@gmail.com wrote:

> Hello Django users,
>
> I've recently upgraded the Django version from 2.2 to 3.2 in a project at 
> work. In this project, we've been using a custom version of UUIDField since 
> version 1.x without issues. The purpose of this field is to persist the 
> full UUIDs with dashes into the database (MySQL char(36)).
>
> import uuid
>
> from django.db import models
>
>
> class UUIDField(models.UUIDField):
> """
> Overrides Django UUIDField to store full UUID's including dashes.
> """
> def __init__(self, verbose_name=None, **kwargs):
> super().__init__(verbose_name, **kwargs)
> self.max_length = 36
>
> def get_internal_type(self):
> return "CharField"
>
> def get_db_prep_value(self, value, connection, prepared=False):
> if value is None:
> return None
> if not isinstance(value, uuid.UUID):
> try:
> value = uuid.UUID(value)
> except AttributeError:
> raise TypeError(self.error_messages['invalid'] % {'value': 
> value})
>
> if connection.features.has_native_uuid_field:
> return value
> return str(value)
>
> Now the problem introduced with 3.2 is that filtering by this field 
> doesn't work properly. If I try to filter by a full UUID (with or without 
> dashes) it returns an empty QuerySet. If I provide only one part of the 
> UUID (i.e. one group of characters between the dashes) it works just fine.
>
> Python 3.6.9 (default, Mar 15 2022, 13:55:28)
> [GCC 8.4.0] on linuxType "help", "copyright", "credits" or "license" for more 
> information.
> (InteractiveConsole)>>> from foobar.foo.models import Foo
> >>>>>> Foo.objects.all()
> ]>
> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-caf0-11ec-bdb9-482ae362a4c0')
> 
> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-')
> ]>
> >>>>>> Foo.objects.filter(id__icontains='34c46fe8-c')
> 
> >>>
>
> Here's a little Github Gist 
> <https://gist.github.com/milonoir/080ecfe1d0fa52df0a0c4a6ab265dde0> where 
> I uploaded a simplified model.py and admin.py along with the UUIDField. 
> This is what I used above in the python shell. Any help would be 
> appreciated, I couldn't figure out how to fix it.
>
> (PS: I also raised this in StackOverflow 
> <https://stackoverflow.com/questions/72101751/filtering-by-custom-uuidfield-got-broken-with-django-3-2-upgrade>
>  
> just in case you came across with it.)
>
> Cheers,
> Milan
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5b4045d3-9687-4388-8063-a3f4ffca1dc4n%40googlegroups.com.


Fwd: Filtering by custom UUIDField got broken with Django 3.2 upgrade

2022-05-04 Thread Milán Boleradszki
Hello Django users,

I've recently upgraded the Django version from 2.2 to 3.2 in a project at
work. In this project, we've been using a custom version of UUIDField since
version 1.x without issues. The purpose of this field is to persist the
full UUIDs with dashes into the database (MySQL char(36)).

import uuid

from django.db import models


class UUIDField(models.UUIDField):
"""
Overrides Django UUIDField to store full UUID's including dashes.
"""
def __init__(self, verbose_name=None, **kwargs):
super().__init__(verbose_name, **kwargs)
self.max_length = 36

def get_internal_type(self):
return "CharField"

def get_db_prep_value(self, value, connection, prepared=False):
if value is None:
return None
if not isinstance(value, uuid.UUID):
try:
value = uuid.UUID(value)
except AttributeError:
raise TypeError(self.error_messages['invalid'] % {'value':
value})

if connection.features.has_native_uuid_field:
return value
return str(value)

Now the problem introduced with 3.2 is that filtering by this field doesn't
work properly. If I try to filter by a full UUID (with or without dashes)
it returns an empty QuerySet. If I provide only one part of the UUID (i.e.
one group of characters between the dashes) it works just fine.

Python 3.6.9 (default, Mar 15 2022, 13:55:28)
[GCC 8.4.0] on linuxType "help", "copyright", "credits" or "license"
for more information.
(InteractiveConsole)>>> from foobar.foo.models import Foo
>>>>>> Foo.objects.all()
]>
>>>>>> Foo.objects.filter(id__icontains='34c46fe8-caf0-11ec-bdb9-482ae362a4c0')

>>>>>> Foo.objects.filter(id__icontains='34c46fe8-')
]>
>>>>>> Foo.objects.filter(id__icontains='34c46fe8-c')

>>>

Here's a little Github Gist
<https://gist.github.com/milonoir/080ecfe1d0fa52df0a0c4a6ab265dde0> where I
uploaded a simplified model.py and admin.py along with the UUIDField. This
is what I used above in the python shell. Any help would be appreciated, I
couldn't figure out how to fix it.

(PS: I also raised this in StackOverflow
<https://stackoverflow.com/questions/72101751/filtering-by-custom-uuidfield-got-broken-with-django-3-2-upgrade>
just in case you came across with it.)

Cheers,
Milan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE8kq5Kgo4pY9y93wj1dEzoGyDf_JHoPYqdtYfGi_1jWHX7%2Bg%40mail.gmail.com.


Re: 2.2.* to 3.2.5 update: jsonb deserialisation is broken!

2021-08-01 Thread Jason
going from 2.2.x to 3.2 is three separate releases of django.  That's alot 
to go in one jump.  Might help if you update one release at a time and 
narrow down which version this regression is in.  

In addition, I'd check the changelogs for each version and see what, if 
any, might apply to your issue.
On Sunday, August 1, 2021 at 10:04:59 AM UTC-4 Tim Richardson wrote:

> Database is postgresql 12
>  psycopg2-binary==2.8.6 \
>
> The bug occurs when I move from django 2.2.* to 3.2.5
> A raw sql query is now behaving differently. A result that was previously 
> deserialised from a jsonb field into a python dict now returns a string 
> (and breaks things). 
>
> this is a simplifed version of my query: 
>
>  sql = """select
> 
> jsonb_array_elements(cached_dear_dearcache.jdata#>'{Fulfilments}')->'Pick' 
> as picks
> from cached_dear_dearcache
>  """
>
> jdata is a jsonb field.
>
> picks should be a dict, eg 
> {"Lines":[{...line1...},{...line2...}]
>
> this has always worked; this django project has always been on 2.2.x
> I use this code in production on a variety of postgresql datbase from v 
> 9.6 to v12.
>
> As soon as I update to 3.2.5, I no longer get a dict. Instead, I get a 
> string which is json. 
>
> I have downgraded to 2.2 since this is major problem. 
>
> Is it a bug or have I missed something?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1328c62b-42a7-42f2-a20d-632a579d12f4n%40googlegroups.com.


2.2.* to 3.2.5 update: jsonb deserialisation is broken!

2021-08-01 Thread Tim Richardson
Database is postgresql 12
 psycopg2-binary==2.8.6 \

The bug occurs when I move from django 2.2.* to 3.2.5
A raw sql query is now behaving differently. A result that was previously 
deserialised from a jsonb field into a python dict now returns a string 
(and breaks things). 

this is a simplifed version of my query: 

 sql = """select

jsonb_array_elements(cached_dear_dearcache.jdata#>'{Fulfilments}')->'Pick' 
as picks
from cached_dear_dearcache
 """

jdata is a jsonb field.

picks should be a dict, eg 
{"Lines":[{...line1...},{...line2...}]

this has always worked; this django project has always been on 2.2.x
I use this code in production on a variety of postgresql datbase from v 9.6 
to v12.

As soon as I update to 3.2.5, I no longer get a dict. Instead, I get a 
string which is json. 

I have downgraded to 2.2 since this is major problem. 

Is it a bug or have I missed something?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/45582bbb-6ec7-4655-a868-bc0dadf3e843n%40googlegroups.com.


fatal: sha1 file '' write error: Broken pipe

2021-02-02 Thread Lightning Bit
How do you fix the broken pipe when trying to push Django project using 
Git? The file is 5GB large

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e031db28-2142-40c8-acd8-d9af1de00a57n%40googlegroups.com.


Re: Django 2.1.2 update, admin interface broken: render() got an unexpected keyword argument 'renderer'

2018-10-09 Thread carlos
Hi, many third party app same error for example django-autocomplete-light,
this solution
https://github.com/stuartaccent/django-autocomplete-light/commit/cfc5f4a25fcb4937cf07fc65ef4ed549ca0d1338

add renderer parameter in the function render this solve the problem .
you need find in you widget app the correct function and add this new
parameter

Cheers

On Mon, Oct 8, 2018 at 10:12 PM Aileen  wrote:

> Thanks for the response! Which lines of the widget code should we update?
> We are also using Docker to host our Django dev/production environments -
> is there a way to update widget code that will persist between builds?
>
> On Monday, October 8, 2018 at 7:25:43 PM UTC-7, Aileen wrote:
>>
>> Hello,
>>
>> After upgrading Django from 2.0.8 to 2.1.2, the admin interface no longer
>> seems to work due to some problems with our widgets. This is the error that
>> I get:
>>
>> [image: image.png]
>>
>> And here is the full call stack:
>>
>> Environment:
>>
>>
>> Request Method: GET
>> Request URL: http://localhost:8000/admin/website/person/2/change/
>>
>> Django Version: 2.1.2
>> Python Version: 3.6.3
>> Installed Applications:
>> ['website.apps.WebsiteConfig',
>>  'django.contrib.admin',
>>  'django.contrib.auth',
>>  'django.contrib.contenttypes',
>>  'django.contrib.sessions',
>>  'django.contrib.messages',
>>  'django.contrib.staticfiles',
>>  'django_extensions',
>>  'image_cropping',
>>  'easy_thumbnails',
>>  'sortedm2m',
>>  'sortedm2m_filter_horizontal_widget',
>>  'rest_framework']
>> Installed Middleware:
>> ['django.middleware.security.SecurityMiddleware',
>>  'django.contrib.sessions.middleware.SessionMiddleware',
>>  'django.middleware.common.CommonMiddleware',
>>  'django.middleware.csrf.CsrfViewMiddleware',
>>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>>  'django.contrib.messages.middleware.MessageMiddleware',
>>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>>
>>
>> Template error:
>> In template 
>> /usr/local/lib/python3.6/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html,
>>  error at line 19
>>render() got an unexpected keyword argument 'renderer'
>>9 : {% for field in line %}
>>10 : > class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% 
>> endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% 
>> if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} 
>> class="checkbox-row"{% endif %}>
>>11 : {% if not line.fields|length_is:'1' and not 
>> field.is_readonly %}{{ field.errors }}{% endif %}
>>12 : {% if field.is_checkbox %}
>>13 : {{ field.field }}{{ field.label_tag }}
>>14 : {% else %}
>>15 : {{ field.label_tag }}
>>16 : {% if field.is_readonly %}
>>17 : {{ field.contents 
>> }}
>>18 : {% else %}
>>19 :  {{ field.field }}
>>20 : {% endif %}
>>21 : {% endif %}
>>22 : {% if field.field.help_text %}
>>23 : {{ 
>> field.field.help_text|safe }}
>>24 : {% endif %}
>>25 : 
>>26 : {% endfor %}
>>27 : 
>>28 : {% endfor %}
>>29 : 
>>
>>
>> Traceback:
>>
>> File 
>> "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" 
>> in inner
>>   34. response = get_response(request)
>>
>> File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" 
>> in _get_response
>>   156. response = self.process_exception_by_middleware(e, 
>> request)
>>
>> File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" 
>> in _get_response
>>   154. response = response.render()
>>
>> File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in 
>> render
>>   106. self.content = self.rendered_content
>>
>> File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in 
>> rendered_content
>>   83. content = template.render(context, self._request)
>>
>> File 
>> "/usr/local/lib/python3.6/site-packages/django/template/backends/django.py" 
>> in render
>>   61. return self.template.render(context)
>>
>> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
>> render
>>   171. return self._render(context)
>>
>> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
>> _render
>>   163. return self.nodelist.render(context)
>>
>> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
>> render
>>   937. bit = node.render_annotated(context)
>>
>> File 

Re: Django 2.1.2 update, admin interface broken: render() got an unexpected keyword argument 'renderer'

2018-10-08 Thread Aileen
Thanks for the response! Which lines of the widget code should we update? 
We are also using Docker to host our Django dev/production environments - 
is there a way to update widget code that will persist between builds?

On Monday, October 8, 2018 at 7:25:43 PM UTC-7, Aileen wrote:
>
> Hello,
>
> After upgrading Django from 2.0.8 to 2.1.2, the admin interface no longer 
> seems to work due to some problems with our widgets. This is the error that 
> I get:
>
> [image: image.png]
>
> And here is the full call stack:
>
> Environment:
>
>
> Request Method: GET
> Request URL: http://localhost:8000/admin/website/person/2/change/
>
> Django Version: 2.1.2
> Python Version: 3.6.3
> Installed Applications:
> ['website.apps.WebsiteConfig',
>  'django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'django_extensions',
>  'image_cropping',
>  'easy_thumbnails',
>  'sortedm2m',
>  'sortedm2m_filter_horizontal_widget',
>  'rest_framework']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
>
> Template error:
> In template 
> /usr/local/lib/python3.6/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html,
>  error at line 19
>render() got an unexpected keyword argument 'renderer'
>9 : {% for field in line %}
>10 :  class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif 
> %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if 
> field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} 
> class="checkbox-row"{% endif %}>
>11 : {% if not line.fields|length_is:'1' and not 
> field.is_readonly %}{{ field.errors }}{% endif %}
>12 : {% if field.is_checkbox %}
>13 : {{ field.field }}{{ field.label_tag }}
>14 : {% else %}
>15 : {{ field.label_tag }}
>16 : {% if field.is_readonly %}
>17 : {{ field.contents 
> }}
>18 : {% else %}
>19 :  {{ field.field }} 
>20 : {% endif %}
>21 : {% endif %}
>22 : {% if field.field.help_text %}
>23 : {{ 
> field.field.help_text|safe }}
>24 : {% endif %}
>25 : 
>26 : {% endfor %}
>27 : 
>28 : {% endfor %}
>29 : 
>
>
> Traceback:
>
> File 
> "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in 
> inner
>   34. response = get_response(request)
>
> File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in 
> _get_response
>   156. response = self.process_exception_by_middleware(e, 
> request)
>
> File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in 
> _get_response
>   154. response = response.render()
>
> File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in 
> render
>   106. self.content = self.rendered_content
>
> File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in 
> rendered_content
>   83. content = template.render(context, self._request)
>
> File 
> "/usr/local/lib/python3.6/site-packages/django/template/backends/django.py" 
> in render
>   61. return self.template.render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> render
>   171. return self._render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> _render
>   163. return self.nodelist.render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> render
>   937. bit = node.render_annotated(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> render_annotated
>   904. return self.render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" 
> in render
>   150. return compiled_parent._render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> _render
>   163. return self.nodelist.render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> render
>   937. bit = 

Re: Django 2.1.2 update, admin interface broken: render() got an unexpected keyword argument 'renderer'

2018-10-08 Thread carlos
yes verison 2.1 remove see this link
https://docs.djangoproject.com/en/dev/internals/deprecation/#deprecation-removed-in-2-1

you need update you code in widget part.

On Mon, Oct 8, 2018 at 8:25 PM Aileen  wrote:

> Hello,
>
> After upgrading Django from 2.0.8 to 2.1.2, the admin interface no longer
> seems to work due to some problems with our widgets. This is the error that
> I get:
>
> [image: image.png]
>
> And here is the full call stack:
>
> Environment:
>
>
> Request Method: GET
> Request URL: http://localhost:8000/admin/website/person/2/change/
>
> Django Version: 2.1.2
> Python Version: 3.6.3
> Installed Applications:
> ['website.apps.WebsiteConfig',
>  'django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'django_extensions',
>  'image_cropping',
>  'easy_thumbnails',
>  'sortedm2m',
>  'sortedm2m_filter_horizontal_widget',
>  'rest_framework']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
>
> Template error:
> In template 
> /usr/local/lib/python3.6/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html,
>  error at line 19
>render() got an unexpected keyword argument 'renderer'
>9 : {% for field in line %}
>10 :  class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif 
> %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if 
> field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} 
> class="checkbox-row"{% endif %}>
>11 : {% if not line.fields|length_is:'1' and not 
> field.is_readonly %}{{ field.errors }}{% endif %}
>12 : {% if field.is_checkbox %}
>13 : {{ field.field }}{{ field.label_tag }}
>14 : {% else %}
>15 : {{ field.label_tag }}
>16 : {% if field.is_readonly %}
>17 : {{ field.contents 
> }}
>18 : {% else %}
>19 :  {{ field.field }}
>20 : {% endif %}
>21 : {% endif %}
>22 : {% if field.field.help_text %}
>23 : {{ 
> field.field.help_text|safe }}
>24 : {% endif %}
>25 : 
>26 : {% endfor %}
>27 : 
>28 : {% endfor %}
>29 : 
>
>
> Traceback:
>
> File 
> "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in 
> inner
>   34. response = get_response(request)
>
> File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in 
> _get_response
>   156. response = self.process_exception_by_middleware(e, 
> request)
>
> File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in 
> _get_response
>   154. response = response.render()
>
> File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in 
> render
>   106. self.content = self.rendered_content
>
> File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in 
> rendered_content
>   83. content = template.render(context, self._request)
>
> File 
> "/usr/local/lib/python3.6/site-packages/django/template/backends/django.py" 
> in render
>   61. return self.template.render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> render
>   171. return self._render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> _render
>   163. return self.nodelist.render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> render
>   937. bit = node.render_annotated(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> render_annotated
>   904. return self.render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" 
> in render
>   150. return compiled_parent._render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> _render
>   163. return self.nodelist.render(context)
>
> File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
> render
>   937. bit = node.render_annotated(context)
>
> File 

Django 2.1.2 update, admin interface broken: render() got an unexpected keyword argument 'renderer'

2018-10-08 Thread Aileen
Hello,

After upgrading Django from 2.0.8 to 2.1.2, the admin interface no longer 
seems to work due to some problems with our widgets. This is the error that 
I get:

[image: image.png]

And here is the full call stack:

Environment:


Request Method: GET
Request URL: http://localhost:8000/admin/website/person/2/change/

Django Version: 2.1.2
Python Version: 3.6.3
Installed Applications:
['website.apps.WebsiteConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_extensions',
 'image_cropping',
 'easy_thumbnails',
 'sortedm2m',
 'sortedm2m_filter_horizontal_widget',
 'rest_framework']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']


Template error:
In template 
/usr/local/lib/python3.6/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html,
 error at line 19
   render() got an unexpected keyword argument 'renderer'
   9 : {% for field in line %}
   10 : 
   11 : {% if not line.fields|length_is:'1' and not 
field.is_readonly %}{{ field.errors }}{% endif %}
   12 : {% if field.is_checkbox %}
   13 : {{ field.field }}{{ field.label_tag }}
   14 : {% else %}
   15 : {{ field.label_tag }}
   16 : {% if field.is_readonly %}
   17 : {{ field.contents 
}}
   18 : {% else %}
   19 :  {{ field.field }} 
   20 : {% endif %}
   21 : {% endif %}
   22 : {% if field.field.help_text %}
   23 : {{ field.field.help_text|safe 
}}
   24 : {% endif %}
   25 : 
   26 : {% endfor %}
   27 : 
   28 : {% endfor %}
   29 : 


Traceback:

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" 
in inner
  34. response = get_response(request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in 
_get_response
  156. response = self.process_exception_by_middleware(e, 
request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in 
_get_response
  154. response = response.render()

File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in 
render
  106. self.content = self.rendered_content

File "/usr/local/lib/python3.6/site-packages/django/template/response.py" in 
rendered_content
  83. content = template.render(context, self._request)

File 
"/usr/local/lib/python3.6/site-packages/django/template/backends/django.py" in 
render
  61. return self.template.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render
  171. return self._render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in _render
  163. return self.nodelist.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render
  937. bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
render_annotated
  904. return self.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" in 
render
  150. return compiled_parent._render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in _render
  163. return self.nodelist.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render
  937. bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
render_annotated
  904. return self.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" in 
render
  150. return compiled_parent._render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in _render
  163. return self.nodelist.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in render
  937. bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/site-packages/django/template/base.py" in 
render_annotated
  904. return self.render(context)

File "/usr/local/lib/python3.6/site-packages/django/template/loader_tags.py" in 

Re: Broken?

2018-05-01 Thread Kevin O'Gorman
It is indeed a string.  The string happens to represent an integer, a key 
of an item in another table.  It is not an external reference because there 
are dated versions of the table and the referent may or may not exist in 
any one of them.  It existed in the table in use at the time the record was 
created and needs to be preserved.

On Sunday, April 29, 2018 at 9:03:07 PM UTC-7, George Lubaretsi wrote:
>
>  File "/raid3/build/comprosloco/oil/models.py", line 172, in __str__
> self.accepted
>
> What is inside this __str__ method? `self.accepted` field name sounds like 
> it could be a date. Return type of __str__ must be a string.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/52b2bdea-b4ef-4434-9325-b98e58ae675e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Broken?

2018-04-29 Thread George Lubaretsi
  File "/raid3/build/comprosloco/oil/models.py", line 172, in __str__
self.accepted

What is inside this __str__ method? `self.accepted` field name sounds like it 
could be a date. Return type of __str__ must be a string.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5f5b7d98-a20b-4483-8977-de30c434ce30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Broken?

2018-04-28 Thread Kevin O'Gorman
So I modified the command so that it brought out all the fields, adding 
them one by one in a .values() call added to the QuerySet.  They all came 
out just fine, every single one, including the timestamp.

As a result, I'm thinking this may be a bug in Django when it is just being 
called on to produce QuerySet[0] and it contains a timestamp.  Or maybe the 
bug depends on some other trigger.  I'm at a crucial point in the use of 
this code, have a workaround, so I won't do anything more with it until 
after our end date this coming Tuesday.  After that I'll decompress for a 
day or so.  Maybe then I'll produce example code complete with test data.  
But I'd have to say the command is about as simple as it's gonna get.

On Saturday, April 28, 2018 at 11:43:48 AM UTC-7, Kevin O'Gorman wrote:
>
> Maybe, but while the log file has undergone some migrations in the past, 
> it has not been much, not recently, and everything is up-to-date now.  
> 'manage makemigrations' detects nothing.
>
> So the question is how I can explore this.
>
> ++ kevin
>
> On Saturday, April 28, 2018 at 7:17:24 AM UTC-7, Jason wrote:
>>
>> Basically, its saying that something is expecting a string, but is 
>> instead getting a datetime object.  Sounds like something changed in your 
>> `oils/models.py` file
>>
>> On Saturday, April 28, 2018 at 7:54:24 AM UTC-4, Kevin O'Gorman wrote:
>>>
>>> I've got a working site, but I made a copy of the database in order to 
>>> do some development work.
>>> I've hit a snag that looks like a problem in the data.
>>>
>>> The odd part is that this database is in production, and my backups have 
>>> the same problem.  So I'm presuming my new code is broken in some way I 
>>> don't understand.
>>> For instance, Ive written a management command to show the problem:
>>>
>>> from django.core.management.base import BaseCommand, CommandError
>>>
>>> from oil.models import Packet, Signature, Log, Voter
>>>
>>> class Command(BaseCommand):
>>> help = 'Quick test'
>>> BaseCommand.requires_migrations_checks = True
>>>
>>>
>>> def handle(self, *args, **options):
>>> voters = Log.objects.all()
>>> self.stdout.write(repr(voters[0]))
>>>
>>> I'm suspecting a problem has crept into my Log table, because it works 
>>> fine if I change Log on the
>>> second line of handle() to any of the other tables.  If it runs as shown 
>>> here however, I get
>>>
>>> kevin@camelot-x:/build/comprosloco$ manage oiltest
>>> Traceback (most recent call last):
>>>   File "./manage", line 22, in 
>>> execute_from_command_line(sys.argv)
>>>   File "/build/django/django/core/management/__init__.py", line 364, in 
>>> execute_from_command_line
>>> utility.execute()
>>>   File "/build/django/django/core/management/__init__.py", line 356, in 
>>> execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File "/build/django/django/core/management/base.py", line 283, in 
>>> run_from_argv
>>> self.execute(*args, **cmd_options)
>>>   File "/build/django/django/core/management/base.py", line 330, in 
>>> execute
>>> output = self.handle(*args, **options)
>>>   File "/raid3/build/comprosloco/oil/management/commands/oiltest.py", 
>>> line 15, in handle
>>> self.stdout.write(repr(voters[0]))
>>>   File "/build/django/django/db/models/base.py", line 590, in __repr__
>>> u = six.text_type(self)
>>>   File "/raid3/build/comprosloco/oil/models.py", line 172, in __str__
>>> self.accepted
>>> TypeError: sequence item 0: expected str instance, datetime.datetime 
>>> found
>>> kevin@camelot-x:/build/comprosloco$
>>>
>>> And I have no idea how to debug it further.  The schema of Log is
>>> sqlite> .schema oil_log
>>> CREATE TABLE "oil_log" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, 
>>> "packet" integer NOT NULL, "signature" integer NOT NULL, "action" 
>>> varchar(20) NOT NULL, "criteria" varchar(150) NOT NULL, "candidates" 
>>> varchar(100) NOT NULL, "accepted" varchar(10) NOT NULL, "user_id" integer 
>>> NOT NULL REFERENCES "auth_user" ("id"), "timestamp" datetime NOT NULL);
>>> CREATE INDEX "oil_log_packet_ecd59bc4" ON "oil_log" ("packet");
>>> CREATE INDEX "oil_log_user_id_7f26e501" ON "oil_log" ("user_id");
>>> sqlite>
>>>
>>>
>>> Help???
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1c5ffcb5-7212-4ee7-94c0-17f699ced3f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Broken?

2018-04-28 Thread Kevin O'Gorman
Maybe, but while the log file has undergone some migrations in the past, it 
has not been much, not recently, and everything is up-to-date now.  'manage 
makemigrations' detects nothing.

So the question is how I can explore this.

++ kevin

On Saturday, April 28, 2018 at 7:17:24 AM UTC-7, Jason wrote:
>
> Basically, its saying that something is expecting a string, but is instead 
> getting a datetime object.  Sounds like something changed in your 
> `oils/models.py` file
>
> On Saturday, April 28, 2018 at 7:54:24 AM UTC-4, Kevin O'Gorman wrote:
>>
>> I've got a working site, but I made a copy of the database in order to do 
>> some development work.
>> I've hit a snag that looks like a problem in the data.
>>
>> The odd part is that this database is in production, and my backups have 
>> the same problem.  So I'm presuming my new code is broken in some way I 
>> don't understand.
>> For instance, Ive written a management command to show the problem:
>>
>> from django.core.management.base import BaseCommand, CommandError
>>
>> from oil.models import Packet, Signature, Log, Voter
>>
>> class Command(BaseCommand):
>> help = 'Quick test'
>> BaseCommand.requires_migrations_checks = True
>>
>>
>> def handle(self, *args, **options):
>> voters = Log.objects.all()
>> self.stdout.write(repr(voters[0]))
>>
>> I'm suspecting a problem has crept into my Log table, because it works 
>> fine if I change Log on the
>> second line of handle() to any of the other tables.  If it runs as shown 
>> here however, I get
>>
>> kevin@camelot-x:/build/comprosloco$ manage oiltest
>> Traceback (most recent call last):
>>   File "./manage", line 22, in 
>> execute_from_command_line(sys.argv)
>>   File "/build/django/django/core/management/__init__.py", line 364, in 
>> execute_from_command_line
>> utility.execute()
>>   File "/build/django/django/core/management/__init__.py", line 356, in 
>> execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File "/build/django/django/core/management/base.py", line 283, in 
>> run_from_argv
>> self.execute(*args, **cmd_options)
>>   File "/build/django/django/core/management/base.py", line 330, in 
>> execute
>> output = self.handle(*args, **options)
>>   File "/raid3/build/comprosloco/oil/management/commands/oiltest.py", 
>> line 15, in handle
>> self.stdout.write(repr(voters[0]))
>>   File "/build/django/django/db/models/base.py", line 590, in __repr__
>> u = six.text_type(self)
>>   File "/raid3/build/comprosloco/oil/models.py", line 172, in __str__
>> self.accepted
>> TypeError: sequence item 0: expected str instance, datetime.datetime found
>> kevin@camelot-x:/build/comprosloco$
>>
>> And I have no idea how to debug it further.  The schema of Log is
>> sqlite> .schema oil_log
>> CREATE TABLE "oil_log" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, 
>> "packet" integer NOT NULL, "signature" integer NOT NULL, "action" 
>> varchar(20) NOT NULL, "criteria" varchar(150) NOT NULL, "candidates" 
>> varchar(100) NOT NULL, "accepted" varchar(10) NOT NULL, "user_id" integer 
>> NOT NULL REFERENCES "auth_user" ("id"), "timestamp" datetime NOT NULL);
>> CREATE INDEX "oil_log_packet_ecd59bc4" ON "oil_log" ("packet");
>> CREATE INDEX "oil_log_user_id_7f26e501" ON "oil_log" ("user_id");
>> sqlite>
>>
>>
>> Help???
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/92b25a7f-81ab-46c2-8729-0bdb996b9f75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Broken?

2018-04-28 Thread Jason
Basically, its saying that something is expecting a string, but is instead 
getting a datetime object.  Sounds like something changed in your 
`oils/models.py` file

On Saturday, April 28, 2018 at 7:54:24 AM UTC-4, Kevin O'Gorman wrote:
>
> I've got a working site, but I made a copy of the database in order to do 
> some development work.
> I've hit a snag that looks like a problem in the data.
>
> The odd part is that this database is in production, and my backups have 
> the same problem.  So I'm presuming my new code is broken in some way I 
> don't understand.
> For instance, Ive written a management command to show the problem:
>
> from django.core.management.base import BaseCommand, CommandError
>
> from oil.models import Packet, Signature, Log, Voter
>
> class Command(BaseCommand):
> help = 'Quick test'
> BaseCommand.requires_migrations_checks = True
>
>
> def handle(self, *args, **options):
> voters = Log.objects.all()
> self.stdout.write(repr(voters[0]))
>
> I'm suspecting a problem has crept into my Log table, because it works 
> fine if I change Log on the
> second line of handle() to any of the other tables.  If it runs as shown 
> here however, I get
>
> kevin@camelot-x:/build/comprosloco$ manage oiltest
> Traceback (most recent call last):
>   File "./manage", line 22, in 
> execute_from_command_line(sys.argv)
>   File "/build/django/django/core/management/__init__.py", line 364, in 
> execute_from_command_line
> utility.execute()
>   File "/build/django/django/core/management/__init__.py", line 356, in 
> execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/build/django/django/core/management/base.py", line 283, in 
> run_from_argv
> self.execute(*args, **cmd_options)
>   File "/build/django/django/core/management/base.py", line 330, in execute
> output = self.handle(*args, **options)
>   File "/raid3/build/comprosloco/oil/management/commands/oiltest.py", line 
> 15, in handle
> self.stdout.write(repr(voters[0]))
>   File "/build/django/django/db/models/base.py", line 590, in __repr__
> u = six.text_type(self)
>   File "/raid3/build/comprosloco/oil/models.py", line 172, in __str__
> self.accepted
> TypeError: sequence item 0: expected str instance, datetime.datetime found
> kevin@camelot-x:/build/comprosloco$
>
> And I have no idea how to debug it further.  The schema of Log is
> sqlite> .schema oil_log
> CREATE TABLE "oil_log" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, 
> "packet" integer NOT NULL, "signature" integer NOT NULL, "action" 
> varchar(20) NOT NULL, "criteria" varchar(150) NOT NULL, "candidates" 
> varchar(100) NOT NULL, "accepted" varchar(10) NOT NULL, "user_id" integer 
> NOT NULL REFERENCES "auth_user" ("id"), "timestamp" datetime NOT NULL);
> CREATE INDEX "oil_log_packet_ecd59bc4" ON "oil_log" ("packet");
> CREATE INDEX "oil_log_user_id_7f26e501" ON "oil_log" ("user_id");
> sqlite>
>
>
> Help???
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/beda3306-da98-4abc-9f07-3e1b808ccf19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Broken?

2018-04-28 Thread Kevin O'Gorman
I've got a working site, but I made a copy of the database in order to do 
some development work.
I've hit a snag that looks like a problem in the data.

The odd part is that this database is in production, and my backups have 
the same problem.  So I'm presuming my new code is broken in some way I 
don't understand.
For instance, Ive written a management command to show the problem:

from django.core.management.base import BaseCommand, CommandError

from oil.models import Packet, Signature, Log, Voter

class Command(BaseCommand):
help = 'Quick test'
BaseCommand.requires_migrations_checks = True


def handle(self, *args, **options):
voters = Log.objects.all()
self.stdout.write(repr(voters[0]))

I'm suspecting a problem has crept into my Log table, because it works fine 
if I change Log on the
second line of handle() to any of the other tables.  If it runs as shown 
here however, I get

kevin@camelot-x:/build/comprosloco$ manage oiltest
Traceback (most recent call last):
  File "./manage", line 22, in 
execute_from_command_line(sys.argv)
  File "/build/django/django/core/management/__init__.py", line 364, in 
execute_from_command_line
utility.execute()
  File "/build/django/django/core/management/__init__.py", line 356, in 
execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/build/django/django/core/management/base.py", line 283, in 
run_from_argv
self.execute(*args, **cmd_options)
  File "/build/django/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
  File "/raid3/build/comprosloco/oil/management/commands/oiltest.py", line 
15, in handle
self.stdout.write(repr(voters[0]))
  File "/build/django/django/db/models/base.py", line 590, in __repr__
u = six.text_type(self)
  File "/raid3/build/comprosloco/oil/models.py", line 172, in __str__
self.accepted
TypeError: sequence item 0: expected str instance, datetime.datetime found
kevin@camelot-x:/build/comprosloco$

And I have no idea how to debug it further.  The schema of Log is
sqlite> .schema oil_log
CREATE TABLE "oil_log" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, 
"packet" integer NOT NULL, "signature" integer NOT NULL, "action" 
varchar(20) NOT NULL, "criteria" varchar(150) NOT NULL, "candidates" 
varchar(100) NOT NULL, "accepted" varchar(10) NOT NULL, "user_id" integer 
NOT NULL REFERENCES "auth_user" ("id"), "timestamp" datetime NOT NULL);
CREATE INDEX "oil_log_packet_ecd59bc4" ON "oil_log" ("packet");
CREATE INDEX "oil_log_user_id_7f26e501" ON "oil_log" ("user_id");
sqlite>


Help???

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/419b7f17-c7c4-4650-ae4f-5305bc556e98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tests broken when I have two database in settings

2017-09-04 Thread Melvyn Sopacua
Did you read the documentation on this?

https://docs.djangoproject.com/en/1.11/topics/testing/advanced/#tests-and-multiple-databases

On Mon, Sep 4, 2017 at 3:16 PM, Rodrigo Braga <rbr...@gmail.com> wrote:
> Hello,
>
> I have troubles when I try running tests with two databases configured.
>
> I have migrations with RunPython (where the problem occurs).
>
> I opened a thread on Stackoverflow [1] but without answers yet.
>
> * sorry my English
>
> [1]
> https://stackoverflow.com/questions/45962149/django-tests-broken-when-i-have-two-database-in-settings
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d279447c-021b-4af4-b8e6-f7f4bac7f92d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2Bgw1GWyy3yMRvsS2TjS6jRQMDFXYDsBXVS7YeUFuN%2BKMKX%2BCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Tests broken when I have two database in settings

2017-09-04 Thread Rodrigo Braga
Hello,

I have troubles when I try running tests with two databases configured.

I have migrations with RunPython (where the problem occurs).

I opened a thread on Stackoverflow [1] but without answers yet.

* sorry my English

[1] 
https://stackoverflow.com/questions/45962149/django-tests-broken-when-i-have-two-database-in-settings

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d279447c-021b-4af4-b8e6-f7f4bac7f92d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I solve the broken home page in the root folder?

2017-02-03 Thread Melvyn Sopacua
On Tuesday 31 January 2017 06:51:35 Thames Khi wrote:

> I added the following to main site urls.py:

and I assume this also contains:
from data import views

> url(r'^$', views.home, name='home'),
> 
> and added the following to the /data/views.py file.
> 
> def home(request):
> return HttpResponse("Main Page")
> 
> This somewhat makes sense, just wondering why the main site does not
> require a views.py file

It does in the real world, but you deligated the response to the 'data' app. 
The main 
project is just an app like any other. It is only special because it is the 
entry point of 
the project, but nothing prevents you from adding models and views there as 
well.

When homepages become complicated this is exactly what people do. Either that, 
or they create a "homepage" app.
-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/10012750.xPQq35GGJ7%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: How can I solve the broken home page in the root folder?

2017-01-31 Thread Thames Khi
Thank you very much.

I added the following to main site urls.py:

url(r'^$', views.home, name='home'),

and added the following to the /data/views.py file.

def home(request):
return HttpResponse("Main Page")

This somewhat makes sense, just wondering why the main site does not 
require a views.py file


On Tuesday, January 31, 2017 at 1:57:53 PM UTC, ludovic coues wrote:
>
> Try "url(r'^/', include('data.urls'))," in url_patterns. This should do 
> what you want.
>
> Alternatively, you can set a simple view on r'^$' that will redirect to 
> your main app.
>
>
> On 31 Jan 2017 1:09 p.m., "Thames Khi"  
> wrote:
>
> I followed a simple tutorial to create a sample application in DJango. 
> Here is my code for urls.py in the root folder:
>
> from django.conf.urls import url, include
> from django.contrib import admin
> #from data import views
>
> urlpatterns = [
> 
> url(r'^data/', include('data.urls')),
> url(r'^admin/', admin.site.urls),
>
>
> I get this error:
>
> Page not found (404)
> Request Method: GET
> Request URL: http:///
>
> Using the URLconf defined in stockprices.urls, Django tried these URL 
> patterns, in this order:
>
>1. ^data/
>2. ^admin/
>
> The current URL, , didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django 
> settings file. Change that to False, and Django will display a standard 
> 404 page. 
>
>
>
> The app http:///data/ works fine.
>
>
> If I remove the line: url(r'^data/', include('data.urls')),
>
>
> then the root app works a treat:
>
>
> It worked!Congratulations on your first Django-powered page.
>
> Is there a way to solve this or is there a way to redirect the page to 
> another app? I really do not want to give out a website address with  url>/data
>
> Thank you very much.
>
> Khi
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/05cf9421-5481-4e6a-b1a9-0ae874dbe860%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e37f2c55-1b97-4d70-8a9a-5e9d32c9b54b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I solve the broken home page in the root folder?

2017-01-31 Thread ludovic coues
Try "url(r'^/', include('data.urls'))," in url_patterns. This should do
what you want.

Alternatively, you can set a simple view on r'^$' that will redirect to
your main app.


On 31 Jan 2017 1:09 p.m., "Thames Khi"  wrote:

I followed a simple tutorial to create a sample application in DJango. Here
is my code for urls.py in the root folder:

from django.conf.urls import url, include
from django.contrib import admin
#from data import views

urlpatterns = [

url(r'^data/', include('data.urls')),
url(r'^admin/', admin.site.urls),


I get this error:

Page not found (404)
Request Method: GET
Request URL: http:///

Using the URLconf defined in stockprices.urls, Django tried these URL
patterns, in this order:

   1. ^data/
   2. ^admin/

The current URL, , didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a standard 404
page.



The app http:///data/ works fine.


If I remove the line: url(r'^data/', include('data.urls')),


then the root app works a treat:


It worked!Congratulations on your first Django-powered page.

Is there a way to solve this or is there a way to redirect the page to
another app? I really do not want to give out a website address with /data

Thank you very much.

Khi


-- 
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/05cf9421-5481-4e6a-b1a9-0ae874dbe860%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTYiuTtONQc%3DuH5tXEmN6cFg9xzw_t5umuhx5HeCBX70Fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How can I solve the broken home page in the root folder?

2017-01-31 Thread Thames Khi
I followed a simple tutorial to create a sample application in DJango. Here 
is my code for urls.py in the root folder:

from django.conf.urls import url, include
from django.contrib import admin
#from data import views

urlpatterns = [

url(r'^data/', include('data.urls')),
url(r'^admin/', admin.site.urls),


I get this error:

Page not found (404)
Request Method: GET
Request URL: http:///

Using the URLconf defined in stockprices.urls, Django tried these URL 
patterns, in this order:

   1. ^data/
   2. ^admin/

The current URL, , didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django 
settings file. Change that to False, and Django will display a standard 404 
page. 



The app http:///data/ works fine.


If I remove the line: url(r'^data/', include('data.urls')),


then the root app works a treat:


It worked!Congratulations on your first Django-powered page.

Is there a way to solve this or is there a way to redirect the page to 
another app? I really do not want to give out a website address with /data

Thank you very much.

Khi


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/05cf9421-5481-4e6a-b1a9-0ae874dbe860%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django-extensions: dumpscript/runscript manytomany with through= broken?

2016-04-02 Thread Daniel Wilcox
Hello, I was wondering if anyone knows a good way to handle restoring a
backup taken with a m2m intermediary model.

I'm trying to upgrade from my sqlite database to a real database and would
like to keep the data that was created thus far.

Basically the models look like this:

class Message(models.Model):
subject = models.CharField(max_length=64)
...
recipients = models.ManyToManyField(User, through='SentRecord',
blank=True)

class SentRecord(models.Model):
message = models.ForeignKey(Message)
recipient = models.ForeignKey(User)
sent_at = models.DateTimeField(auto_now=True)

So I've tried both dumpdata/loaddata and dumpscript/runscript.  The former
basically quietly ignores the records but everything else is OK -- but no
Messages or SentRecords.

So I've tried two approaches -- first problem was regarding the fact that
SentRecord and Message refer to one another and so one has to be created
first. dumpscript picked SentRecord to do first -- totally sensible.  But
It can't comply with the above model because the .message foreign key will
create a column that enforces NOT NULL.

OK fine, I changed the above model to allow null on message, since it
basically does this sequence:

1. create sent messages, with no message pk
2. create messages
3. then it *should* fill in the sent messages .message pk... but instead it
blows up because because it generates stuff like this:

app_message_1.recipient.add( importer.locate_object(User, 'id', 1, ...

Which is a big no no because of the through record it's using wrong
manager.  It should be getting the sent records already created and setting
the .message pk on those instead of trying to add Users directly to the
message, as though it were a regular m2m.


I'm just wondering if anyone knows if this is a fixed issue and I'm just
'holding it wrong'... otherwise I'll be faced with some stark choices, fix
django-extensions to get my way... or do some ugly sed/awk to patch it up.

Thank you!

=D

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGq7KhoAkw57YzmEZReouD7Fr9f0fX7mG-bhdGgSRu3Oc07xiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


- Broken pipe from ('127.0.0.1', 50977) When doing POST calls from the Ajax code residing the same server for Django application

2016-02-17 Thread sairam . bandaru09
Hi,

I am getting this error

[15/Feb/2016 01:38:58] "POST /api/survey/updateSurveyTitle/ HTTP/1.1" 200 44
- Broken pipe from ('127.0.0.1', 50977)

Please help out


Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3a289810-143c-4403-9bb1-3a257725de1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bi-directional ManyToMany with through gets broken when creating test database

2015-12-04 Thread filias
Hi Simon,

thanks for your reply, I suspected exactly what you said.
I am not sure, this is not my code so I am not aware of the reason for this 
but I will try to refactor it the way you suggest.

Cheers,
filipa

On Friday, December 4, 2015 at 4:38:41 PM UTC+1, Simon Charette wrote:
>
> Hi filias,
>
> I personally didn't know one could define a reverse foreign key this way 
> and
> I doubt this use case is covered by the test suite. I'm afraid it worked 
> for
> Django < 1.8 by chance since it's not documented you can re-use the
> implicitly created intermediary model as a `through` argument. I suspect 
> this
> might be due to the `_meta`[1] refactoring that happened in 1.8.
>
> May I ask you why you don't simply define a `related_name`[2] if you simply
> want to have a different reverse relationship name?
>
> class Pizza(models.Model):
> pass
>
> class Topping(models.Model):
> all_pizzas = models.ManyToManyField(
> Pizza, related_name='available_toppings',
> verbose_name='available pizzas'
> )
>
> Cheers,
> Simon
>
> [1] https://docs.djangoproject.com/en/1.8/releases/1.8/#model-meta-api
> [2] 
> https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.ManyToManyField.related_name
>
> Le vendredi 4 décembre 2015 07:08:51 UTC-5, filias a écrit :
>>
>> Indeed something in the project's code must be wrong but it is not the 
>> bi-directional ManyToMany as this has been working in django 1.4, 1.5, 1.6 
>> and 1.7. One might want to had the ManyToMany in both models so to be able 
>> to add more information, as it is stated in the django docs 
>> https://docs.djangoproject.com/en/1.9/topics/db/models/#extra-fields-on-many-to-many-relationships
>>  
>> in my case I just want the field to have a different name. I am thinking of 
>> using a property but I got into some troubles with my code when I did that, 
>> specifically the migration to remove the all_pizzas field crashes.
>>
>> I have created a new project with only those 2 models and it seems to 
>> work correctly, so the problem is somehow related to our test runner 
>> (py.test) and something else which I still don't know.
>>
>> My models.py file looks like this:
>> from django.db import models
>>
>>
>> class Pizza(models.Model):
>> available_toppings = models.ManyToManyField('Topping')
>>
>>
>> class Topping(models.Model):
>>all_pizzas = models.ManyToManyField(Pizza, 
>> through=Pizza.available_toppings.through, verbose_name='available pizzas')
>>
>> I will continue investigating.
>>
>> On Friday, December 4, 2015 at 11:31:19 AM UTC+1, Remco Gerlich wrote:
>>>
>>> One, from that error message alone I can't figure out what is happening 
>>> and why when you run tests, so I can't help there.
>>>
>>> But two: you don't have a ManyToManyField, you have TWO 
>>> ManyToManyFields. If you define a many to many field on one model, than 
>>> it's automatically also defined on the other (if you only have the one on 
>>> Pizza, then you can do topping.pizza_set.all() from the other side.
>>>
>>> So your current code is almost certainly wrong, but if these are your 
>>> exact models than I don't think they are related to your error.
>>>
>>> Remco
>>>
>>> On Fri, Dec 4, 2015 at 9:54 AM, filias  wrote:
>>>
 Hi,

 I have recently upgraded to sjango 1.8 and I have 2 models with a 
 bi-directional ManyToMany field. It looks like this

 class Pizza(Model):
 available_toppings = ManyToManyField('Topping')

 class Topping(Model):
all_pizzas = ManyToManyField(Pizza, 
 through=Pizza.available_stoppings.through, verbose_name='available pizzas')

 Everything was fine in django 1.7 but right now when running tests, 
 specifically when creating the test database, I get this exception:

 self = >>> 0x7fd24fca4b00>

 def execute(self, query, params=None):
 if params is None:

 >   return Database.Cursor.execute(self, query)
 E   OperationalError: table "products_pizza_available_toppings" 
 already exists

 So it looks like the creation of the test database is trying to 
 re-create the intermediate table for the ManyToMany.

 I do not get any exception when running my site.

 Does anyone know how can I fix this?

 Thank you in advance

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To post to this group, send email to django...@googlegroups.com.
 Visit this group at http://groups.google.com/group/django-users.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/4b8bb3c4-c0bd-4315-9cb6-004db2fa2355%40googlegroups.com
  
 

Re: Bi-directional ManyToMany with through gets broken when creating test database

2015-12-04 Thread Simon Charette
Hi filias,

I personally didn't know one could define a reverse foreign key this way and
I doubt this use case is covered by the test suite. I'm afraid it worked for
Django < 1.8 by chance since it's not documented you can re-use the
implicitly created intermediary model as a `through` argument. I suspect 
this
might be due to the `_meta`[1] refactoring that happened in 1.8.

May I ask you why you don't simply define a `related_name`[2] if you simply
want to have a different reverse relationship name?

class Pizza(models.Model):
pass

class Topping(models.Model):
all_pizzas = models.ManyToManyField(
Pizza, related_name='available_toppings',
verbose_name='available pizzas'
)

Cheers,
Simon

[1] https://docs.djangoproject.com/en/1.8/releases/1.8/#model-meta-api
[2] 
https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.ManyToManyField.related_name

Le vendredi 4 décembre 2015 07:08:51 UTC-5, filias a écrit :
>
> Indeed something in the project's code must be wrong but it is not the 
> bi-directional ManyToMany as this has been working in django 1.4, 1.5, 1.6 
> and 1.7. One might want to had the ManyToMany in both models so to be able 
> to add more information, as it is stated in the django docs 
> https://docs.djangoproject.com/en/1.9/topics/db/models/#extra-fields-on-many-to-many-relationships
>  
> in my case I just want the field to have a different name. I am thinking of 
> using a property but I got into some troubles with my code when I did that, 
> specifically the migration to remove the all_pizzas field crashes.
>
> I have created a new project with only those 2 models and it seems to work 
> correctly, so the problem is somehow related to our test runner (py.test) 
> and something else which I still don't know.
>
> My models.py file looks like this:
> from django.db import models
>
>
> class Pizza(models.Model):
> available_toppings = models.ManyToManyField('Topping')
>
>
> class Topping(models.Model):
>all_pizzas = models.ManyToManyField(Pizza, 
> through=Pizza.available_toppings.through, verbose_name='available pizzas')
>
> I will continue investigating.
>
> On Friday, December 4, 2015 at 11:31:19 AM UTC+1, Remco Gerlich wrote:
>>
>> One, from that error message alone I can't figure out what is happening 
>> and why when you run tests, so I can't help there.
>>
>> But two: you don't have a ManyToManyField, you have TWO ManyToManyFields. 
>> If you define a many to many field on one model, than it's automatically 
>> also defined on the other (if you only have the one on Pizza, then you can 
>> do topping.pizza_set.all() from the other side.
>>
>> So your current code is almost certainly wrong, but if these are your 
>> exact models than I don't think they are related to your error.
>>
>> Remco
>>
>> On Fri, Dec 4, 2015 at 9:54 AM, filias  wrote:
>>
>>> Hi,
>>>
>>> I have recently upgraded to sjango 1.8 and I have 2 models with a 
>>> bi-directional ManyToMany field. It looks like this
>>>
>>> class Pizza(Model):
>>> available_toppings = ManyToManyField('Topping')
>>>
>>> class Topping(Model):
>>>all_pizzas = ManyToManyField(Pizza, 
>>> through=Pizza.available_stoppings.through, verbose_name='available pizzas')
>>>
>>> Everything was fine in django 1.7 but right now when running tests, 
>>> specifically when creating the test database, I get this exception:
>>>
>>> self = >> 0x7fd24fca4b00>
>>>
>>> def execute(self, query, params=None):
>>> if params is None:
>>>
>>> >   return Database.Cursor.execute(self, query)
>>> E   OperationalError: table "products_pizza_available_toppings" 
>>> already exists
>>>
>>> So it looks like the creation of the test database is trying to 
>>> re-create the intermediate table for the ManyToMany.
>>>
>>> I do not get any exception when running my site.
>>>
>>> Does anyone know how can I fix this?
>>>
>>> Thank you in advance
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/4b8bb3c4-c0bd-4315-9cb6-004db2fa2355%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to 

Re: Bi-directional ManyToMany with through gets broken when creating test database

2015-12-04 Thread filias
Indeed something in the project's code must be wrong but it is not the 
bi-directional ManyToMany as this has been working in django 1.4, 1.5, 1.6 
and 1.7. One might want to had the ManyToMany in both models so to be able 
to add more information, as it is stated in the django 
docs 
https://docs.djangoproject.com/en/1.9/topics/db/models/#extra-fields-on-many-to-many-relationships
 
in my case I just want the field to have a different name. I am thinking of 
using a property but I got into some troubles with my code when I did that, 
specifically the migration to remove the all_pizzas field crashes.

I have created a new project with only those 2 models and it seems to work 
correctly, so the problem is somehow related to our test runner (py.test) 
and something else which I still don't know.

My models.py file looks like this:
from django.db import models


class Pizza(models.Model):
available_toppings = models.ManyToManyField('Topping')


class Topping(models.Model):
   all_pizzas = models.ManyToManyField(Pizza, 
through=Pizza.available_toppings.through, verbose_name='available pizzas')

I will continue investigating.

On Friday, December 4, 2015 at 11:31:19 AM UTC+1, Remco Gerlich wrote:
>
> One, from that error message alone I can't figure out what is happening 
> and why when you run tests, so I can't help there.
>
> But two: you don't have a ManyToManyField, you have TWO ManyToManyFields. 
> If you define a many to many field on one model, than it's automatically 
> also defined on the other (if you only have the one on Pizza, then you can 
> do topping.pizza_set.all() from the other side.
>
> So your current code is almost certainly wrong, but if these are your 
> exact models than I don't think they are related to your error.
>
> Remco
>
> On Fri, Dec 4, 2015 at 9:54 AM, filias  > wrote:
>
>> Hi,
>>
>> I have recently upgraded to sjango 1.8 and I have 2 models with a 
>> bi-directional ManyToMany field. It looks like this
>>
>> class Pizza(Model):
>> available_toppings = ManyToManyField('Topping')
>>
>> class Topping(Model):
>>all_pizzas = ManyToManyField(Pizza, 
>> through=Pizza.available_stoppings.through, verbose_name='available pizzas')
>>
>> Everything was fine in django 1.7 but right now when running tests, 
>> specifically when creating the test database, I get this exception:
>>
>> self = > 0x7fd24fca4b00>
>>
>> def execute(self, query, params=None):
>> if params is None:
>>
>> >   return Database.Cursor.execute(self, query)
>> E   OperationalError: table "products_pizza_available_toppings" 
>> already exists
>>
>> So it looks like the creation of the test database is trying to re-create 
>> the intermediate table for the ManyToMany.
>>
>> I do not get any exception when running my site.
>>
>> Does anyone know how can I fix this?
>>
>> Thank you in advance
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/4b8bb3c4-c0bd-4315-9cb6-004db2fa2355%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0d982fc9-aebb-4430-aa56-28babd1fcee8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bi-directional ManyToMany with through gets broken when creating test database

2015-12-04 Thread Remco Gerlich
One, from that error message alone I can't figure out what is happening and
why when you run tests, so I can't help there.

But two: you don't have a ManyToManyField, you have TWO ManyToManyFields.
If you define a many to many field on one model, than it's automatically
also defined on the other (if you only have the one on Pizza, then you can
do topping.pizza_set.all() from the other side.

So your current code is almost certainly wrong, but if these are your exact
models than I don't think they are related to your error.

Remco

On Fri, Dec 4, 2015 at 9:54 AM, filias  wrote:

> Hi,
>
> I have recently upgraded to sjango 1.8 and I have 2 models with a
> bi-directional ManyToMany field. It looks like this
>
> class Pizza(Model):
> available_toppings = ManyToManyField('Topping')
>
> class Topping(Model):
>all_pizzas = ManyToManyField(Pizza,
> through=Pizza.available_stoppings.through, verbose_name='available pizzas')
>
> Everything was fine in django 1.7 but right now when running tests,
> specifically when creating the test database, I get this exception:
>
> self =  0x7fd24fca4b00>
>
> def execute(self, query, params=None):
> if params is None:
>
> >   return Database.Cursor.execute(self, query)
> E   OperationalError: table "products_pizza_available_toppings"
> already exists
>
> So it looks like the creation of the test database is trying to re-create
> the intermediate table for the ManyToMany.
>
> I do not get any exception when running my site.
>
> Does anyone know how can I fix this?
>
> Thank you in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4b8bb3c4-c0bd-4315-9cb6-004db2fa2355%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFAGLK2HoLREAMCL8cFP%3D1raEotF_rD%2Bym-bBVuCDaQd6PKGtg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Bi-directional ManyToMany with through gets broken when creating test database

2015-12-04 Thread filias
Hi,

I have recently upgraded to sjango 1.8 and I have 2 models with a 
bi-directional ManyToMany field. It looks like this

class Pizza(Model):
available_toppings = ManyToManyField('Topping')

class Topping(Model):
   all_pizzas = ManyToManyField(Pizza, 
through=Pizza.available_stoppings.through, verbose_name='available pizzas')

Everything was fine in django 1.7 but right now when running tests, 
specifically when creating the test database, I get this exception:

self = 

def execute(self, query, params=None):
if params is None:

>   return Database.Cursor.execute(self, query)
E   OperationalError: table "products_pizza_available_toppings" 
already exists

So it looks like the creation of the test database is trying to re-create 
the intermediate table for the ManyToMany.

I do not get any exception when running my site.

Does anyone know how can I fix this?

Thank you in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4b8bb3c4-c0bd-4315-9cb6-004db2fa2355%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: broken image on my django production site. Why is it?

2014-11-02 Thread Collin Anderson
Hello,

You may need to install something like dj-static to serve your files.

Collin

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16d1430f-b32f-4f3d-b12c-18e9920b4e69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: broken image on my django production site. Why is it?

2014-11-02 Thread Kakar Nyori
I think, you should add "static"/ in your html:



Or else change your directory settings.


On Sat, Nov 1, 2014 at 8:21 PM, rdyact <uunb2...@gmail.com> wrote:

>
> <https://lh5.googleusercontent.com/-FFtVl5q2M_s/VFTzY-YR7iI/Gyw/5ITM6qKL25Y/s1600/medialinkerror.png>
> I just product my site using Heroku and I got a odd problem with my media
> images broken. Here is my site structure on Heroku.
>
>  -- app
> -- manage.py
> -- mysite
>-- settings
>  -- __init__.py
>  -- base.py
>  -- production.py
> -- static
>-- media
>   -- product
> -- images
>   --
>-- static_dirs
>-- static_root
>
>
> In my app/mysite/settings/ *init*.py
>
> from .base import *try:
> from .local import *
> live = Falseexcept:
> live = Trueif live:
> from .production import *
>
> and in my base.py
>
> import os
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
> STATIC_URL = '/static/'
> MEDIA_URL = '/media/'
> MEDIA_ROOT = os.path.join(BASE_DIR, 'static', 'media')
> STATIC_ROOT = os.path.join(BASE_DIR, 'static', 'static_root')
> STATICFILES_DIRS = (
> os.path.join(BASE_DIR, 'static', 'static_dirs'),)
> TEMPLATE_DIRS = (
> os.path.join(BASE_DIR, 'templates'),)
>
>
> and in my production.py, I annotated as below.
>
> # Static asset configuration# import os# BASE_DIR = 
> os.path.dirname(os.path.abspath(__file__))# STATIC_ROOT = 'staticfiles'# 
> STATIC_URL = '/static/'# STATICFILES_DIRS = (# os.path.join(BASE_DIR, 
> 'static'),# )
>
> Finally, I ran server and I got still broken image shown on my page. When
> I look the image carefully through "google inspect element",I can still see
> the probably right path as below.
>
> 
>
> But when I see my /static/media/products/images/ folder, there were images
> created on development statge only, not the images I just created on
> production site. (aws.png)
>
> As still beginner for django development, It is a tough to find answer
> even after few hour's googling.
>
> Thanks always.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2f1eb33e-c1c0-417f-8665-b8f239540f4d%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/2f1eb33e-c1c0-417f-8665-b8f239540f4d%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8okoLAeWvJKPDYAGcLR7XYOMDT1CohqcZWEsek3PtbpZdzXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


broken image on my django production site. Why is it?

2014-11-01 Thread rdyact


<https://lh5.googleusercontent.com/-FFtVl5q2M_s/VFTzY-YR7iI/Gyw/5ITM6qKL25Y/s1600/medialinkerror.png>
I just product my site using Heroku and I got a odd problem with my media 
images broken. Here is my site structure on Heroku.

 -- app
-- manage.py
-- mysite
   -- settings
 -- __init__.py
 -- base.py
 -- production.py
-- static
   -- media
  -- product
-- images
  -- 
   -- static_dirs
   -- static_root


In my app/mysite/settings/ *init*.py

from .base import *try:
from .local import *
live = Falseexcept:
live = Trueif live:
from .production import *

and in my base.py

import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'static', 'media')
STATIC_ROOT = os.path.join(BASE_DIR, 'static', 'static_root')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static', 'static_dirs'),)
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),)


and in my production.py, I annotated as below.

# Static asset configuration# import os# BASE_DIR = 
os.path.dirname(os.path.abspath(__file__))# STATIC_ROOT = 'staticfiles'# 
STATIC_URL = '/static/'# STATICFILES_DIRS = (# os.path.join(BASE_DIR, 
'static'),# )

Finally, I ran server and I got still broken image shown on my page. When I 
look the image carefully through "google inspect element",I can still see 
the probably right path as below.



But when I see my /static/media/products/images/ folder, there were images 
created on development statge only, not the images I just created on 
production site. (aws.png)

As still beginner for django development, It is a tough to find answer even 
after few hour's googling.

Thanks always.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2f1eb33e-c1c0-417f-8665-b8f239540f4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django admin broken after putting into production

2014-02-11 Thread bhudspeth60
Thank you .collectstatic did the trick...

On Tuesday, February 11, 2014 2:39:59 PM UTC-7, Glyn Jackson wrote:
>
> Silly question, don't be offended, but have you run 
> collectstaticon
>  your production server?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61735b69-5e60-4345-b824-0c2b25bdfa68%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django admin broken after putting into production

2014-02-11 Thread Glyn Jackson

>
> Silly question, don't be offended, but have you run 
> collectstaticon
>  your production server?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0d9f10d8-efbf-477f-a3db-9385b6e51298%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django admin broken after putting into production

2014-02-11 Thread bhudspeth60


Hello, 


after considerable struggle to get my Apache mod-wsgi and httpd.conf 
configuration correct so that my static files can be accessed, now my admin 
pages don't workwhile the admin page content loads, I have no css, js, 
or images...And, the list of my pages will not show up..

*httpd.conf*



#/usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin

ServerName epswww1.unm.edu
DocumentRoot /home/eps_admin/epsWeb/epsWeb/site-media

Alias /site-media/ /home/eps_admin/epsWeb/epsWeb/site-media/
Alias /images/ /home/eps_admin/epsWeb/epsWeb/site-media/images/
Alias /media/ /home/eps_admin/epsWeb/epsWeb/site-media/

WSGIScriptAlias / /home/eps_admin/epsWeb/epsWeb/wsgi.py

ErrorLog ${APACHE_LOG_DIR}/static_error.log
LogLevel warn

  # serve static stuff from here
  
   #AllowOverride None
   Order deny,allow
   Allow from all
  




*relevant info from settings.py*

MEDIA_ROOT = os.path.join(PROJECT_PATH, "site-media")
MEDIA_URL = "/site-media/"
STATIC_ROOT = os.path.join("/home/eps_admin/epsWeb/epsWeb/static/")
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
os.path.join(BASE_DIR,"static"),
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

Any help appreciated

Thanks, Wilbur

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6c97b56-3e55-41e7-b67b-e03701988c32%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Broken links even after change the site information

2014-01-07 Thread trojactory
Hi Carlos,

The sites framework is used for storing a human readable name of a domain 
(in case you are serving your site from multiple domains). It does not 
change or modify the url structure of your site.

There are only two places where you can actually change the URL structure. 
First option is to specify the exact URLs in urls.py. The second option is 
outside Django and involves manipulating the URL by the webserver or using 
WSGI middleware. For example, if you are using Apache as your web server 
you can trivially perform URL rewriting using .htaccess files (
http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/
)

In your case, I suggest the first option. I guess you are using 
django-registrations app, then you will need to modify the urls app as 
follows: url(r'^accounts/formhub/', include(
'registration.backends.simple.urls')),

Regards,
Arun

On Tuesday, January 7, 2014 5:22:36 AM UTC+5:30, Carlos Quiros wrote:
>
> Hello.
>
> I have a Django application running in my server 
> http://data.ilri.org/formhub
>
> However the links of the application are broken for example 
> *http://data.ilri.org/accounts/register/ 
> <http://data.ilri.org/accounts/register/>* instead of 
> *http://data.ilri.org/formhub/accounts/register/ 
> <http://data.ilri.org/formhub/accounts/register/> *
>
> I been looking on the internet and also configured the site framework with:
>
> python manage.py shell
> >>> from django.contrib.sites.models import Site
> >>> one = Site.objects.all()[0]
> >>> one.domain = 'http://data.ilri.org/formhub/'
> >>> one.name = 'Formhub'
> >>> one.save()
> >>> quit()
> (formhub-env)[cquiros@rmg formhub]$ python manage.py dumpdata sites
> Your environment is:"formhub.preset.default_settings"
> [{"pk": 1, "model": "sites.site", "fields": {"domain": "
> http://data.ilri.org/formhub/;, "name": "Formhub"}}](formhubnv)
>
> But still the links are broken.
>
> What else do I need to do?
>
> Any help is much appreciated.
>
> Carlos.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/331ed190-f6f9-4e97-8319-8f565ea7f58c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Broken links even after change the site information

2014-01-06 Thread Carlos Quiros
Hello.

I have a Django application running in my server 
http://data.ilri.org/formhub

However the links of the application are broken for example 
*http://data.ilri.org/accounts/register/* instead of 
*http://data.ilri.org/formhub/accounts/register/ 
*

I been looking on the internet and also configured the site framework with:

python manage.py shell
>>> from django.contrib.sites.models import Site
>>> one = Site.objects.all()[0]
>>> one.domain = 'http://data.ilri.org/formhub/'
>>> one.name = 'Formhub'
>>> one.save()
>>> quit()
(formhub-env)[cquiros@rmg formhub]$ python manage.py dumpdata sites
Your environment is:"formhub.preset.default_settings"
[{"pk": 1, "model": "sites.site", "fields": {"domain": 
"http://data.ilri.org/formhub/;, "name": "Formhub"}}](formhubnv)

But still the links are broken.

What else do I need to do?

Any help is much appreciated.

Carlos.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c3d05252-7253-409d-ab03-5f9296bdc24c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Have browsers broken post-redirect-get? best practice now?

2013-10-05 Thread graeme


On Friday, October 4, 2013 12:00:47 PM UTC+5:30, dspruell wrote:
>
> On Thu, Oct 3, 2013 at 6:15 AM, graeme <graeme@gmail.com > 
> wrote: 
> > I disagree that breaking the back button is always bad. For example 
> suppose 
> > you have a series of forms (i.e. a "wizard"): 
> > 
> > Page 1) fill in form. On POST creates a new Model() and saves it to the 
> > database 
> > 2) do stuff to the object (e.g. add inlines, whatever). 
> > 3) whatever comes next 
> > 
> > At stop two, user clicks back. They then post the form again, and get 
> > another object. On the other hand the page in step 2 can provide a back 
> > button on the page that takes the user back to edit what they entered on 
> > page 1. Which is more useful? I would say the latter - and users may not 
> > then understand that the browser back button and page back button do 
> > different things. 
>
> Django supports this form wizard behavior in a sane way through Form 
> Wizards: 
>

Its the right way to do it in general, agreed - although in some cases it 
seems to be
more work than doing it from scratch.
 

>
> https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/ 
>
> In the case of form wizards, each step through the series of forms in 
> the wizard occurs from the same URL, and the API provides users a way 
> to traverse individual forms (steps) in the wizard in a controlled 
> way. If the client uses the browser back button, it drops them back 
> from the URL the form wizard is served from, not to a previous step in 
> the form. 
>

It does not, in itself, answer my question, because clicking the back 
button after
posting a page takes you back to the previous (state of the) page, even if 
you remain
 on the same URL.

I think the answer is avoid breaking the back button, unless its essential. 

>
> DS 
>
>
>
>
> > On Tuesday, October 1, 2013 8:33:41 PM UTC+5:30, antialiasis wrote: 
> >> 
> >> You should still be able to use the back button; it just shouldn't try 
> to 
> >> post the data again if you do so. Are you getting a prompt about 
> resending 
> >> post data, or are you just talking about being able to use the back 
> button 
> >> at all? If the latter, that's exactly what should happen. Breaking the 
> >> user's back button is bad. 
> >> 
> >> On Tuesday, October 1, 2013 12:41:20 PM UTC, graeme wrote: 
> >>> 
> >>> The Django  docs (and a lot else) recommend redirecting after 
> >>> successfully processing a post request (if it changes data). i.e. 
> post, the 
> >>> save stuff to the database, then redirect. 
> >>> 
> >>> Current browsers seem to allow this. I have tried Chromium 28 and 24 
> on 
> >>> Linux, I user return redirect(...) after the post, and I can still use 
> the 
> >>> back button. 
> >>> 
> >>> Is it my configuration, or is it usual? What is the best practice if 
> this 
> >>> is broken? 
> >>> 
> >>> In some cases I think tracking where the user is (in the session, or 
> >>> using the state of a particular object such as an order model), and 
> >>> redirecting any request for an earlier page in a sequence may be the 
> way to 
> >>> go. Or is this a solved problem that I am too far behind the curve to 
> know 
> >>> about? 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/cf0dd1f1-b004-4595-800f-1190ca9f4171%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>
>
>
> -- 
> Darren Spruell 
> phatb...@gmail.com  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/06b43549-0859-4304-af9e-b7ba719177c9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Have browsers broken post-redirect-get? best practice now?

2013-10-05 Thread graeme


On Friday, October 4, 2013 3:51:30 AM UTC+5:30, david.durham.jr wrote:
>
> I think when they hit the browsers back button, the form will have the 
> data they entered previously.  When they submit it, since it was 
> already submitted previously, you could just make it an edit action, 
>


That is what I mostly do - but if the step they go back to is stop 1 in my 
list (i.e. create an object with initial data)
how then its unclear what they expect.

There are also some steps that are irrevocable - e.g. going back to change 
an order after paying should not be allowed.
 

> or do whatever is appropriate given that they are submitting the same 
> form again.  I think the functionality of the browser's back button is 
> universal and accepted and shouldn't be broken or reinvented. 
>
> -Dave 
>
> On Thu, Oct 3, 2013 at 8:15 AM, graeme <graeme@gmail.com > 
> wrote: 
> > I disagree that breaking the back button is always bad. For example 
> suppose 
> > you have a series of forms (i.e. a "wizard"): 
> > 
> > Page 1) fill in form. On POST creates a new Model() and saves it to the 
> > database 
> > 2) do stuff to the object (e.g. add inlines, whatever). 
> > 3) whatever comes next 
> > 
> > At stop two, user clicks back. They then post the form again, and get 
> > another object. On the other hand the page in step 2 can provide a back 
> > button on the page that takes the user back to edit what they entered on 
> > page 1. Which is more useful? I would say the latter - and users may not 
> > then understand that the browser back button and page back button do 
> > different things. 
> > 
> > On Tuesday, October 1, 2013 8:33:41 PM UTC+5:30, antialiasis wrote: 
> >> 
> >> You should still be able to use the back button; it just shouldn't try 
> to 
> >> post the data again if you do so. Are you getting a prompt about 
> resending 
> >> post data, or are you just talking about being able to use the back 
> button 
> >> at all? If the latter, that's exactly what should happen. Breaking the 
> >> user's back button is bad. 
> >> 
> >> On Tuesday, October 1, 2013 12:41:20 PM UTC, graeme wrote: 
> >>> 
> >>> The Django  docs (and a lot else) recommend redirecting after 
> >>> successfully processing a post request (if it changes data). i.e. 
> post, the 
> >>> save stuff to the database, then redirect. 
> >>> 
> >>> Current browsers seem to allow this. I have tried Chromium 28 and 24 
> on 
> >>> Linux, I user return redirect(...) after the post, and I can still use 
> the 
> >>> back button. 
> >>> 
> >>> Is it my configuration, or is it usual? What is the best practice if 
> this 
> >>> is broken? 
> >>> 
> >>> In some cases I think tracking where the user is (in the session, or 
> >>> using the state of a particular object such as an order model), and 
> >>> redirecting any request for an earlier page in a sequence may be the 
> way to 
> >>> go. Or is this a solved problem that I am too far behind the curve to 
> know 
> >>> about? 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/cf0dd1f1-b004-4595-800f-1190ca9f4171%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4bf39b98-e8b0-4d7d-b907-7fbc62d5d1a3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Have browsers broken post-redirect-get? best practice now?

2013-10-04 Thread Darren Spruell
On Thu, Oct 3, 2013 at 6:15 AM, graeme <graeme.piete...@gmail.com> wrote:
> I disagree that breaking the back button is always bad. For example suppose
> you have a series of forms (i.e. a "wizard"):
>
> Page 1) fill in form. On POST creates a new Model() and saves it to the
> database
> 2) do stuff to the object (e.g. add inlines, whatever).
> 3) whatever comes next
>
> At stop two, user clicks back. They then post the form again, and get
> another object. On the other hand the page in step 2 can provide a back
> button on the page that takes the user back to edit what they entered on
> page 1. Which is more useful? I would say the latter - and users may not
> then understand that the browser back button and page back button do
> different things.

Django supports this form wizard behavior in a sane way through Form Wizards:

https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/

In the case of form wizards, each step through the series of forms in
the wizard occurs from the same URL, and the API provides users a way
to traverse individual forms (steps) in the wizard in a controlled
way. If the client uses the browser back button, it drops them back
from the URL the form wizard is served from, not to a previous step in
the form.

DS




> On Tuesday, October 1, 2013 8:33:41 PM UTC+5:30, antialiasis wrote:
>>
>> You should still be able to use the back button; it just shouldn't try to
>> post the data again if you do so. Are you getting a prompt about resending
>> post data, or are you just talking about being able to use the back button
>> at all? If the latter, that's exactly what should happen. Breaking the
>> user's back button is bad.
>>
>> On Tuesday, October 1, 2013 12:41:20 PM UTC, graeme wrote:
>>>
>>> The Django  docs (and a lot else) recommend redirecting after
>>> successfully processing a post request (if it changes data). i.e. post, the
>>> save stuff to the database, then redirect.
>>>
>>> Current browsers seem to allow this. I have tried Chromium 28 and 24 on
>>> Linux, I user return redirect(...) after the post, and I can still use the
>>> back button.
>>>
>>> Is it my configuration, or is it usual? What is the best practice if this
>>> is broken?
>>>
>>> In some cases I think tracking where the user is (in the session, or
>>> using the state of a particular object such as an order model), and
>>> redirecting any request for an earlier page in a sequence may be the way to
>>> go. Or is this a solved problem that I am too far behind the curve to know
>>> about?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cf0dd1f1-b004-4595-800f-1190ca9f4171%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Darren Spruell
phatbuck...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKVSOJXf58hvD1H6pu%2BMfo5fUMxKm-VDbncr7hSX7Xm14arP7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Have browsers broken post-redirect-get? best practice now?

2013-10-03 Thread David Durham
I think when they hit the browsers back button, the form will have the
data they entered previously.  When they submit it, since it was
already submitted previously, you could just make it an edit action,
or do whatever is appropriate given that they are submitting the same
form again.  I think the functionality of the browser's back button is
universal and accepted and shouldn't be broken or reinvented.

-Dave

On Thu, Oct 3, 2013 at 8:15 AM, graeme <graeme.piete...@gmail.com> wrote:
> I disagree that breaking the back button is always bad. For example suppose
> you have a series of forms (i.e. a "wizard"):
>
> Page 1) fill in form. On POST creates a new Model() and saves it to the
> database
> 2) do stuff to the object (e.g. add inlines, whatever).
> 3) whatever comes next
>
> At stop two, user clicks back. They then post the form again, and get
> another object. On the other hand the page in step 2 can provide a back
> button on the page that takes the user back to edit what they entered on
> page 1. Which is more useful? I would say the latter - and users may not
> then understand that the browser back button and page back button do
> different things.
>
> On Tuesday, October 1, 2013 8:33:41 PM UTC+5:30, antialiasis wrote:
>>
>> You should still be able to use the back button; it just shouldn't try to
>> post the data again if you do so. Are you getting a prompt about resending
>> post data, or are you just talking about being able to use the back button
>> at all? If the latter, that's exactly what should happen. Breaking the
>> user's back button is bad.
>>
>> On Tuesday, October 1, 2013 12:41:20 PM UTC, graeme wrote:
>>>
>>> The Django  docs (and a lot else) recommend redirecting after
>>> successfully processing a post request (if it changes data). i.e. post, the
>>> save stuff to the database, then redirect.
>>>
>>> Current browsers seem to allow this. I have tried Chromium 28 and 24 on
>>> Linux, I user return redirect(...) after the post, and I can still use the
>>> back button.
>>>
>>> Is it my configuration, or is it usual? What is the best practice if this
>>> is broken?
>>>
>>> In some cases I think tracking where the user is (in the session, or
>>> using the state of a particular object such as an order model), and
>>> redirecting any request for an earlier page in a sequence may be the way to
>>> go. Or is this a solved problem that I am too far behind the curve to know
>>> about?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cf0dd1f1-b004-4595-800f-1190ca9f4171%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADM6s_D_7R9Yix60h7ZMdMdRbs%2BX5T9%2BOHDhHGMrJ_B%3D4xVqZg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Have browsers broken post-redirect-get? best practice now?

2013-10-03 Thread graeme
I disagree that breaking the back button is always bad. For example suppose 
you have a series of forms (i.e. a "wizard"):

Page 1) fill in form. On POST creates a new Model() and saves it to the 
database
2) do stuff to the object (e.g. add inlines, whatever).
3) whatever comes next

At stop two, user clicks back. They then post the form again, and get 
another object. On the other hand the page in step 2 can provide a back 
button on the page that takes the user back to edit what they entered on 
page 1. Which is more useful? I would say the latter - and users may not 
then understand that the browser back button and page back button do 
different things.

On Tuesday, October 1, 2013 8:33:41 PM UTC+5:30, antialiasis wrote:
>
> You should still be able to use the back button; it just shouldn't try to 
> post the data again if you do so. Are you getting a prompt about resending 
> post data, or are you just talking about being able to use the back button 
> at all? If the latter, that's exactly what should happen. Breaking the 
> user's back button is bad.
>
> On Tuesday, October 1, 2013 12:41:20 PM UTC, graeme wrote:
>>
>> The Django  docs (and a lot else) recommend redirecting after 
>> successfully processing a post request (if it changes data). i.e. post, the 
>> save stuff to the database, then redirect.
>>
>> Current browsers seem to allow this. I have tried Chromium 28 and 24 on 
>> Linux, I user return redirect(...) after the post, and I can still use the 
>> back button.
>>
>> Is it my configuration, or is it usual? What is the best practice if this 
>> is broken?
>>
>> In some cases I think tracking where the user is (in the session, or 
>> using the state of a particular object such as an order model), and 
>> redirecting any request for an earlier page in a sequence may be the way to 
>> go. Or is this a solved problem that I am too far behind the curve to know 
>> about?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cf0dd1f1-b004-4595-800f-1190ca9f4171%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Have browsers broken post-redirect-get? best practice now?

2013-10-01 Thread antialiasis
You should still be able to use the back button; it just shouldn't try to 
post the data again if you do so. Are you getting a prompt about resending 
post data, or are you just talking about being able to use the back button 
at all? If the latter, that's exactly what should happen. Breaking the 
user's back button is bad.

On Tuesday, October 1, 2013 12:41:20 PM UTC, graeme wrote:
>
> The Django  docs (and a lot else) recommend redirecting after successfully 
> processing a post request (if it changes data). i.e. post, the save stuff 
> to the database, then redirect.
>
> Current browsers seem to allow this. I have tried Chromium 28 and 24 on 
> Linux, I user return redirect(...) after the post, and I can still use the 
> back button.
>
> Is it my configuration, or is it usual? What is the best practice if this 
> is broken?
>
> In some cases I think tracking where the user is (in the session, or using 
> the state of a particular object such as an order model), and redirecting 
> any request for an earlier page in a sequence may be the way to go. Or is 
> this a solved problem that I am too far behind the curve to know about?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1dcdf23f-94da-41c4-aed9-ef70ca63dfeb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Have browsers broken post-redirect-get? best practice now?

2013-10-01 Thread graeme
The Django  docs (and a lot else) recommend redirecting after successfully 
processing a post request (if it changes data). i.e. post, the save stuff 
to the database, then redirect.

Current browsers seem to allow this. I have tried Chromium 28 and 24 on 
Linux, I user return redirect(...) after the post, and I can still use the 
back button.

Is it my configuration, or is it usual? What is the best practice if this 
is broken?

In some cases I think tracking where the user is (in the session, or using 
the state of a particular object such as an order model), and redirecting 
any request for an earlier page in a sequence may be the way to go. Or is 
this a solved problem that I am too far behind the curve to know about?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/71edbe7c-5e3b-48e9-9469-434fdc153473%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


broken pipe error

2013-09-14 Thread Tushar Patil
I am following the tdd Django tutorial, i am using python 2.7 and django 1.5
i got error in tutorial 2

Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
self.finish_response()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 127, in
finish_response
self.write(data)
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 210, in write
self.send_headers()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 268, in send_headers
self.send_preamble()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 192, in send_preamble
'Date: %s\r\n' % format_date_time(time.time())
  File "/usr/lib/python2.7/socket.py", line 324, in write
self.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe

I have a fts/test.py

from django.test import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys



class PollsTest(LiveServerTestCase):
fixtures = ['admin_user.json']
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(30)
 def tearDown(self):
self.browser.quit()

def test_can_create_new_poll_via_admin_site(self):
self.browser.get(self.live_server_url + '/admin/')

body = self.browser.find_element_by_tag_name('body')
self.assertIn('Django administration', body.text)

username_field = self.browser.find_element_by_name('username')
username_field.send_keys('admin')

password_field = self.browser.find_element_by_name('password')
password_field.send_keys('admin')
password_field.send_keys(Keys.RETURN)

body = self.browser.find_element_by_tag_name('body')
self.assertIn('Site administration', body.text)

polls_links = self.browser.find_elements_by_link_text('Polls')
self.assertEquals(len(polls_links), 2)

polls_links[1].click()

body = self.browser.find_element_by_tag_name('body')
  self.assertIn('0 polls', body.text)
  new_poll_link = self.browser.find_element_by_link_text('Add poll')
  new_poll_link.click()

#self.fail('todo: finish tests')

I am totally new to python and django, afters lot of googling i am unable
to solve the error, Pleaes give me reply ASAP.





Thanks,
Tushar Patil.
Mob - +917798789759.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: broken packages

2013-08-12 Thread Aaron C. de Bruyn
This isn't a django issue, but rather an issue with the package management
system in your Linux distribution.

This can happen if someone publishes a broken package, or you add on PPA's
that have conflicting requirements.

Basically it's saying that geonode depends on a version of Django greater
than 1.5.1 but version 1.4.1 is installed.  It may be that 1.5.1 is not
available in your distro yet.

You might try the Debian or Ubuntu forums for further assistance.

-A



On Mon, Aug 12, 2013 at 9:32 AM, Truongxuan Quang <truongxuanqu...@gmail.com
> wrote:

> I run command
> $sudo apt-get install geonode
> it showed as the list bellows:
>
>  geonode : Depends: python-django (>= 1.5.1) but 1.4.1-2ubuntu0.3 is to be
> installed
>Depends: python-agon-ratings but it is not installable
>Depends: python-dialogos but it is not installable
>Depends: python-django-activity-stream but it is not installable
>Depends: python-django-forms-bootstrap but it is not installable
>Depends: python-django-friendly-tag-loader but it is not
> installable
>Depends: python-django-geoexplorer but it is not installable
>Depends: python-django-jsonfield but it is not installable
>Depends: python-django-taggit but it is not installable
>Depends: python-django-taggit-templatetags but it is not
> installable
>Depends: python-django-user-accounts but it is not installable
>Depends: python-geonode-avatar but it is not installable
>Depends: python-gisdata but it is not installable
>Depends: python-gsconfig but it is not installable
>Depends: python-owslib but it is not installable
>Depends: python-pycsw but it is not installable
>Depends: python-paver but it is not installable
>Depends: python-user-messages but it is not installable
>Depends: python-django-announcements but it is not installable
>Depends: python-pinax-theme-bootstrap but it is not installable
>Depends: python-pinax-theme-bootstrap-account but it is not
> installable
> E: Unable to correct problems, you have held broken packages.
>
> I have used
> $sudo apt-get clean, autoclean, and install -f in order to fix packages
> but i was not success
>
> Please help me to fix these
>
> Many thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




broken packages

2013-08-12 Thread Truongxuan Quang
I run command 
$sudo apt-get install geonode
it showed as the list bellows:

 geonode : Depends: python-django (>= 1.5.1) but 1.4.1-2ubuntu0.3 is to be 
installed
   Depends: python-agon-ratings but it is not installable
   Depends: python-dialogos but it is not installable
   Depends: python-django-activity-stream but it is not installable
   Depends: python-django-forms-bootstrap but it is not installable
   Depends: python-django-friendly-tag-loader but it is not 
installable
   Depends: python-django-geoexplorer but it is not installable
   Depends: python-django-jsonfield but it is not installable
   Depends: python-django-taggit but it is not installable
   Depends: python-django-taggit-templatetags but it is not 
installable
   Depends: python-django-user-accounts but it is not installable
   Depends: python-geonode-avatar but it is not installable
   Depends: python-gisdata but it is not installable
   Depends: python-gsconfig but it is not installable
   Depends: python-owslib but it is not installable
   Depends: python-pycsw but it is not installable
   Depends: python-paver but it is not installable
   Depends: python-user-messages but it is not installable
   Depends: python-django-announcements but it is not installable
   Depends: python-pinax-theme-bootstrap but it is not installable
   Depends: python-pinax-theme-bootstrap-account but it is not 
installable
E: Unable to correct problems, you have held broken packages.

I have used 
$sudo apt-get clean, autoclean, and install -f in order to fix packages but 
i was not success 

Please help me to fix these

Many thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django 1.4 tutorial part 1 seems broken at the superuser creation stage.

2013-06-17 Thread Ed
Thank you very much, Tom, for pointing that out.

I had no idea django was looking for that environment variable. Following 
your direction, I checked, and discover that they are all indeed default to 
"undefined". I'm using OpenBSD 5.3 on macppc, which explains why they were 
not set, as opposed to on Linux.

$ python -m locale
Locale aliasing:

Locale defaults as determined by getdefaultlocale():

Language:  (undefined)
Encoding:  (undefined)

Locale settings on startup:

LC_NUMERIC ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MESSAGES ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MONETARY ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_COLLATE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_CTYPE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_TIME ...
   Language:  (undefined)
   Encoding:  (undefined)


Locale settings after calling resetlocale():

LC_NUMERIC ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MESSAGES ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MONETARY ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_COLLATE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_CTYPE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_TIME ...
   Language:  (undefined)
   Encoding:  (undefined)


Locale settings after calling setlocale(LC_ALL, ""):

LC_NUMERIC ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MESSAGES ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MONETARY ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_COLLATE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_CTYPE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_TIME ...
   Language:  (undefined)
   Encoding:  (undefined)


Number formatting:

123456789 is 123456789
3.14 is 3.14
$ 




On Monday, 17 June 2013 04:02:43 UTC-7, Tom Evans wrote:
>
> On Sun, Jun 16, 2013 at 8:06 AM, Ed  
> wrote: 
> > Hello Dear Django Group. 
> > 
> > My first day with Django, I just got it installed on my computer, and am 
> > trying to follow along with the first tutorial: 
> > https://docs.djangoproject.com/en/1.4/intro/tutorial01/ 
> > 
> > I have Django's development server up, and I'm able to see the "It 
> worked!" 
> > Django welcome page. Where I ran into the dead end is at the following 
> > section: 
> > 
> > "The syncdb command looks at the INSTALLED_APPS setting and creates any 
> > necessary database tables according to the database settings in your 
> > settings.py file. You’ll see a message for each database table it 
> creates, 
> > and you’ll get a prompt asking you if you’d like to create a superuser 
> > account for the authentication system. Go ahead and do that." 
> > 
> > Up to this point, I've followed the tutorial line by line. However, 
> after I 
> > ran the command "python manage.py syncdb", I got the error message 
> below, 
> > and it seems to be an internal error to Django. Has anyone else 
> encountered 
> > this issue, and how did you resolve it? Any feedback or insight is 
> > appreciated. Thank you! 
> > 
> > 
> > $ python manage.py syncdb 
> > Creating tables ... 
> > Creating table auth_permission 
> > Creating table auth_group_permissions 
> > Creating table auth_group 
> > Creating table auth_user_user_permissions 
> > Creating table auth_user_groups 
> > Creating table auth_user 
> > Creating table django_content_type 
> > Creating table django_session 
> > Creating table django_site 
> > 
> > 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 10, in  
> > execute_from_command_line(sys.argv) 
> >   File 
> > 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
>
> > line 443, in execute_from_command_line 
> > utility.execute() 
> >   File 
> > 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
>
> > line 382, 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 196, in run_from_argv 
> > self.execute(*args, **options.__dict__) 
> >   File 
> > "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> > line 232, in execute 
> > output = self.handle(*args, **options) 
> >   File 
> > "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> > line 371, in handle 
> > return self.handle_noargs(**options) 
> >   File 
> > 
> 

Re: Django 1.4 tutorial part 1 seems broken at the superuser creation stage.

2013-06-17 Thread Tom Evans
On Sun, Jun 16, 2013 at 8:06 AM, Ed  wrote:
> Hello Dear Django Group.
>
> My first day with Django, I just got it installed on my computer, and am
> trying to follow along with the first tutorial:
> https://docs.djangoproject.com/en/1.4/intro/tutorial01/
>
> I have Django's development server up, and I'm able to see the "It worked!"
> Django welcome page. Where I ran into the dead end is at the following
> section:
>
> "The syncdb command looks at the INSTALLED_APPS setting and creates any
> necessary database tables according to the database settings in your
> settings.py file. You’ll see a message for each database table it creates,
> and you’ll get a prompt asking you if you’d like to create a superuser
> account for the authentication system. Go ahead and do that."
>
> Up to this point, I've followed the tutorial line by line. However, after I
> ran the command "python manage.py syncdb", I got the error message below,
> and it seems to be an internal error to Django. Has anyone else encountered
> this issue, and how did you resolve it? Any feedback or insight is
> appreciated. Thank you!
>
>
> $ python manage.py syncdb
> Creating tables ...
> Creating table auth_permission
> Creating table auth_group_permissions
> Creating table auth_group
> Creating table auth_user_user_permissions
> Creating table auth_user_groups
> Creating table auth_user
> Creating table django_content_type
> Creating table django_session
> Creating table django_site
>
> 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 10, in 
> execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 443, in execute_from_command_line
> utility.execute()
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 382, 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 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 371, in handle
> return self.handle_noargs(**options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
> line 110, 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, database=db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 150, in call_command
> return klass.execute(*args, **defaults)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
> line 70, 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
> $
>

Look at the final, breaking, line of code in the stack trace:

return getpass.getuser().decode(locale.getdefaultlocale()[1])

The error says that the argument to decode() is None. The argument to
decode() is the 2nd value returned by locale.getdefaultlocale(), which
returns a 2-tuple of (locale, charset), which is determined (on linux)
by examining the value of the environment variable LANG.

If LANG is unset or empty (or the "C" locale) then these values are
undefined. Django relies on these values being defined to understand
input that is given to it.

Set a proper LANG in your environment. Use "python -m locale" to check
what python sees it as. Common values for LANG are like "en_GB.UTF-8"
or "pt_BR.UTF-8".

Cheers

Tom

-- 
You received this message because you are subscribed to the Google 

Re: Django 1.4 tutorial part 1 seems broken at the superuser creation stage.

2013-06-16 Thread gilberto dos santos alves
please see your locale environment var. what is your os (linux, windows, 
mac) please post your files. how you installed your django?

Em domingo, 16 de junho de 2013 04h06min32s UTC-3, Ed escreveu:
>
> Hello Dear Django Group.
>
> My first day with Django, I just got it installed on my computer, and am 
> trying to follow along with the first tutorial: 
> https://docs.djangoproject.com/en/1.4/intro/tutorial01/
>
> I have Django's development server up, and I'm able to see the "It 
> worked!" Django welcome page. Where I ran into the dead end is at the 
> following section:
>
> "The 
> syncdb
>  command looks at the 
> INSTALLED_APPS
>  setting and creates any necessary database tables according to the 
> database settings in your settings.py file. You’ll see a message for each 
> database table it creates, and you’ll get a prompt asking you if you’d like 
> to create a superuser account for the authentication system. Go ahead and 
> do that."
>
> Up to this point, I've followed the tutorial line by line. However, after 
> I ran the command "python manage.py syncdb", I got the error message below, 
> and it seems to be an internal error to Django. Has anyone else encountered 
> this issue, and how did you resolve it? Any feedback or insight is 
> appreciated. Thank you!
>
>
> $ python manage.py syncdb 
>  
> Creating tables ...
> Creating table auth_permission
> Creating table auth_group_permissions
> Creating table auth_group
> Creating table auth_user_user_permissions
> Creating table auth_user_groups
> Creating table auth_user
> Creating table django_content_type
> Creating table django_session
> Creating table django_site
>
> 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 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 443, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 382, 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 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 232, in execute
> output = self.handle(*args, **options)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 371, in handle
> return self.handle_noargs(**options)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
>  
> line 110, 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, database=db)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
> line 150, in call_command
> return klass.execute(*args, **defaults)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
> line 232, in execute
> output = self.handle(*args, **options)
>   File 
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
>  
> line 70, 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
> $ 
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, 

Django 1.4 tutorial part 1 seems broken at the superuser creation stage.

2013-06-16 Thread Ed
Hello Dear Django Group.

My first day with Django, I just got it installed on my computer, and am 
trying to follow along with the first 
tutorial: https://docs.djangoproject.com/en/1.4/intro/tutorial01/

I have Django's development server up, and I'm able to see the "It worked!" 
Django welcome page. Where I ran into the dead end is at the following 
section:

"The 
syncdb
 command looks at the 
INSTALLED_APPS
 setting and creates any necessary database tables according to the 
database settings in your settings.py file. You’ll see a message for each 
database table it creates, and you’ll get a prompt asking you if you’d like 
to create a superuser account for the authentication system. Go ahead and 
do that."

Up to this point, I've followed the tutorial line by line. However, after I 
ran the command "python manage.py syncdb", I got the error message below, 
and it seems to be an internal error to Django. Has anyone else encountered 
this issue, and how did you resolve it? Any feedback or insight is 
appreciated. Thank you!


$ python manage.py syncdb   
   
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site

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 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 382, 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 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
line 232, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
line 371, in handle
return self.handle_noargs(**options)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
 
line 110, 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, database=db)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", 
line 150, in call_command
return klass.execute(*args, **defaults)
  File 
"/usr/local/lib/python2.7/site-packages/django/core/management/base.py", 
line 232, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
 
line 70, 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
$ 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




broken imports in python3.3 + django 1.5

2013-04-26 Thread danny
Howdy,

In python 3.3 you no longer need __init__.py in directories to be
interpreted as package namespaces. In my source I have the following tree
src
  /apps
/index
/mapping

I removed the __init__.py files as I should be able to, but imports broke.
Specifically:

 
/opt/python3.3.1/lib/python3.3/site-packages/django/utils/translation/trans_real.py(155)_fetch()
154 app = import_module(appname)
2-> 155 apppath =
os.path.join(os.path.dirname(upath(app.__file__)), 'locale')

notice the app.__file__. In python 3.3 modules are not required to have a
__file__ attribute. 

So in particular, I was not able to execute
python3.3 manage.py shell because of the cryptic
*** AttributeError: 'module' object has no attribute '__file__'
which I traced to this line in the Django source.

I don't know if it appears anywhere else, but module.__file__ is no longer
robust in python 3.3.

The poor man's fix is to put the __init__.py's back in. 
src
  /apps
/index
  __init__.py
/mapping
  __init__.py

works just fine, but shouldn't be required.

This is on RHEL5.8, but I doubt that matters.

thanks,
Danny


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How can I completely remove Django and reinstall it - I've broken something

2013-04-26 Thread ashwoods
run pip uninstall 
several times just in case :)

then reinstall django.

take a look at virtualenv. lets you make isolated python environments. 
makes life a lot easier: 
https://jamiecurle.co.uk/blog/installing-pip-virtualenv-and-virtualenvwrapper-on-os-x/


On Friday, April 26, 2013 2:00:28 AM UTC+2, Garry Pettet wrote:
>
> I'm a complete newcomer to Python and the Django framework so please be 
> gentle.
>
> I'm on a Mac 10.8 and MAMP. I was following the tutorial and installed the 
> latest stable version (1.5) of Django using pip thanks to the instructions 
> on this 
> page.
>  
> For some reason, I decided immediately after this to install instead the 
> development version (1.6dev) by cloning the git repository using these 
> instructions.
>  
> At this point, everything was OK and running the following code:
>
> >>> import django
> >>> print(django.get_version())
>
>
> printed out version 1.6dev-blahblahblah.
>
> I then tried to create my first project with this command:
>
> django-admin.py startproject mysite
>
>
> It worked. Here's where I did something stupid. I changed my mind at this 
> point and thought it might be better to stick with the stable development 
> version rather than the bleeding edge version and so I tried to remove the 
> development version. All I did was delete the django folder found after 
> typing this command:
>
> python -c "import sys; sys.path = sys.path[1:]; import django; 
> print(django.__path__)"
>
>
> I then reran pip and it said everything was installed correctly. When I 
> get the version number from the Python interpreter I get this output:
>
> >>> import django
> >>> print(django.get_version())
> 1.5.1
>
>
> However, when I try to create a new project I get the following error:
>
> django-admin.py startproject mysite
> Traceback (most recent call last):
>   File "/usr/local/bin/django-admin.py", line 4, in 
> from pkg_resources import require; 
> require('Django==1.6.dev20130425172216')
>   File 
> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
>  
> line 2607, in 
> parse_requirements(__requires__), Environment()
>   File 
> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
>  
> line 565, in resolve
> raise DistributionNotFound(req)  # XXX put more info here
> pkg_resources.DistributionNotFound: Django==1.6.dev20130425172216
> Garrys-MacBook-Air-2:~ Garry$ 
>
> Sorry for being stupid but how can I fix this??
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




How can I completely remove Django and reinstall it - I've broken something

2013-04-25 Thread Garry Pettet
I'm a complete newcomer to Python and the Django framework so please be 
gentle.

I'm on a Mac 10.8 and MAMP. I was following the tutorial and installed the 
latest stable version (1.5) of Django using pip thanks to the instructions 
on this 
page.
 
For some reason, I decided immediately after this to install instead the 
development version (1.6dev) by cloning the git repository using these 
instructions.
 
At this point, everything was OK and running the following code:

>>> import django
>>> print(django.get_version())


printed out version 1.6dev-blahblahblah.

I then tried to create my first project with this command:

django-admin.py startproject mysite


It worked. Here's where I did something stupid. I changed my mind at this 
point and thought it might be better to stick with the stable development 
version rather than the bleeding edge version and so I tried to remove the 
development version. All I did was delete the django folder found after 
typing this command:

python -c "import sys; sys.path = sys.path[1:]; import django; 
print(django.__path__)"


I then reran pip and it said everything was installed correctly. When I get 
the version number from the Python interpreter I get this output:

>>> import django
>>> print(django.get_version())
1.5.1


However, when I try to create a new project I get the following error:

django-admin.py startproject mysite
Traceback (most recent call last):
  File "/usr/local/bin/django-admin.py", line 4, in 
from pkg_resources import require; 
require('Django==1.6.dev20130425172216')
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
 
line 2607, in 
parse_requirements(__requires__), Environment()
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py",
 
line 565, in resolve
raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: Django==1.6.dev20130425172216
Garrys-MacBook-Air-2:~ Garry$ 

Sorry for being stupid but how can I fix this??

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




view_func.__module__ suddenly broken

2013-02-26 Thread Greg Donald
I have a process_view middleware that sets the module and view names
into the request like this:

class ViewName( object ):
def process_view( self, request, view_func, view_args, view_kwargs ):
request.module_name = view_func.__module__
request.view_name = view_func.__name__

I use the names together as a key for session based pagination.

But as of yesterday, for reasons I am unable to discover,
view_func.__module__ now returns 'cp.models', which is a model file in
one of my apps.

I've gone back one commit at a time today trying to find the cause.
The issue is still there even after reverting code to more than a
month ago.


I'm seeing only two python packages changed recently on the server, my
app uses neither, and the updates were more than a month ago:

cat /var/log/dpkg.log*|grep "upgrade" |grep python
2013-01-25 03:41:05 upgrade python-problem-report 2.0.1-0ubuntu15.1
2.0.1-0ubuntu17.1
2013-01-25 03:41:06 upgrade python-apport 2.0.1-0ubuntu15.1 2.0.1-0ubuntu17.1


I also tried rearranging my middleware list, didn't help.

Any idea what else might be causing this issue?


Thanks.



-- 
Greg Donald

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




cursor.execute with multiple parameters might be broken

2013-01-15 Thread Andy Woods
Hi there,
I'm having trouble with cusor.execute with multiple parameters.  This works 
fine:
cursor.execute("SELECT '%s' FROM '%s'" % (column,expt_id))

However, it is not advised, according to the documentation.  For one 
parameter, this works:
cursor.execute("""SELECT %s FROM '99'""", ["test"])

I just cannot get multiple parameters to work, e.g.:
cursor.execute("""SELECT %s FROM %s""", ["test","99"])

I've tried everything I can think of here!  Been at it for hours.  Would 
much appreciate your insight.  
Thanks, Andy.

-- 
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/-/GubEZvQ-0toJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: celery broken after upgrade

2012-11-28 Thread Mike
I'm running Django 1.4.2

On Wednesday, November 28, 2012 1:37:30 PM UTC+1, Sergey Russkih wrote:
>
> Looks like problem for django 1.3 only. Works for django 1.4 without 
> downgrading
>
> среда, 28 ноября 2012 г., 14:26:07 UTC+2 пользователь Mike написал:
>>
>> I finally tracked the problem down to the kombu 2.5.0.  Prior versions 
>> seem to work fine.  Then I found this thread:
>>
>> https://github.com/celery/kombu/issues/177
>>
>> According to the developer a fix is on the way.  In the meantime, you can 
>> downgrade to 2.4.10 
>>
>>
>> On Wednesday, November 28, 2012 1:09:54 PM UTC+1, Sergey Russkih wrote:
>>>
>>> Same problem
>>>
>>> среда, 28 ноября 2012 г., 12:21:56 UTC+2 пользователь Mike написал:
>>>>
>>>> I decided to update some packages in the virtualenv for my Django 
>>>> project but in doing so I seem to have broken celery.  After upgrading to 
>>>> the latest version, I now get this TypeError when calling a view that also 
>>>> submits a celery job with my_func.delay()  Here's the error I get:   
>>>>
>>>> set([]) is not JSON serializable
>>>>
>>>> I upgraded to:
>>>> celery==3.0.12
>>>> django-celery==3.0.11
>>>>
>>>> Several dependencies were also upgraded: billiard python-dateutil kombu 
>>>> pytz anyjson amqp importlib ordereddict
>>>>
>>>> Has anyone else seen this with the latest version of celery?
>>>>
>>>

-- 
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/-/5YKqjovLaNEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: celery broken after upgrade

2012-11-28 Thread Sergey Russkih
Looks like problem for django 1.3 only. Works for django 1.4 without 
downgrading

среда, 28 ноября 2012 г., 14:26:07 UTC+2 пользователь Mike написал:
>
> I finally tracked the problem down to the kombu 2.5.0.  Prior versions 
> seem to work fine.  Then I found this thread:
>
> https://github.com/celery/kombu/issues/177
>
> According to the developer a fix is on the way.  In the meantime, you can 
> downgrade to 2.4.10 
>
>
> On Wednesday, November 28, 2012 1:09:54 PM UTC+1, Sergey Russkih wrote:
>>
>> Same problem
>>
>> среда, 28 ноября 2012 г., 12:21:56 UTC+2 пользователь Mike написал:
>>>
>>> I decided to update some packages in the virtualenv for my Django 
>>> project but in doing so I seem to have broken celery.  After upgrading to 
>>> the latest version, I now get this TypeError when calling a view that also 
>>> submits a celery job with my_func.delay()  Here's the error I get:   
>>>
>>> set([]) is not JSON serializable
>>>
>>> I upgraded to:
>>> celery==3.0.12
>>> django-celery==3.0.11
>>>
>>> Several dependencies were also upgraded: billiard python-dateutil kombu 
>>> pytz anyjson amqp importlib ordereddict
>>>
>>> Has anyone else seen this with the latest version of celery?
>>>
>>

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



Re: celery broken after upgrade

2012-11-28 Thread Mike
I finally tracked the problem down to the kombu 2.5.0.  Prior versions seem 
to work fine.  Then I found this thread:

https://github.com/celery/kombu/issues/177

According to the developer a fix is on the way.  In the meantime, you can 
downgrade to 2.4.10 


On Wednesday, November 28, 2012 1:09:54 PM UTC+1, Sergey Russkih wrote:
>
> Same problem
>
> среда, 28 ноября 2012 г., 12:21:56 UTC+2 пользователь Mike написал:
>>
>> I decided to update some packages in the virtualenv for my Django project 
>> but in doing so I seem to have broken celery.  After upgrading to the 
>> latest version, I now get this TypeError when calling a view that also 
>> submits a celery job with my_func.delay()  Here's the error I get:   
>>
>> set([]) is not JSON serializable
>>
>> I upgraded to:
>> celery==3.0.12
>> django-celery==3.0.11
>>
>> Several dependencies were also upgraded: billiard python-dateutil kombu 
>> pytz anyjson amqp importlib ordereddict
>>
>> Has anyone else seen this with the latest version of celery?
>>
>

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



Re: celery broken after upgrade

2012-11-28 Thread Sergey Russkih
Same problem

среда, 28 ноября 2012 г., 12:21:56 UTC+2 пользователь Mike написал:
>
> I decided to update some packages in the virtualenv for my Django project 
> but in doing so I seem to have broken celery.  After upgrading to the 
> latest version, I now get this TypeError when calling a view that also 
> submits a celery job with my_func.delay()  Here's the error I get:   
>
> set([]) is not JSON serializable
>
> I upgraded to:
> celery==3.0.12
> django-celery==3.0.11
>
> Several dependencies were also upgraded: billiard python-dateutil kombu 
> pytz anyjson amqp importlib ordereddict
>
> Has anyone else seen this with the latest version of celery?
>

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



celery broken after upgrade

2012-11-28 Thread Mike
I decided to update some packages in the virtualenv for my Django project 
but in doing so I seem to have broken celery.  After upgrading to the 
latest version, I now get this TypeError when calling a view that also 
submits a celery job with my_func.delay()  Here's the error I get:   

set([]) is not JSON serializable

I upgraded to:
celery==3.0.12
django-celery==3.0.11

Several dependencies were also upgraded: billiard python-dateutil kombu 
pytz anyjson amqp importlib ordereddict

Has anyone else seen this with the latest version of celery?

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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-11-26 Thread ferran
Hello,

For the url pattern www.example.com/xxx/cache/[hex] it's a bug in chrome 
extension  extension ID bodddioamolcibagionmmobehnbhiakf 
http://code.google.com/p/chromium/issues/detail?id=132059

El jueves, 19 de julio de 2012 09:21:20 UTC+2, Thomas Orozco escribió:
>
> Did you visit the page where the broken link exists with the same browser 
> as your user and searched for :
>   + JS warnings 
>   + JS errors 
>   + Requests on the broken link 
>   + The actual broken url somewhere in the DOM tree 
>
> Chrome has an integrated full featured debugger, you could use it. 
>
> The problem isn't going to automatically go away nor the explanation show 
> up in your mailbox. 
>
> Le 10 juil. 2012 09:21, "ferran" <pink...@gmail.com > a 
> écrit :
> >
> > Hello Melvyn,
> >
> > I'm found this information 
> http://stackoverflow.com/questions/11017609/undefined-randomly-appended-in-1-of-requested-urls-on-my-website-since-12-jun
> >
> > I'm have too:
> >
> > Referrer: http://www.marquezshop.com/es/catalogo/ofertas/
> > Requested URL: 
> /es/catalogo/ofertas/cache/a8790cb719ffd4424219786bc76da1a4/
> > User agent: Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/536.11 
> (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11
> > IP address: x
> >
> >
> > What is cache/hash?
> >
> >
> > Thanks in advanced
> >
> >
> >
> >
> >
> > On Wednesday, July 4, 2012 2:47:20 PM UTC+2, Melvyn Sopacua wrote:
> >>
> >> On 4-7-2012 9:55, ferran wrote: 
> >> > Hello, 
> >> > 
> >> > I'm update javascript libraries: 
> >> > - Jquery from 
> >> > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to 
> http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js 
> >> > - Jquery ui from 
> >> > http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.jsto 
> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js 
> >> > 
> >> > But not is a solutions, the problem persist... 
> >>
> >> Upgrades aren't solutions. They only dress up as them in their spare 
> time. 
> >>
> >> You should: 
> >> 1) Identify where you generate links via javascript 
> >> 2) Identify what javascript variable is passed to the link 
> >> 3) Identify how it can be undefined 
> >>
> >> If you don't see how it can be, undefined, use the appropriate 
> >> javascript forums / documentation. 
> >>
> >> -- 
> >> Melvyn Sopacua 
> >>
> >>
> > -- 
> > 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/-/O8_xSSwcqnUJ.
> >
> > To post to this group, send email to django...@googlegroups.com
> .
> > To unsubscribe from this group, send email to 
> django-users...@googlegroups.com .
> > For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>  

-- 
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/-/ia9M1h-nPAEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: people.djangoproject.com broken

2012-08-31 Thread Timothy Makobu
Strange. Well it does say it informed the admin of the error (see
screenshot) That stack-trace should tell the dev just what's happening.

On Fri, Aug 31, 2012 at 9:52 AM, Amyth Arora wrote:

> Have you tried visiting the website using a proxy ?
>
>
> On Fri, Aug 31, 2012 at 12:22 AM, creecode  wrote:
>
>> Hello Timothy,
>>
>> I just tried going to the login webpage and had no problem.  I'm not
>> registered on that website so my experience may be somewhat different.
>>
>> On Thursday, August 30, 2012 10:39:24 AM UTC-7, Timothy Makobu wrote:
>>
>> Still having no luck. Here's a screenshot of the error, displayed about 5
>>> minutes ago:
>>>
>>
>> Are you just going to the webpage or is this error after you have tried
>> to login?
>>
>> Are you using OpenID?  That may have something to do with it.
>>
>> If you are just using the "regular" login (cookie based), have you tried
>> deleting the cookies related to the website from your browser?
>>
>> Toodle-looo.
>> creecode
>>
>> --
>> 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/-/s14_SIlckdwJ.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras.offic...@gmail.com, ad...@techstricks.com
> Twitter - @a_myth_
> http://techstricks.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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: people.djangoproject.com broken

2012-08-31 Thread Amyth Arora
Have you tried visiting the website using a proxy ?

On Fri, Aug 31, 2012 at 12:22 AM, creecode  wrote:

> Hello Timothy,
>
> I just tried going to the login webpage and had no problem.  I'm not
> registered on that website so my experience may be somewhat different.
>
> On Thursday, August 30, 2012 10:39:24 AM UTC-7, Timothy Makobu wrote:
>
> Still having no luck. Here's a screenshot of the error, displayed about 5
>> minutes ago:
>>
>
> Are you just going to the webpage or is this error after you have tried to
> login?
>
> Are you using OpenID?  That may have something to do with it.
>
> If you are just using the "regular" login (cookie based), have you tried
> deleting the cookies related to the website from your browser?
>
> Toodle-looo.
> creecode
>
> --
> 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/-/s14_SIlckdwJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @a_myth_
http://techstricks.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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: people.djangoproject.com broken

2012-08-30 Thread creecode
Hello Timothy,

I just tried going to the login webpage and had no problem.  I'm not 
registered on that website so my experience may be somewhat different.

On Thursday, August 30, 2012 10:39:24 AM UTC-7, Timothy Makobu wrote:

Still having no luck. Here's a screenshot of the error, displayed about 5 
> minutes ago:
>

Are you just going to the webpage or is this error after you have tried to 
login?

Are you using OpenID?  That may have something to do with it.

If you are just using the "regular" login (cookie based), have you tried 
deleting the cookies related to the website from your browser?

Toodle-looo.
creecode

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



Re: people.djangoproject.com broken

2012-08-28 Thread Russell Keith-Magee
Hi Timothy,

It's working for me - I just logged in without any problems.

Yours,
Russ Magee %-)

On Wed, Aug 29, 2012 at 3:14 AM, Timothy Makobu
<makobu.mwambir...@gmail.com> wrote:
> Hi all,
>
> Is it just me or is Django people broken? I cant login, getting a 500 on any
> login attempt.
>
> --
> 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/-/rtCcdVrcqygJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



people.djangoproject.com broken

2012-08-28 Thread Timothy Makobu
Hi all,

Is it just me or is Django people broken? I cant login, getting a 500 on 
any login attempt.

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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-19 Thread Thomas Orozco
Did you visit the page where the broken link exists with the same browser
as your user and searched for :
  + JS warnings
  + JS errors
  + Requests on the broken link
  + The actual broken url somewhere in the DOM tree

Chrome has an integrated full featured debugger, you could use it.

The problem isn't going to automatically go away nor the explanation show
up in your mailbox.

Le 10 juil. 2012 09:21, "ferran" <pinksh...@gmail.com> a écrit :
>
> Hello Melvyn,
>
> I'm found this information
http://stackoverflow.com/questions/11017609/undefined-randomly-appended-in-1-of-requested-urls-on-my-website-since-12-jun
>
> I'm have too:
>
> Referrer: http://www.marquezshop.com/es/catalogo/ofertas/
> Requested URL:
/es/catalogo/ofertas/cache/a8790cb719ffd4424219786bc76da1a4/
> User agent: Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/536.11
(KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11
> IP address: x
>
>
> What is cache/hash?
>
>
> Thanks in advanced
>
>
>
>
>
> On Wednesday, July 4, 2012 2:47:20 PM UTC+2, Melvyn Sopacua wrote:
>>
>> On 4-7-2012 9:55, ferran wrote:
>> > Hello,
>> >
>> > I'm update javascript libraries:
>> > - Jquery from
>> > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
>> > - Jquery ui from
>> > http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.jsto
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js
>> >
>> > But not is a solutions, the problem persist...
>>
>> Upgrades aren't solutions. They only dress up as them in their spare
time.
>>
>> You should:
>> 1) Identify where you generate links via javascript
>> 2) Identify what javascript variable is passed to the link
>> 3) Identify how it can be undefined
>>
>> If you don't see how it can be, undefined, use the appropriate
>> javascript forums / documentation.
>>
>> --
>> Melvyn Sopacua
>>
>>
> --
> 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/-/O8_xSSwcqnUJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.

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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-18 Thread Vladimir Kovacevic
Hi all,
I have same problem on my PHP web tvprofil.net. I have read all posts and 
turned all debugging, logged JavaScript user errors and all headers and env 
vars.
Currently concluded this:

   - all errors are on Windows (all versions), mostly Chrome browser
   - Accepts mostly */*, but there is few image/png. Empty  
   would give all image/png errors.
   - request happens few seconds after first request (probably document 
   onload event)
   - all requests have referrer from my site
   - undefined is JavaScript error
   - no related JavaScript errors captured with logging with window.onerror 
   = ...
   - no idea what it is :) maybe some broken extension/addon/malware?



On Tuesday, 10 July 2012 09:21:06 UTC+2, ferran wrote:
>
> Hello Melvyn,
>
> I'm found this information 
> http://stackoverflow.com/questions/11017609/undefined-randomly-appended-in-1-of-requested-urls-on-my-website-since-12-jun
>
> I'm have too:
>
> Referrer: http://www.marquezshop.com/es/catalogo/ofertas/
> Requested URL: /es/catalogo/ofertas/cache/a8790cb719ffd4424219786bc76da1a4/
> User agent: Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/536.11 (KHTML, 
> like Gecko) Chrome/20.0.1132.47 Safari/536.11
> IP address: x
>
>
> What is cache/hash?
>
>
> Thanks in advanced
>
>
>
>
>
> On Wednesday, July 4, 2012 2:47:20 PM UTC+2, Melvyn Sopacua wrote:
>>
>> On 4-7-2012 9:55, ferran wrote: 
>> > Hello, 
>> > 
>> > I'm update javascript libraries: 
>> > - Jquery from 
>> > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to 
>> http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js 
>> > - Jquery ui from 
>> > http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.jsto 
>> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js 
>> > 
>> > But not is a solutions, the problem persist... 
>>
>> Upgrades aren't solutions. They only dress up as them in their spare 
>> time. 
>>
>> You should: 
>> 1) Identify where you generate links via javascript 
>> 2) Identify what javascript variable is passed to the link 
>> 3) Identify how it can be undefined 
>>
>> If you don't see how it can be, undefined, use the appropriate 
>> javascript forums / documentation. 
>>
>> -- 
>> Melvyn Sopacua 
>>
>>
>>

-- 
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/-/fIL-FAwridYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-10 Thread ferran
Hello Melvyn,

I'm found this information 
http://stackoverflow.com/questions/11017609/undefined-randomly-appended-in-1-of-requested-urls-on-my-website-since-12-jun

I'm have too:

Referrer: http://www.marquezshop.com/es/catalogo/ofertas/
Requested URL: /es/catalogo/ofertas/cache/a8790cb719ffd4424219786bc76da1a4/
User agent: Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/536.11 (KHTML, like 
Gecko) Chrome/20.0.1132.47 Safari/536.11
IP address: x


What is cache/hash?


Thanks in advanced





On Wednesday, July 4, 2012 2:47:20 PM UTC+2, Melvyn Sopacua wrote:
>
> On 4-7-2012 9:55, ferran wrote: 
> > Hello, 
> > 
> > I'm update javascript libraries: 
> > - Jquery from 
> > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to 
> http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js 
> > - Jquery ui from 
> > http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js to 
> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js 
> > 
> > But not is a solutions, the problem persist... 
>
> Upgrades aren't solutions. They only dress up as them in their spare time. 
>
> You should: 
> 1) Identify where you generate links via javascript 
> 2) Identify what javascript variable is passed to the link 
> 3) Identify how it can be undefined 
>
> If you don't see how it can be, undefined, use the appropriate 
> javascript forums / documentation. 
>
> -- 
> Melvyn Sopacua 
>
>
>

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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-04 Thread Melvyn Sopacua
On 4-7-2012 9:55, ferran wrote:
> Hello,
> 
> I'm update javascript libraries:
> - Jquery from 
> http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to 
> http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
> - Jquery ui from 
> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js to 
> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js
> 
> But not is a solutions, the problem persist...

Upgrades aren't solutions. They only dress up as them in their spare time.

You should:
1) Identify where you generate links via javascript
2) Identify what javascript variable is passed to the link
3) Identify how it can be undefined

If you don't see how it can be, undefined, use the appropriate
javascript forums / documentation.

-- 
Melvyn Sopacua


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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-07-04 Thread ferran
Hello,

I'm update javascript libraries:
- Jquery from 
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to 
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
- Jquery ui from 
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js to 
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js

But not is a solutions, the problem persist...

Thanks in advanced

On Thursday, June 28, 2012 3:24:39 PM UTC+2, ferran wrote:
>
> Hello Melvyn,
>
> Ohhh in the javascript!. you're good I view my libraries and update 
> it's necessary (Jquery, etc.).
>
> see you with the response of the re-code javascript
>
> Thanks
>
>
> On Thursday, June 28, 2012 2:59:12 PM UTC+2, Melvyn Sopacua wrote:
>>
>> On 27-6-2012 18:37, ferran wrote: 
>>
>> > In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL 
>> link" 
>> > how this: 
>> > 
>> > " 
>> > Referrer: http://www.marquezshop.com/es/catalogo/sales/ 
>> > Requested URL: /es/catalogo/sales/undefined/ 
>> ^ 
>> That's javascript, not python doing that. Python would be 'None'. So 
>> check your javascript code for Google Chrome compliance. 
>>
>> -- 
>> Melvyn Sopacua 
>>
>>
>>

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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-28 Thread ferran
Hello Melvyn,

Ohhh in the javascript!. you're good I view my libraries and update 
it's necessary (Jquery, etc.).

see you with the response of the re-code javascript

Thanks


On Thursday, June 28, 2012 2:59:12 PM UTC+2, Melvyn Sopacua wrote:
>
> On 27-6-2012 18:37, ferran wrote: 
>
> > In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL 
> link" 
> > how this: 
> > 
> > " 
> > Referrer: http://www.marquezshop.com/es/catalogo/sales/ 
> > Requested URL: /es/catalogo/sales/undefined/ 
> ^ 
> That's javascript, not python doing that. Python would be 'None'. So 
> check your javascript code for Google Chrome compliance. 
>
> -- 
> Melvyn Sopacua 
>
>
>

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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-28 Thread ferran
Hello Russ,

In the view code of this pages I don't found de keyword "undefined"

Thanks in advanced

On Thursday, June 28, 2012 1:38:22 AM UTC+2, Russell Keith-Magee wrote:
>
> On Thu, Jun 28, 2012 at 12:37 AM, ferran <pinksh...@gmail.com> wrote: 
> > Hello django users, 
> > 
> > In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL 
> link" 
> > how this: 
> > 
> > " 
> > Referrer: http://www.marquezshop.com/es/catalogo/sales/ 
> > Requested URL: /es/catalogo/sales/undefined/ 
> > User agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like 
> > Gecko) Chrome/19.0.1084.56 Safari/536.5 
> > IP address: --- 
> > " 
> > or 
> > 
> > " 
> > Referrer: 
> > 
> http://www.marquezshop.com/es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/
>  
> > Requested URL: 
> > 
> /es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/undefined/
>  
>
> > User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like 
> > Gecko) Chrome/12.0.742.122 Safari/534.30 
> > IP address:  
> > " 
> > 
> > The pattern from requested URL can be any, but, always have a end string 
> > "/undefined/" 
> > 
> > I'm not update the code, but update, nginx, mysql, apache 
> > 
> > Program versions: 
> > django 1.1.4 
> > localeurl 1.5 (tip version) 
> > 
> > Do you have any Idea? 
>
> It's impossible to say without seeing all your code, but you only get 
> those emails if there is a link on your page that returns a 404. That 
> means that pages on your site are being rendered with  href=".../undefined/"> on them. 
>
> The link may not be in an obvious location -- I'm going to guess that 
> they've been found by a robot that is scraping your site -- but if 
> your getting the emails, you can be fairly certain that the links 
> exist *somewhere*. 
>
> Yours, 
> Russ Magee %-) 
>

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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-28 Thread Melvyn Sopacua
On 27-6-2012 18:37, ferran wrote:

> In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL link" 
> how this:
> 
> "
> Referrer: http://www.marquezshop.com/es/catalogo/sales/
> Requested URL: /es/catalogo/sales/undefined/
^
That's javascript, not python doing that. Python would be 'None'. So
check your javascript code for Google Chrome compliance.

-- 
Melvyn Sopacua


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



Re: many "Broken INTERNAL link" with end string "/undefined/"

2012-06-27 Thread Russell Keith-Magee
On Thu, Jun 28, 2012 at 12:37 AM, ferran <pinksh...@gmail.com> wrote:
> Hello django users,
>
> In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL link"
> how this:
>
> "
> Referrer: http://www.marquezshop.com/es/catalogo/sales/
> Requested URL: /es/catalogo/sales/undefined/
> User agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like
> Gecko) Chrome/19.0.1084.56 Safari/536.5
> IP address: ---
> "
> or
>
> "
> Referrer:
> http://www.marquezshop.com/es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/
> Requested URL:
> /es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/undefined/
> User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like
> Gecko) Chrome/12.0.742.122 Safari/534.30
> IP address: 
> "
>
> The pattern from requested URL can be any, but, always have a end string
> "/undefined/"
>
> I'm not update the code, but update, nginx, mysql, apache
>
> Program versions:
> django 1.1.4
> localeurl 1.5 (tip version)
>
> Do you have any Idea?

It's impossible to say without seeing all your code, but you only get
those emails if there is a link on your page that returns a 404. That
means that pages on your site are being rendered with  on them.

The link may not be in an obvious location -- I'm going to guess that
they've been found by a robot that is scraping your site -- but if
your getting the emails, you can be fairly certain that the links
exist *somewhere*.

Yours,
Russ Magee %-)

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



many "Broken INTERNAL link" with end string "/undefined/"

2012-06-27 Thread ferran
Hello django users,

In the last 3 weeks I'm receiving in my email a many "Broken INTERNAL link" 
how this:

"
Referrer: http://www.marquezshop.com/es/catalogo/sales/
Requested URL: /es/catalogo/sales/undefined/
User agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like 
Gecko) Chrome/19.0.1084.56 Safari/536.5
IP address: ---
"
or

"
Referrer: 
http://www.marquezshop.com/es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/
Requested URL: 
/es/catalogo/sales/sal-compactada-en-pastillas-piscinas-salnet.html/undefined/
User agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like 
Gecko) Chrome/12.0.742.122 Safari/534.30
IP address: 
"

The pattern from requested URL can be any, but, always have a end string 
"/undefined/"

I'm not update the code, but update, nginx, mysql, apache

Program versions:
django 1.1.4
localeurl 1.5 (tip version)

Do you have any Idea?

Thanks in advanced
Ferran




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



Broken INTERNAL link error emails on flat pages.

2012-03-23 Thread Arek
This is my first post here so hello everybody.

when SEND_BROKEN_LINK_EMAILS=True, every time flat page is visited
django-1.3.1 sends emails like this:

Referrer: http://example.com/
Requested URL: /contact/
User agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; 
.NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 
3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)
IP address: 11.22.333.444

anyone knows how to fix this? 

Cheers,
Arek





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



Re: Website Documentation Search broken?

2011-12-18 Thread kenneth gonsalves
On Sat, 2011-12-17 at 12:51 -0600, Jacob Kaplan-Moss wrote:
> On Sat, Dec 17, 2011 at 12:30 AM, kenneth gonsalves
>  wrote:
> > thanks for the info - the search *has* improved, for example a
> search
> > for get_FOO_display used to fail, it now succeeds. But I still need
> > ddg's site search for multiword searches.
> 
> Can you be a bit more specific? If there's a bug I'd like to fix it,
> but I'm not having any issues with "multiword searches"; for example:
> 
> 
https://docs.djangoproject.com/search/?q=typed+choice+field=5
https://docs.djangoproject.com/search/?q=choices+display=5

what happens here is that the search returns all the results for each
individual word - not the combination of words. Compare with ddg:

http://duckduckgo.com/?q=site%3Adocs.djangoproject.com+typed+choice
+field
http://duckduckgo.com/?q=site%3Adocs.djangoproject.com+choices+display

-- 
regards
Kenneth Gonsalves

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



Re: Website Documentation Search broken?

2011-12-17 Thread Jacob Kaplan-Moss
On Sat, Dec 17, 2011 at 12:30 AM, kenneth gonsalves
 wrote:
> thanks for the info - the search *has* improved, for example a search
> for get_FOO_display used to fail, it now succeeds. But I still need
> ddg's site search for multiword searches.

Can you be a bit more specific? If there's a bug I'd like to fix it,
but I'm not having any issues with "multiword searches"; for example:

* https://docs.djangoproject.com/search/?q=form+wizard=5
* https://docs.djangoproject.com/search/?q=auth+middleware=5
* https://docs.djangoproject.com/search/?q=database+routers=5

Jacob

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



Re: Website Documentation Search broken?

2011-12-16 Thread kenneth gonsalves
On Thu, 2011-12-15 at 08:30 -0600, Jacob Kaplan-Moss wrote:
> On Wed, Dec 14, 2011 at 8:36 PM, kenneth gonsalves
>  wrote:
> > it is using the default sphinx search which is limited to one word
> > searches.
> 
> That's true of the documentation you build locally, but the search on
> docs.djangoproject.com uses Haystack with the Xapian search engine.
> It's a proper search engine -- just not tuned perfectly. 

thanks for the info - the search *has* improved, for example a search
for get_FOO_display used to fail, it now succeeds. But I still need
ddg's site search for multiword searches.
-- 
regards
Kenneth Gonsalves

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



Re: Website Documentation Search broken?

2011-12-15 Thread Jacob Kaplan-Moss
On Wed, Dec 14, 2011 at 8:36 PM, kenneth gonsalves
 wrote:
> it is using the default sphinx search which is limited to one word
> searches.

That's true of the documentation you build locally, but the search on
docs.djangoproject.com uses Haystack with the Xapian search engine.
It's a proper search engine -- just not tuned perfectly.

Jacob

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



Re: Website Documentation Search broken?

2011-12-14 Thread kenneth gonsalves
On Wed, 2011-12-14 at 08:01 -0800, creecode wrote:
> I can't say for sure but for some time it seems to me that searching
> has become more difficult.  I can't put my finger on any specifics.  I
> have found that some phrases that are in my browser form field cache
> I've used in that past no longer return results.  And I'm almost
> certain some of them were previously successful.

it is using the default sphinx search which is limited to one word
searches.
-- 
regards
Kenneth Gonsalves

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



Re: Website Documentation Search broken?

2011-12-14 Thread creecode
Hello Jacob,

On Wednesday, December 14, 2011 10:14:10 AM UTC-8, Jacob Kaplan-Moss wrote:
>
>
> Ugh, I'm sorry. If you take some notes on what those searches are --
> which ones aren't returning results you'd expect -- and let me know I
> can tweak it.
>
No problem man, it's just good to know that something has changed and now I 
can be more attentive next time I notice a problem! :-)

Thanks,

creecode 

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



Re: Website Documentation Search broken?

2011-12-14 Thread Jacob Kaplan-Moss
On Wed, Dec 14, 2011 at 10:21 AM, Torsten Bronger
 wrote:
> creecode writes:
>
>> I can't say for sure but for some time it seems to me that
>> searching has become more difficult.  I can't put my finger on any
>> specifics.  I have found that some phrases that are in my browser
>> form field cache I've used in that past no longer return results.
>> And I'm almost certain some of them were previously successful.

Ugh, I'm sorry. If you take some notes on what those searches are --
which ones aren't returning results you'd expect -- and let me know I
can tweak it.

> I *think* (though I'm really not sure) that the search used to work
> through Google.  Be that as it may, it used to be significantly
> better.  Were there legal problems with the old search?

No, not legal problems; technical -- I had all sorts of problems with
Google's search. You can't tweak it at all -- if you don't like what
you get, tough. It also would go down from time to time, and there was
never any help, ETAs, or info about when it'd be back up. Since it
works off a spider it'd pick up stuff that isn't content -- searching
for "documentation", for example, was useless since that word appears
in the nav. I could go on, but basically Google's search was a PITA.

So I may have taken a step backwards switching away from Google, but
now the control is in our hands -- we can tweak, tune, and otherwise
make it work better. If you want to help, see
https://github.com/django/djangoproject.com and look in
django_website/docs; it's built using Haystack.

> If I searched for "queryset api", the first result was, well, the
> QuerySet API.  Now, it is the fifth.  With just "queryset", it is
> even position 9.

Thank - I'll look into that particular search and see if I can boost
the right document to the top. If you find more like that drop a list
into this thread and I'll take a look.

Jacob

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



Re: Website Documentation Search broken?

2011-12-14 Thread Torsten Bronger
Hallöchen!

creecode writes:

> I can't say for sure but for some time it seems to me that
> searching has become more difficult.  I can't put my finger on any
> specifics.  I have found that some phrases that are in my browser
> form field cache I've used in that past no longer return results.
> And I'm almost certain some of them were previously successful.

I *think* (though I'm really not sure) that the search used to work
through Google.  Be that as it may, it used to be significantly
better.  Were there legal problems with the old search?

If I searched for "queryset api", the first result was, well, the
QuerySet API.  Now, it is the fifth.  With just "queryset", it is
even position 9.

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Website Documentation Search broken?

2011-12-14 Thread creecode
Hello all,

I can't say for sure but for some time it seems to me that searching has 
become more difficult.  I can't put my finger on any specifics.  I have 
found that some phrases that are in my browser form field cache I've used 
in that past no longer return results.  And I'm almost certain some of them 
were previously successful.

I thought that perhaps it was just me remembering wrong but now, maybe, 
there really is a problem.

Folks, chime in if you've had a feeling the search hasn't been working as 
well as before.

Toodle-looo...
creecode

-- 
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/-/2hvk9cLBiy8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Website Documentation Search broken?

2011-12-14 Thread Thomas Guettler

Ignore it, this morning even a single word search had no results. Now it works. 
All is fine

  Thomas

On 14.12.2011 10:55, kenneth gonsalves wrote:

On Wed, 2011-12-14 at 10:02 +0100, Thomas Guettler wrote:

is the search on https://docs.djangoproject.com/en/1.3/ broken, or is
it just me,
getting no results?


afaik search on multiple terms has not been working for a long time:

compare
https://docs.djangoproject.com/search/?q=typed+choice+field=5

with

http://duckduckgo.com/?q=site%3Adocs.djangoproject.com+typed+choice
+field


--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

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



Re: Website Documentation Search broken?

2011-12-14 Thread kenneth gonsalves
On Wed, 2011-12-14 at 10:02 +0100, Thomas Guettler wrote:
> is the search on https://docs.djangoproject.com/en/1.3/ broken, or is
> it just me,
> getting no results? 

afaik search on multiple terms has not been working for a long time:

compare
https://docs.djangoproject.com/search/?q=typed+choice+field=5

with

http://duckduckgo.com/?q=site%3Adocs.djangoproject.com+typed+choice
+field
-- 
regards
Kenneth Gonsalves

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



Website Documentation Search broken?

2011-12-14 Thread Thomas Guettler

Hi,

is the search on https://docs.djangoproject.com/en/1.3/ broken, or is it just 
me,
getting no results?

  Thomas

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

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



Nesting spatial filters with the __in filter will be broken until I buy you a beer.

2011-12-05 Thread jpk
Hi all,

I've recently been using the __in filter, and it's pretty nifty.
However, it seems that nesting any of geodjango's spatial filters with
the __in filter is busted.  This ticket:
https://code.djangoproject.com/ticket/17314 explains the behavior in
detail, but the précis is: "things =
Thing.objects.filter(point_field__contained=Polygon(...))" followed by
"other_things = OtherThing.objects.filter(thing__in=things)" results
in the sql compiler blowing up when the query for other_things is
supposed run.

This is a major pain in two apps I'm working on, and I'll sponsor
patches with things including but not limited to:
 * Free beer
 * Homemade cupcakes
 * Hugs

Or, if you have the inhuman inclination to refuse the aforementioned
bribery, I can probably fix the issue with some direction (which would
still be met with considerable gratitude).

Thanks,
jpk

-- 


John P. Kiffmeyer
Email/XMPP: j...@thekiffmeyer.org

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



Minimal change broken my csrf validation.

2011-09-05 Thread Yaşar Arabacı
Can you please take a look at here:
http://stackoverflow.com/q/7312029/886669

-- 
http://yasar.serveblog.net/

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



Re: Broken INTERNAL links related to django.contrib.auth

2011-07-31 Thread Russell Keith-Magee
On Mon, Aug 1, 2011 at 1:23 AM, ivan.o...@googlemail.com
<ivan.o...@googlemail.com> wrote:
> I get a lot of 'broken internal links' mails daily from a Django
> application I
> am hacking: http://grical.org
>
> They look like this::
>
>    Referrer: http://grical.org/accounts/login/e/show/580/
>    Requested URL: /accounts/login/e/show/
> 580/
>    User agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
> TheFreeDictionary.com; .NET CLR 1.1.4322; .NET CLR 1.0.3705;    .NET
> CLR
> 2.0.50727)
>    IP address: ...
>
> Any idea where can be the problem?

There isn't necessarily a problem anywhere. All this tells you is that
someone, somewhere is requesting a URL that doesn't match a URL
pattern on your site.

The simplest possible cause of this is a dead link on a page -- in
your case, somewhere on the page served by the URL
/accounts/login/e/show/, there is a link that directs the user to
/accounts/login/e/show/580, but that link doesn't resolve. For
whatever reason, people are clicking on that link, so you're getting
notified that there is a problem.

However, it's also possible that this isn't a problem at all. The
internet is filled with lots of robots that wander around; some are
indexing content for search engines (like the GoogleBot); but some are
people probing your site for known security holes. These malicious
robots will frequently construct URLs that don't exist on your site in
an attempt to exploit bugs in the URL handling mechanisms for various
frameworks. There isn't much you can do to stop these people. A
robots.txt file will stop the well behaved robots at the cost of you
losing search engine rank; script kiddie robots don't obey robots.txt.
If you can validate that the link appearing in your log definitely
doesn't exist, and shouldn't exist, and isn't referenced anywhere on
your site, all you can really do here is try and mask these entries
out of your logs.

Yours,
Russ Magee %-)

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



Broken INTERNAL links related to django.contrib.auth

2011-07-31 Thread ivan.o...@googlemail.com
I get a lot of 'broken internal links' mails daily from a Django
application I
am hacking: http://grical.org

They look like this::

Referrer: http://grical.org/accounts/login/e/show/580/
Requested URL: /accounts/login/e/show/
580/
User agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
TheFreeDictionary.com; .NET CLR 1.1.4322; .NET CLR 1.0.3705;.NET
CLR
2.0.50727)
IP address: ...

Any idea where can be the problem?

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



"This URL appears to be a broken link."

2011-07-29 Thread javatina
It seems that verify_exists=True as in URLField([verify_exists=True,
max_length=200, **options]) has problems (1.3; 2.7). For example, this
site is just fine
http://www.rydex-sgi.com/

However, validation reports "This URL appears to be a broken link."
This URL  http://www.rydexsgi.com/ appears to be OK - in reality it is
redirected to http://www.rydex-sgi.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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django site broken after Debian upgrade

2011-07-19 Thread Andre Terra
Glad you got it figured out, after all!

Unfortunately, the django book is indeed lacking a serious update. The
official docs are still the go-to place for learning how to use django.

Users in this list have been active in writing new pages to the official
Wiki, but there's also a huge void in terms of how-tos and tutorials on that
media.

For now, what I will recommend is that you ask around in #django (
irc.freenode.net), here on django-users and on Stack Overflow (SO). FWIW, I
think SO is flooded with questions about third-party apps, so I don't go
there often to answer questions, as I have virtually no experience in said
apps.

However, if the questions you post to this list come with the right tone and
a decent explanation of the issues you are encountering, most of us will be
glad to jump in and lend a hand.

https://code.djangoproject.com/wiki/UsingTheMailingList



Sincerely,
André Terra

On Tue, Jul 19, 2011 at 10:24 AM, bkline  wrote:

> On Jul 19, 8:33 am, bkline  wrote:
>
> > Thanks for the tip, Andre.  I'll keep digging and see if I can
> > extricate myself from this mess.
>
> Bingo!  That was the problem.  After clearing out the offending copied
> admin templates I was able to restore the CSRF code and I'm back on
> the road again.
>
> Thanks again.  I'm glad I won't have to ditch Django.  I like the
> interface it provides better than anything I could have rolled myself.
>
> As a side note, I'm guessing that turning to the "newer" version of
> The Django Book won't do me much good, as the dates on the chapter
> list seem to indicate that nothing has been done since the spring of
> 2009, and the book is incomplete (and out of date).
>
> Bob
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Django site broken after Debian upgrade

2011-07-19 Thread bkline
On Jul 19, 8:33 am, bkline  wrote:

> Thanks for the tip, Andre.  I'll keep digging and see if I can
> extricate myself from this mess.

Bingo!  That was the problem.  After clearing out the offending copied
admin templates I was able to restore the CSRF code and I'm back on
the road again.

Thanks again.  I'm glad I won't have to ditch Django.  I like the
interface it provides better than anything I could have rolled myself.

As a side note, I'm guessing that turning to the "newer" version of
The Django Book won't do me much good, as the dates on the chapter
list seem to indicate that nothing has been done since the spring of
2009, and the book is incomplete (and out of date).

Bob

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



  1   2   3   >