Re: serve static files

2013-08-26 Thread Jani Tiainen
If you're using contrib.staticfiles app, your DEBUG is True and you're using 
runserver django automagically maps (overrides) your staticfile serving.

If you want to manually add staticfile serving, you have to give --nostatic 
parameter to runserver to omit all magic that happena automatically.


On Mon, 26 Aug 2013 07:58:38 -0700 (PDT)
Wesley Ni  wrote:

> I hit an issue when trying serve static files.
> 
> In settings, debug is True, and with the followinig:
> STATIC_ROOT = os.path.join(freelancer_path,"staticfiles")
> STATIC_URL = '/staticfiles/'
> 
> urls.py:
> (r'^staticfiles/(?P.*)$','django.contrib.staticfiles.views.serve',
> {'document_root' : STATIC_ROOT,'show_indexes' : True}),
> 
> Problem is, when accessing http://127.0.0.1:8000/staticfiles/, I got this:
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/staticfiles/
> 
> Why? I thought I would get folder indexes because I set show_indexes to 
> True.
> 
> And, later, I find that, if I set the url pattern prefix not same to 
> STATIC_URL, 
> say, maybe :
> (r'^files/(?P.*)$','django.contrib.staticfiles.views.serve',
> {'document_root' : STATIC_ROOT,'show_indexes' : True}),
> And, then, http://127.0.0.1:8000/files/ is OK to show folder lists.
> 
> Could anyone help explain and fix?
> 
> Thanks.
> Wesley
> 
> -- 
> 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.

-- 

Jani Tiainen

-- 
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: Template variables in translation blocks

2013-08-26 Thread Some Developer

On 24/08/13 14:56, Ariel Calzada wrote:

you have to append strings first

http://stackoverflow.com/questions/4386168/how-to-concatenate-strings-in-django-templates

and then call trans



2013/8/24 Some Developer >

I have a title and a header block which normally contain static text
but for some pages I need to display some dynamic information
contained in a template variable.

So I might have the template variable: {{ app.name  }}

and the block code:

{% block title %}
 {% trans "{{ app.name  }} Information" %}
{% endblock %}

Obviously this doesn't work. What is the correct way to solve this
issue? I've done it in the past but I can't for the life of me
remember how.


This was actually significantly easier than described above. The 
following works just fine and is much simpler than having to deal with 
string concatenation in templates.


{% blocktrans with app_name=app.name %}
Edit {{ app_name }}
{% endblocktrans %}

--
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.


Paginating YouTube API results

2013-08-26 Thread Sithembewena Lloyd Dube
Hi everyone,

I am using django-endless-pagination to paginate YouTube API results. I
have a view called 'search' and a url pattern as follows:
url(r'^search/$', 'find_music.views.search', name='search'),

In the view, I check request.method and handle it as follows:
- if POST, get search term and fetch youtube api results as list, which i
paginate in template
- if GET (user clicks pagination, url e.g. '/search/?page=2'), i look for
request.GET['page'] , which I would like to use to paginate my video list
created in the POST.

Question is, how best can i keep my video list from the POST method across
requests, so that i can paginate the same list? I have no search params
when users paginate, so I need to keep the original list and paginate that.
Any ideas?

Thank you.

-- 
Regards,
Sithu Lloyd Dube

-- 
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: serve static files

2013-08-26 Thread Wesley Ni
Sorry but it still doesn't work.

http://stackoverflow.com/questions/4730716/django-static-files-problem Here 
also mentioned the issue that pattern conflicts with STATIC_URL.

在 2013年8月26日星期一UTC-4下午1时28分42秒,mantaszilinskis写道:
>
> import settings
> instead of 'document_root' : STATIC_ROOT, try 'document_root' : 
> settings.STATIC_ROOT,
>
>
> On Mon, Aug 26, 2013 at 10:05 AM, Wesley Ni  > wrote:
>
>> Forget to say that I use Django 1.5.2
>>
>> 在 2013年8月26日星期一UTC-4上午10时58分38秒,Wesley Ni写道:
>>
>>> I hit an issue when trying serve static files.
>>>
>>> In settings, debug is True, and with the followinig:
>>> STATIC_ROOT = os.path.join(freelancer_path,"**staticfiles")
>>> STATIC_URL = '/staticfiles/'
>>>
>>> urls.py:
>>> (r'^staticfiles/(?P.*)$'**,'django.contrib.staticfiles.**
>>> views.serve',
>>> {'document_root' : STATIC_ROOT,'show_indexes' : True}),
>>>
>>> Problem is, when accessing 
>>> http://127.0.0.1:8000/**staticfiles/, 
>>> I got this:
>>> Page not found (404)
>>> Request Method: GET
>>> Request URL: 
>>> http://127.0.0.1:8000/**staticfiles/
>>>
>>> Why? I thought I would get folder indexes because I set show_indexes to 
>>> True.
>>>
>>> And, later, I find that, if I set the url pattern prefix not same to 
>>> STATIC_URL, 
>>> say, maybe :
>>> (r'^files/(?P.*)$','**django.contrib.staticfiles.**views.serve',
>>> {'document_root' : STATIC_ROOT,'show_indexes' : True}),
>>> And, then, http://127.0.0.1:8000/files/ is OK to show folder lists.
>>>
>>> Could anyone help explain and fix?
>>>
>>> Thanks.
>>> Wesley
>>>
>>  -- 
>> 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.
>> 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.


Re: syncdb issue (begginer stuff)

2013-08-26 Thread Andre Terra
On Mon, Aug 26, 2013 at 1:19 PM, Natko Perko  wrote:

> @laurent i guess it worked, but now i get the error no module named
> wikicamp.wiki.. this is all the code i have so far..


make sure the folder containing wikicamp is inside your PATH so you don't
get import errors. make sure there's an __init__.py inside it.

perhaps you could debug the import error like this:

$ ./manage.py shell
>>> import sys
>>> print '\n'.join(sys.path)
>>> import wikicamp
>>> from wikicamp import wiki


In the future, please post an entire traceback along with your question.

Cheers,
AT

-- 
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: problem: returning date, it is different from the date stored in the database

2013-08-26 Thread raul salinas
*ooh yes!  the solution :*
*
*
*USE_TZ=False*  # By default you are in True

El lunes, 26 de agosto de 2013 15:56:41 UTC-5, raul salinas escribió:
>
> greetings here is a my problem with time date display either the admin or 
> a template, it is different from the date stored in the database
> models.py
>
> class subsystem (models.Model):
>
>  setting = models.CharField (max_length = 200)
>  date = models.DateTimeField (default = datetime.now)
>  description = models.TextField (max_length = 300, null = True, blank 
> = True)
>  status = models.BooleanField (default = True)
>
>  def __ unicode__ (self):
>  return "% s% s"% (self.establecimiento, self.fecha.strftime ("% 
> b% d,% Y,% I:% M% p"))
>
> stored data very well what I see in the admin
> miestablecimiento Aug 26, 2013, 8:19 PM
>
> the date is correct but the time is not what is stored more minutes alone 
> time is different
> been looking without success zone even with the evidence that I'm still 
> reviewing
>
> any ideas???
>

-- 
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.


problem: returning date, it is different from the date stored in the database

2013-08-26 Thread raul salinas
greetings here is a my problem with time date display either the admin or a 
template, it is different from the date stored in the database
models.py

class subsystem (models.Model):

 setting = models.CharField (max_length = 200)
 date = models.DateTimeField (default = datetime.now)
 description = models.TextField (max_length = 300, null = True, blank = 
True)
 status = models.BooleanField (default = True)

 def __ unicode__ (self):
 return "% s% s"% (self.establecimiento, self.fecha.strftime ("% b% 
d,% Y,% I:% M% p"))

stored data very well what I see in the admin
miestablecimiento Aug 26, 2013, 8:19 PM

the date is correct but the time is not what is stored more minutes alone 
time is different
been looking without success zone even with the evidence that I'm still 
reviewing

any ideas???

-- 
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: [View Django] Problem with view that makes add and update

2013-08-26 Thread C. Kirby
Have you verified that the url being called has a music_id?

On Monday, August 26, 2013 10:40:52 AM UTC-5, Marcos Luiz Wilhelm wrote:
>
> Hello!
> I'm having problems with a view that makes add and update
> The view generates a new record rather than change a instance.
> My code is this: http://pastebin.com/rZNAeN0p
> Someone can help me please?
>

-- 
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: syncdb issue (begginer stuff)

2013-08-26 Thread Natko Perko
@laurent i guess it worked, but now i get the error no module named 
wikicamp.wiki.. this is all the code i have so far..

from django.db import models

# Create your models here.

class Page(models.Model):
name = models.CharField(maxlength="20", primary_key=True)
content = models.TextField(blank=True)

   
:wq

@mantaszilinskis   thx for the links, gonna check them 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.


Re: serve static files

2013-08-26 Thread Mantas Zilinskis
import settings
instead of 'document_root' : STATIC_ROOT, try 'document_root' :
settings.STATIC_ROOT,


On Mon, Aug 26, 2013 at 10:05 AM, Wesley Ni  wrote:

> Forget to say that I use Django 1.5.2
>
> 在 2013年8月26日星期一UTC-4上午10时58分38秒,Wesley Ni写道:
>
>> I hit an issue when trying serve static files.
>>
>> In settings, debug is True, and with the followinig:
>> STATIC_ROOT = os.path.join(freelancer_path,"**staticfiles")
>> STATIC_URL = '/staticfiles/'
>>
>> urls.py:
>> (r'^staticfiles/(?P.*)$'**,'django.contrib.staticfiles.**
>> views.serve',
>> {'document_root' : STATIC_ROOT,'show_indexes' : True}),
>>
>> Problem is, when accessing 
>> http://127.0.0.1:8000/**staticfiles/,
>> I got this:
>> Page not found (404)
>> Request Method: GET
>> Request URL: 
>> http://127.0.0.1:8000/**staticfiles/
>>
>> Why? I thought I would get folder indexes because I set show_indexes to
>> True.
>>
>> And, later, I find that, if I set the url pattern prefix not same to
>> STATIC_URL,
>> say, maybe :
>> (r'^files/(?P.*)$','**django.contrib.staticfiles.**views.serve',
>> {'document_root' : STATIC_ROOT,'show_indexes' : True}),
>> And, then, http://127.0.0.1:8000/files/ is OK to show folder lists.
>>
>> Could anyone help explain and fix?
>>
>> Thanks.
>> Wesley
>>
>  --
> 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.


Re: [] error

2013-08-26 Thread Charly Román
Have you definded __unicode__ method in model?


2013/8/26 Apokalyptica Painkiller 

> Patrick if you want to show us your code use: http://pastebin.com/
>
>
> 2013/8/26 Ramiro Morales 
>
>> On Mon, Aug 26, 2013 at 11:17 AM, Patrick Larmann
>>  wrote:
>> > Hello guys I am following the django docs tutorial part 1 and am having
>> > trouble moving on. Instead of receiving [] i get
>> [> > Poll object>]. I have tried converting the unicode to str but to no
>> avail. I
>> > am just trying to move on. THx guys.
>>
>> This is the third post in which you've posted screen shots of the errors
>> you get.
>>
>> Please don't do that. Copy and paste the error text including the
>> traceback
>> i.e. the content if the lower panel in you IDE.
>>
>> In this particular case you've attached a file named 'python
>> models.py' but with contents
>> that seem to be a PNG file. And I can't open it (the image viewer
>> reports it is corrupt).
>>
>> Also, make sur you report the versions of Django and Python you are using.
>>
>> --
>> Ramiro Morales
>> @ramiromorales
>>
>> --
>> 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.
>>
>
>
>
> --
> I live each day
> Like it's my last
> I live for rock and roll
> I never look back
>
> I'm a rocker
> Do as I feel as I say
> I'm a rocker
> And no one can take that away
>
>  --
> 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.


Re: Passing variables to css file in django

2013-08-26 Thread Chris Lawlor
The simplest solution is probably to keep all of the CSS that users can't 
customize in an external file (to be served as a static asset), but move 
anything that's user customizable to the  of your base template, in a 

Re: sandbox/ Saap to start using django

2013-08-26 Thread Javier Guerra Giraldez
On Mon, Aug 26, 2013 at 5:34 AM, Renato Pontefice
 wrote:
> I would start to learn it. I would start to use in a shared environment


while developing (or learning), you don't need a deployment
environment.  if you have a working Python interpreter in your
machine, just do "python ./manage.py runserver" to run the development
server.

later on, you would need to push the developed project to a real
server.  that's when you have to check your deployment options.

-- 
Javier

-- 
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.


[View Django] Problem with view that makes add and update

2013-08-26 Thread Marcos Luiz Wilhelm
Hello!
I'm having problems with a view that makes add and update
The view generates a new record rather than change a instance.
My code is this: http://pastebin.com/rZNAeN0p
Someone can help me please?

-- 
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.


serve static files

2013-08-26 Thread Wesley Ni
I hit an issue when trying serve static files.

In settings, debug is True, and with the followinig:
STATIC_ROOT = os.path.join(freelancer_path,"staticfiles")
STATIC_URL = '/staticfiles/'

urls.py:
(r'^staticfiles/(?P.*)$','django.contrib.staticfiles.views.serve',
{'document_root' : STATIC_ROOT,'show_indexes' : True}),

Problem is, when accessing http://127.0.0.1:8000/staticfiles/, I got this:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/staticfiles/

Why? I thought I would get folder indexes because I set show_indexes to 
True.

And, later, I find that, if I set the url pattern prefix not same to 
STATIC_URL, 
say, maybe :
(r'^files/(?P.*)$','django.contrib.staticfiles.views.serve',
{'document_root' : STATIC_ROOT,'show_indexes' : True}),
And, then, http://127.0.0.1:8000/files/ is OK to show folder lists.

Could anyone help explain and fix?

Thanks.
Wesley

-- 
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: serve static files

2013-08-26 Thread Wesley Ni
Forget to say that I use Django 1.5.2

在 2013年8月26日星期一UTC-4上午10时58分38秒,Wesley Ni写道:
>
> I hit an issue when trying serve static files.
>
> In settings, debug is True, and with the followinig:
> STATIC_ROOT = os.path.join(freelancer_path,"staticfiles")
> STATIC_URL = '/staticfiles/'
>
> urls.py:
> (r'^staticfiles/(?P.*)$','django.contrib.staticfiles.views.serve',
> {'document_root' : STATIC_ROOT,'show_indexes' : True}),
>
> Problem is, when accessing http://127.0.0.1:8000/staticfiles/, I got this:
> Page not found (404)
> Request Method: GET
> Request URL: http://127.0.0.1:8000/staticfiles/
>
> Why? I thought I would get folder indexes because I set show_indexes to 
> True.
>
> And, later, I find that, if I set the url pattern prefix not same to 
> STATIC_URL, 
> say, maybe :
> (r'^files/(?P.*)$','django.contrib.staticfiles.views.serve',
> {'document_root' : STATIC_ROOT,'show_indexes' : True}),
> And, then, http://127.0.0.1:8000/files/ is OK to show folder lists.
>
> Could anyone help explain and fix?
>
> Thanks.
> Wesley
>

-- 
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: [] error

2013-08-26 Thread Ramiro Morales
On Mon, Aug 26, 2013 at 11:17 AM, Patrick Larmann
 wrote:
> Hello guys I am following the django docs tutorial part 1 and am having
> trouble moving on. Instead of receiving [] i get   [ Poll object>]. I have tried converting the unicode to str but to no avail. I
> am just trying to move on. THx guys.

This is the third post in which you've posted screen shots of the errors
you get.

Please don't do that. Copy and paste the error text including the traceback
i.e. the content if the lower panel in you IDE.

In this particular case you've attached a file named 'python
models.py' but with contents
that seem to be a PNG file. And I can't open it (the image viewer
reports it is corrupt).

Also, make sur you report the versions of Django and Python you are using.

-- 
Ramiro Morales
@ramiromorales

-- 
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: [] error

2013-08-26 Thread Apokalyptica Painkiller
Patrick if you want to show us your code use: http://pastebin.com/


2013/8/26 Ramiro Morales 

> On Mon, Aug 26, 2013 at 11:17 AM, Patrick Larmann
>  wrote:
> > Hello guys I am following the django docs tutorial part 1 and am having
> > trouble moving on. Instead of receiving [] i get
> [ > Poll object>]. I have tried converting the unicode to str but to no
> avail. I
> > am just trying to move on. THx guys.
>
> This is the third post in which you've posted screen shots of the errors
> you get.
>
> Please don't do that. Copy and paste the error text including the traceback
> i.e. the content if the lower panel in you IDE.
>
> In this particular case you've attached a file named 'python
> models.py' but with contents
> that seem to be a PNG file. And I can't open it (the image viewer
> reports it is corrupt).
>
> Also, make sur you report the versions of Django and Python you are using.
>
> --
> Ramiro Morales
> @ramiromorales
>
> --
> 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.
>



-- 
I live each day
Like it's my last
I live for rock and roll
I never look back

I'm a rocker
Do as I feel as I say
I'm a rocker
And no one can take that away

-- 
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: [] error

2013-08-26 Thread Apokalyptica Painkiller
Hi Patrick, why don't you try to re write that sentence again? May be you
write it wrong. I remembered had same error.

I wanted to see your code from models.py but it seems to have nothing in it.


2013/8/26 Robin Lery 

> You gave the .pyc file.
>
>
> On Mon, Aug 26, 2013 at 7:47 PM, Patrick Larmann <
> rails4product...@gmail.com> wrote:
>
>> Hello guys I am following the django docs tutorial part 1 and am having
>> trouble moving on. Instead of receiving [] i get   [> Poll object>]. I have tried converting the unicode to str but to no avail.
>> I am just trying to move on. THx guys.
>>
>> --
>> 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.
>



-- 
I live each day
Like it's my last
I live for rock and roll
I never look back

I'm a rocker
Do as I feel as I say
I'm a rocker
And no one can take that away

-- 
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: syncdb issue (begginer stuff)

2013-08-26 Thread Mantas Zilinskis
for your environment:
you should definitely look into this
http://www.jeffknupp.com/blog/2012/02/09/starting-a-django-project-the-right-way/

 if you're using mac also this
http://hackercodex.com/guide/python-virtualenv-on-mac-osx-mountain-lion-10.8/

setup your settings.py
http://www.rdegges.com/the-perfect-django-settings-file/

then work your way through tutorials

one more thing you should start with is writing your tests
http://www.youtube.com/watch?v=WfyoC0h9QKA


On Mon, Aug 26, 2013 at 8:53 AM, Laurent Meunier wrote:

> On 26/08/2013 14:34, Natko Perko wrote:
>
>> Hi out there,
>>
>> I just dove into Django (literally) and had so many issues installing it
>> and knowing where to start from that I don't even know how I made it
>> this far, so i finally started working on a project by mimicing this
>> tutorial 
>> http://showmedo.com/**videotutorials/video?name=**110.
>> Well id
>> didnt last for long since I already got stuck at 3:40 when the gentleman
>> is syncing his db. this is what I get If any1 knows a good video
>> tutorial for dummies please share with me cuz im desperate. Thx for
>> reading..
>>
>
> Hi,
>
> What is the value of DATABASES['default']['ENGINE'] in your settings.py?
>
> I think you have entered only 'sqlite3', but django wants you to enter the
> full path to the module (ie: 'django.db.backends.sqlite3').
>
>
> Best regards,
> --
> Laurent Meunier 
>
> --
> 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+unsubscribe@**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.


Re: [] error

2013-08-26 Thread Robin Lery
You gave the .pyc file.


On Mon, Aug 26, 2013 at 7:47 PM, Patrick Larmann  wrote:

> Hello guys I am following the django docs tutorial part 1 and am having
> trouble moving on. Instead of receiving [] i get   [ Poll object>]. I have tried converting the unicode to str but to no avail.
> I am just trying to move on. THx guys.
>
> --
> 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.


Re: syncdb issue (begginer stuff)

2013-08-26 Thread Laurent Meunier

On 26/08/2013 14:34, Natko Perko wrote:

Hi out there,

I just dove into Django (literally) and had so many issues installing it
and knowing where to start from that I don't even know how I made it
this far, so i finally started working on a project by mimicing this
tutorial http://showmedo.com/videotutorials/video?name=110. Well id
didnt last for long since I already got stuck at 3:40 when the gentleman
is syncing his db. this is what I get If any1 knows a good video
tutorial for dummies please share with me cuz im desperate. Thx for
reading..


Hi,

What is the value of DATABASES['default']['ENGINE'] in your settings.py?

I think you have entered only 'sqlite3', but django wants you to enter 
the full path to the module (ie: 'django.db.backends.sqlite3').



Best regards,
--
Laurent Meunier 

--
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: how do beginner can...begin

2013-08-26 Thread Derek
I have not done this myself; but I see Heroku provide a quite detailed 
guide to setting up a Django project in their environment:

https://devcenter.heroku.com/articles/django

Maybe try this, and contact their support if it fails...


On Monday, 26 August 2013 11:05:10 UTC+2, Renato Pontefice wrote:
>
> Hi,
> I'm a Django beginner (or, moreover, user that would start with django)
> I know that many doc could be foud onthe web site of django. But, my first 
> first issue, is an indipendent (indipendent from any pc work, house...) 
> installation of django. Or, moreover, a place where i can installa 
> installing django and start to use it.
> I've tried Paas (openshift and heroku) without success (I was unable to 
> install and works there)
>
> Can someone help to find:
> - a sandbox where do I can start dealing with django
> - better: help to start installing in some Paas.
>
> TIA
>
> Renato
>

-- 
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.


how to model a reflexive many to many relationship?

2013-08-26 Thread slim
I'm trying to build an e-learning platform
I have *users (Utilisateur) *who can take several *courses* ,each course 
have several *modules* and a module can be in several courses
a user can be a student or teacher or admin, a student is "managed" by a 
teacher or several and a teacher can also  be managed by a teacher (if he 
is a researcher) ,teachers are managed by admins

this is my conception :



I'm not familiar with many_to_many and through concept, please correct me
 this is my django models :

class Utilisateur(models.Model):
user   = models.OneToOneField(User)
role   = models.CharField(choices=ROLES,blank=False,max_length=50)
managed_by = models.ManyToManyField('self', 
through='UtilisateurRelationship', symmetrical=False, blank=True)


class UtilisateurRelationship(models.Model):
managed = models.ForeignKey(Utilisateur)
manager = models.ForeignKey(Utilisateur)


   
class Course(models.Model):
titre  = models.CharField(blank=False,max_length=100)

class ModuleCourse (models.Model):
module = models.ForeignKey(Module)
course = models.ForeignKey(Course)
order  = models.IntegerField(blank=False)   

class Module(models.Model):
titre = models.CharField(blank=False,max_length=100)
belong_to = models.ManyToManyField(Course, through='ModuleCourse')

class UtilisateurModule (models.Model):
user   = models.ForeignKey(Utilisateur)
module = models.ForeignKey(Module)
score  = models.IntegerField(blank=False)

  

-- 
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 template loop collections.defaultdict(lambda: collections.defaultdict(list))

2013-08-26 Thread Daviddd
I solved in this way:

my_dict = collections.defaultdict(lambda: collections.defaultdict(list))

for obj in queryset:

my_dict[int(obj.position.split('-')[0])][int(obj.position.split('-')[2])].append(obj)

for obj in my_dict:
my_dict[obj].default_factory = None

return Response({'queryset': dict(my_dict)}, 
template_name='_internal_template.html')


{% for groups in queryset.itervalues  %}

groups = {{ groups }}


{% for cols in groups.itervalues  %}

  cols = {{ cols }}
  

  {% for obj in cols  %}

obj = {{ obj}} in 
obj info = {{ obj.title }}, {{ obj.abstract }}

  {% endfor %}  

{% endfor %}
{% endfor %}


Linked question using default_factory: 
http://stackoverflow.com/questions/4764110/django-template-cant-loop-defaultdict

Thanks!

On Monday, August 26, 2013 12:46:30 PM UTC+2, tom wrote:
>
> On Monday, 26 August 2013, Daviddd wrote:
>
>> Sincerely, I don't know how I can create the dict without using 
>> defaultdict.
>>
>> D
>>
>
> You can create it using a defaultdict if you want to, but once it is 
> created, and before you pass it to the template, loop through all the 
> values of your outer dict and coerce them to dicts using dict(). You are 
> already doing this for your outer defaultdict, which is why the first loop 
> works in your template.
>

-- 
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 template loop collections.defaultdict(lambda: collections.defaultdict(list))

2013-08-26 Thread Daviddd


On Friday, August 23, 2013 5:58:38 PM UTC+2, Daviddd wrote:
>
> Dear All,
>
> In my view I create the following dictionary of lists from a queryset
>
> #view.py
> queryset = MyModel.objects.filter(owner=user, 
> dashboard=tab).order_by('position')
> my_dict = collections.defaultdict(lambda: collections.defaultdict(list))
> for obj in queryset:
> 
> my_dict[int(obj.position.split('-')[0])][int(obj.position.split('-')[2])].append(obj)return
>  Response({'queryset': dict(my_dict)}, 
> template_name='dashboard/_maps_tab.html')
>
>
> Position field is a charFiled following the format: X-X-X-X used the 
> create the my_dict
>
> my_dict is
>
> --[1] #group[1] #col 1-- object1.1.1 #group.col.pk-- 
> object1.1.2-- object1.1.3[2] #col 2-- object1.2.4[3] 
> #col3-- object1.3.5-- object1.3.6
> --[2] #group[1] #col 1--object2.1.7 #group.col.pk
> --[3] #group[1] #col1-- object3.1.8 #group.col.pk[2] 
> #col2--object3.2.9--object3.2.10
>
>
> In my template I tried:
>
> {% for key, groups in queryset.iteritems %}
> groups = {{ groups }} 
> {% for group_key, cols in groups.iteritems %}
>   cols = {{ group_key }} 
>   {% for objs in cols %}
>   {# rest of the code #}  
>
>
> But only the first loop is evaluated
>
> groups = (1, defaultdict(, {1: [,  Obj 2 by daviddd>, ], 2: [], 3: 
> [, , ]}))
> groups = (2, defaultdict(, {1: []}))
> groups = (3, defaultdict(, {1: []}))
>
>
> (Linked question: 
> http://stackoverflow.com/questions/18406126/django-template-loop-collections-defaultdictlambda-collections-defaultdictlis
> )
>
> I'm not able to spot the error.
>
> Thanks
>
> 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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django template loop collections.defaultdict(lambda: collections.defaultdict(list))

2013-08-26 Thread Thomas Scrace
On Monday, 26 August 2013, Daviddd wrote:

> Sincerely, I don't know how I can create the dict without using
> defaultdict.
>
> D
>

You can create it using a defaultdict if you want to, but once it is
created, and before you pass it to the template, loop through all the
values of your outer dict and coerce them to dicts using dict(). You are
already doing this for your outer defaultdict, which is why the first loop
works in your template.

-- 
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.


sandbox/ Saap to start using django

2013-08-26 Thread Renato Pontefice
 

Hi, I'm new to Django. I would start to learn it. I would start to use in a 
shared environment (like sandbox, or some Saap...) I've started tryng to 
install it in - openshift - heroku

but without achievement. I already seen the doc on the djago web site, but 
without an environment to try it, it is not god :-(

Can someone give me some tips?

Thank you

Renato

-- 
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.


how do beginner can...begin

2013-08-26 Thread Renato Pontefice
Hi,
I'm a Django beginner (or, moreover, user that would start with django)
I know that many doc could be foud onthe web site of django. But, my first 
first issue, is an indipendent (indipendent from any pc work, house...) 
installation of django. Or, moreover, a place where i can installa 
installing django and start to use it.
I've tried Paas (openshift and heroku) without success (I was unable to 
install and works there)

Can someone help to find:
- a sandbox where do I can start dealing with django
- better: help to start installing in some Paas.

TIA

Renato

-- 
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.


django refreshing problem

2013-08-26 Thread Harjot Mann
In django whenever I make some template I need to refresh it. I am not
getting what is the problem, is it some cache problem, even I disabled
it using never_cache but nothing worked, Is there anyone who faced the
same problem. Please help me I want to know that exactly what is
happening and why?
-- 
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

-- 
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: Problem with translations

2013-08-26 Thread Andreas Kuhne
Has nobody heard of this issue before? It is rather disturbing and means
that our site crashes from time to time for some users.

Regards,

Andréas

2013/8/21 Andreas Kuhne 

> Hi,
>
> I am working on a website that is available in 10 different languages, and
> we have the translations working. If you want to see our website in french,
> you just add /fr to our url and it works fine.
>
> However we are getting a lot of :
>
>   File "middleware.py", line 83, in process_request
> translation.activate(request.locale_dict['language'])
>
>   File "env/lib/python2.6/site-packages/django/utils/translation/__init__.py",
> line 90, in activate
> return _trans.activate(language)
>
>   File 
> "env/lib/python2.6/site-packages/django/utils/translation/trans_real.py",
> line 183, in activate
> _active.value = translation(language)
>
>   File 
> "env/lib/python2.6/site-packages/django/utils/translation/trans_real.py",
> line 173, in translation
> current_translation = _fetch(language, fallback=default_translation)
>
>   File 
> "env/lib/python2.6/site-packages/django/utils/translation/trans_real.py",
> line 141, in _fetch
> res._info = res._info.copy()
>
> AttributeError: 'NoneType' object has no attribute '_info'
>
> These errors mostly occur when the user requests an ajax enabled update.
> As far as I can tell this error is related to the fact that django
> tranlsations can't open the .mo files for the specific locale. What I don't
> understand is that this happens maybe once every 2 days, so it doesn't
> happen all the time.
>
> The only resources I have found on the subject are regarding to completely
> missing .mo translation files (which is not the case here). I am leaning
> towards an issue with apache not being able to open the file, because of
> restrictions on the number of open files allowed, but I'm not sure. Has
> anyone any ideas on how to correct this issue? I should also say that it
> has never happened on our development machines.
>
> Regards,
>
> Andréas
>

-- 
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: html templates and dynamic loading

2013-08-26 Thread Bastien Amiel

Le 24/08/2013 04:44, Mantas Zilinskis a écrit :

this might help you

http://stackoverflow.com/questions/1879872/django-update-div-with-ajax

let me know if you need more help


Thank you for this good pointer.




On Fri, Aug 23, 2013 at 10:51 AM, Bastien Amiel > wrote:


Le 23/08/2013 17:01, Mantas Zilinskis a écrit :

can you post all of chat.html



On Fri, Aug 23, 2013 at 7:04 AM, Bastien Amiel > wrote:

Le 23/08/2013 11:26, Huu Da Tran a écrit :

On Thursday, August 22, 2013 8:42:04 AM UTC-4, Bastien Amiel
wrote:

I need to update the chat when an event come but :

1.
If I update my chat sub page, inputs are reset (seems
logic since html
is recreated).


You can always have some field that keep when the chat was
started (in the session), and redisplay everything since
that time.

Then what would be the good / best method to update only
the chat content ?
(I have 2 ideas but they don't seems very Django'ic)

2.
For now, I update the content every XX ms with a
periodic request client
side.
Would it be possible / preferable to have a push from
server when new
data comes or is there a better way to update this kind
of content ?


Trying to hack django to get server push would be hell (look
into tornado). If you really need server push, you may need
to look into other technologies, like nodejs.

Using the periodic request client-side is what is mostly done.


Hope this helps.

HD.


1.
My question was not clear enough,
Let's admit i have this template page :

/{% for elem in data %}//
////
//{{ elem.datetime }}//
//{{ elem.name 
}} ://
//{{ elem.text }}//
////
//{% endfor %}//
//Text : /

and this view.py :

/def getchat(request)://
//template = loader.get_template('chat.html')//
//context  = RequestContext(request, { 'data': lines
})//# lines is an array with lines
//response = {'html' : template.render(context)}//
//return HttpResponse(json.dumps(response),
mimetype='application/json')/

and this javascript :

/function getchat()//
//{ //
//$.post('/getchat')//.done(function(data, textStatus,
jqXHR) //
//{//
//$("#chat").html(data["html"])//
//})//
//}

/Then whenever I call getchat() in javascript, the chat is
reloaded with all the old lines, this point is ok, but
 field is reseted too, which mean that if user was
typing, the content is erased.
I would say the solution is to create a second function in
view /getchatcontent/ that will send only the content so I do
not
update the whole thing. Do you think it is the right way ?


2.
lets use periodic request client-side.



Thank you for your answer



There is nothing more in chat.html
there is a base.html template that contains

///
//{% load staticfiles %}//






//post//
///


appchat.js


/$(document).ready(function()//
//{//
//$("#addline").click(function()//
//{//
//addline($("#chatname")[0].value,
$("#chatinput")[0].value);//
//$("#chatinput")[0].value = "" //
//})//
//setInterval(function() { getchat() }, 1000);//
//})//
//
//function addline(name, text)//
//{//
//$.post('/addline', {"name":name, "text":text})//
//.done(function() //{//})//
//}//
//
//function getchat()//
//{ //
//   $.post('/getchat')/
/
//.done(function(data, textStatus, jqXHR) //
//{//
   $("#chat").html(data["html"])//
//})//
//}/


Now you have everything, does this seems the right way to do what
I want to achieve with django or is there a better way ?



--
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 template loop collections.defaultdict(lambda: collections.defaultdict(list))

2013-08-26 Thread Daviddd
Thanks Tom for replying! 

The code used to create the dict is:

my_dict = collections.defaultdict(lambda: collections.defaultdict(list))
for obj in queryset:

my_dict[int(obj.position.split('-')[0])][int(obj.position.split('-')[2])].append(obj)

Basically I have one field in the queryset called position (the format is 
N-N-N-N) and I need to create the dict as in my question.
Sincerely, I don't know how I can create the dict without using defaultdict.

D

On Saturday, August 24, 2013 2:51:56 PM UTC+2, tom wrote:
>
> On 23 Aug 2013, at 16:58, Daviddd  
> wrote:
>
> In my template I tried:
>
> {% for key, groups in queryset.iteritems %}
> groups = {{ groups }} 
> {% for group_key, cols in groups.iteritems %}
>   cols = {{ group_key }} 
>   {% for objs in cols %}
>   {# rest of the code #}  
>
>
> But only the first loop is evaluated
>
> groups = (1, defaultdict(, {1: [,  Obj 2 by daviddd>, ], 2: [], 3: 
> [, , ]}))
> groups = (2, defaultdict(, {1: []}))
> groups = (3, defaultdict(, {1: []}))
>
>
>
> Maybe I'm misreading, but aren't your inner "groupses" still defaultdicts? 
> I think they need to be coerced to normal dicts in order for Django's 
> template system to be able to properly iterate over them.
>
> Tom
>
>

-- 
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.