Re: Testing Django using Docker

2015-11-09 Thread Jani Tiainen

Hi,

I think you should document this in Wiki at least.

Few additional questions notes:

What's the Docker overhead? (starup/shutdown time)

Could waiting for db container be more robust? Now it's just "random 
number".


Using docker-compose would be nice to avoid problems with container 
startup times.



On 07.11.2015 14:46, Andreas Madsack wrote:

Hello,

I did a first version of a Dockerfile for testing using Docker with a 
Postgresql Docker container.

see https://github.com/mfa/django-runtests-docker

The readme contains a walkthrough for a fresh digitialocean box (you 
need 1GB RAM! 512MB and a swap file also works).

On a linux host you can run the testsuite with "sh run.sh".

Should this way of running the tests be integrated in the docs?
And should the Dockerfile and the runscript be in the django tests folder?

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

Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/5f4750dd-36c6-4d80-b222-6d203ada2974%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 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/56405370.8060100%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Testing Django using Docker

2015-11-09 Thread Enrique Paredes
There's one good basic example of docker-compose in pydanny's cookiecutter 
django package, if you need it.



—
Sent from Mailbox

On Mon, Nov 9, 2015 at 9:04 AM, Jani Tiainen  wrote:

> Hi,
> I think you should document this in Wiki at least.
> Few additional questions notes:
> What's the Docker overhead? (starup/shutdown time)
> Could waiting for db container be more robust? Now it's just "random 
> number".
> Using docker-compose would be nice to avoid problems with container 
> startup times.
> On 07.11.2015 14:46, Andreas Madsack wrote:
>> Hello,
>>
>> I did a first version of a Dockerfile for testing using Docker with a 
>> Postgresql Docker container.
>> see https://github.com/mfa/django-runtests-docker
>>
>> The readme contains a walkthrough for a fresh digitialocean box (you 
>> need 1GB RAM! 512MB and a swap file also works).
>> On a linux host you can run the testsuite with "sh run.sh".
>>
>> Should this way of running the tests be integrated in the docs?
>> And should the Dockerfile and the runscript be in the django tests folder?
>>
>> Regards,
>> Andreas
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send 
>> an email to django-developers+unsubscr...@googlegroups.com 
>> .
>> To post to this group, send email to 
>> django-developers@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/5f4750dd-36c6-4d80-b222-6d203ada2974%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 developers  (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/56405370.8060100%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

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


Re: Testing Django using Docker

2015-11-09 Thread Anssi Kääriäinen
There would be huge benefit if we could somewhat easily test against
different database and python versions. Right now, if you are faced with
"doesn't work on MySQL 5.7" bug, it is a bit complicated to verify such
issues if you don't happen to have the version installed.

- Anssi
On Nov 9, 2015 12:22, "Enrique Paredes"  wrote:

> There's one good basic example of docker-compose in pydanny's cookiecutter
> django package, if you need it.
>
> —
> Sent from Mailbox 
>
>
> On Mon, Nov 9, 2015 at 9:04 AM, Jani Tiainen  wrote:
>
>> Hi,
>>
>> I think you should document this in Wiki at least.
>>
>> Few additional questions notes:
>>
>> What's the Docker overhead? (starup/shutdown time)
>>
>> Could waiting for db container be more robust? Now it's just "random
>> number".
>>
>> Using docker-compose would be nice to avoid problems with container
>> startup times.
>>
>>
>> On 07.11.2015 14:46, Andreas Madsack wrote:
>>
>> Hello,
>>
>> I did a first version of a Dockerfile for testing using Docker with a
>> Postgresql Docker container.
>> see https://github.com/mfa/django-runtests-docker
>>
>> The readme contains a walkthrough for a fresh digitialocean box (you need
>> 1GB RAM! 512MB and a swap file also works).
>> On a linux host you can run the testsuite with "sh run.sh".
>>
>> Should this way of running the tests be integrated in the docs?
>> And should the Dockerfile and the runscript be in the django tests folder?
>>
>> Regards,
>> Andreas
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> 
>> https://groups.google.com/d/msgid/django-developers/5f4750dd-36c6-4d80-b222-6d203ada2974%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 developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/56405370.8060100%40gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/1447064529975.9bd091b8%40Nodemailer
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: #25582: Add a way to build URLs with query strings

2015-11-09 Thread Merijn Bertels
I think would be a good thing if we create a function to support this. 
But I don't think it should be build in the reverse function. 

Like to point out that the Admin ChangeList has a function on the class who 
does something like this: 
https://github.com/django/django/blob/master/django/contrib/admin/views/main.py#L153
each ListFilter use this function to generate a new url.

The downside of this is that ListFilters can not be re-used without a 
ChangeList. 



Op vrijdag 23 oktober 2015 09:41:42 UTC+2 schreef guettli:
>
> From  https://code.djangoproject.com/ticket/25582
>
>  {{{
>
> It is a common question on stackoverflow and other places:
>
> How to reverse() to url including GET parameters? Example: 
> .../myview?foo=bar
>
> ​
> http://stackoverflow.com/questions/9585491/how-do-i-pass-get-parameters-using-django-urlresolvers-reverse
>
> ​http://stackoverflow.com/a/27641445/633961
>
> It would be very nice if django could implement a short-cut which provides
> this.
> It would be useful for python code and template, too.
> }}}
>
> {{{
> If we do add it, it likely needs a discussion on the DevelopersMailingList 
>  to figure out 
> what the API should look like. See also #10941 
>  which asks for a template 
> tag for creating query strings in templates.
> }}}
>
> What do you think?
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d13c725a-5dd4-4eda-9168-cc603fc7374e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Feature proposal: selection of views and tables for inspectdb

2015-11-09 Thread José Tomás Tocino

>
> Well maybe extending queries to do that. Wonder is there similiar issues 
> with postgresql?
>

Nope, I've just tried granting SELECT access to a user and he can inspect 
the tables properly (in postgresql):

postgres=# CREATE DATABASE permissions;
CREATE DATABASE
postgres=# \c permissions;
You are now connected to database "permissions" as user "postgres".
permissions=# create table foo (id int, name varchar(255));
CREATE TABLE
permissions=# GRANT CONNECT ON DATABASE permissions to tester;
GRANT
permissions=# GRANT USAGE ON SCHEMA public TO tester;
GRANT
permissions=# GRANT SELECT ON foo TO tester;
GRANT
permissions=# \q
(ENV)vagrant@vagrant-ubuntu-trusty-64:~$ ./manage.py inspectdb
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
#   * Rearrange models' order
#   * Make sure each model has one field with primary_key=True
#   * Remove `managed = False` lines if you wish to allow Django to create, 
modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field 
names.
#
# Also note: You'll have to insert the output of 'django-admin sqlcustom 
[app_label]'
# into your database.
from __future__ import unicode_literals

from django.db import models


class Foo(models.Model):
id = models.IntegerField(blank=True, null=True)
name = models.CharField(max_length=255, blank=True, null=True)

class Meta:
managed = False
db_table = 'foo'


So there's that
 

>
> -- 
> José Tomás Tocino García
> http://www.josetomastocino.com
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-develop...@googlegroups.com .
> To post to this group, send email to django-d...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit 
> 
> https://groups.google.com/d/msgid/django-developers/CAAOwDo7J33ScxGvQ3UZe2HLMLbc1Eim1TPGwqFDap6Xdp%2BJkFw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/620741bb-e6af-452d-946a-ea94796141d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: startproject values for STATICFILES_DIRS and TEMPLATES

2015-11-09 Thread Collin Anderson
I wouldn't mind having these in the project template. They're already the 
example values in the docs. It could make it slightly easier for beginners.

STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
}
]


On Saturday, 7 November 2015 22:16:26 UTC-5, René Fleschenberg wrote:
>
> Hi, 
>
> It is quite common to configure TEMPLATES and STATICFILES_DIRS such that 
> you 
> can override the templates and static files of installed apps from some 
> central location. 
>
> Maybe startproject should actually generate settings to do this by 
> default? 
>
> STATICFILES_DIRS = ( 
> os.path.join(BASE_DIR, 'static'), 
> ) 
>
> Or maybe: 
>
> STATICFILES_DIRS = ( 
> os.path.join(BASE_DIR, 'mysite', 'static'), 
> ) 
>
> In my experience, this is a real pain point for beginners, and doing this 
> shouldn't hurt anyone. What do you think? 
>
> Also, do you think that templates and static files should be treated 
> differently in this regard? The docs currently suggest such a 
> configuration 
> for static files, but not for templates. I'd argue that it's more 
> important 
> for templates, but it cannot harm to do it for both. 
>
> -- 
> René Fleschenberg 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/afa6d398-394e-4995-8b07-1c2f98f779d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Proposal: add new template tag "age"

2015-11-09 Thread Paulo Maciel
My proposal is to add a new template tag "age": {{ birthday|age }}.
I think it is a common need for many users know the age from a date.


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1e6cc72f-c876-41ac-82fa-e9d3e0420ea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: add new template tag "age"

2015-11-09 Thread Tim Graham
For questions of whether or not to include something like this in core, my 
own rule of thumb is, "Is this difficult to implement as a third-party 
package? If not, do more than ~80% of sites need this feature?" If the 
answer to both questions is "no" (which is the case here, in my opinion), 
then I don't favor including it in Django.

For historic reasons we have some filters like phone2numeric which likely 
don't meet this criteria. I don't see much benefit to deprecating them, but 
let's not add more. Other opinions welcome.

On Monday, November 9, 2015 at 2:43:46 PM UTC-5, Paulo Maciel wrote:
>
> My proposal is to add a new template tag "age": {{ birthday|age }}.
> I think it is a common need for many users know the age from a date.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d9ce1b89-1af0-4038-816f-24e13d25a666%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Support `manage.py shell -c 'run_code_as_django()'`?

2015-11-09 Thread Tim Graham
Similar to "python -c", there's been a request for:

python manage.py shell -c 'run_code_as_django()'

to avoid writing simple management commands. What do you think about this 
idea?

https://code.djangoproject.com/ticket/25680

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ec1bfcf0-8fc9-449c-a1c5-50855319f437%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: add new template tag "age"

2015-11-09 Thread Dheerendra Rathor
If we ever need to implement age filter, I would rather suggest for
modification of naturaltime in django.contrib.humanize to take an optional
parameter (age = True).

On Tue, 10 Nov 2015 at 01:22 Tim Graham  wrote:

> For questions of whether or not to include something like this in core, my
> own rule of thumb is, "Is this difficult to implement as a third-party
> package? If not, do more than ~80% of sites need this feature?" If the
> answer to both questions is "no" (which is the case here, in my opinion),
> then I don't favor including it in Django.
>
> For historic reasons we have some filters like phone2numeric which likely
> don't meet this criteria. I don't see much benefit to deprecating them, but
> let's not add more. Other opinions welcome.
>
>
> On Monday, November 9, 2015 at 2:43:46 PM UTC-5, Paulo Maciel wrote:
>>
>> My proposal is to add a new template tag "age": {{ birthday|age }}.
>> I think it is a common need for many users know the age from a date.
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/d9ce1b89-1af0-4038-816f-24e13d25a666%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 developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAByqUgjS8nzfuwa_CApjAky-LTmADdukU9sKL3bLyh5ogA1oeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Support `manage.py shell -c 'run_code_as_django()'`?

2015-11-09 Thread Zach Borboa
I've used

cat script.py | python manage.py shell

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/ce1f31f6-1f66-4d81-9231-a3d975a6aeb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.