Re: The best django file structure

2019-07-17 Thread göktürk sığırtmaç
I'm sorry. Thank you for information.

17 Temmuz 2019 Çarşamba 18:43:54 UTC+3 tarihinde Adam Johnson yazdı:
>
> Hi!
>
> I think you've found the wrong mailing list for this post. This mailing 
> list is for the development of Django itself, not for support using Django. 
> This means the discussions of bugs and features in Django itself, rather 
> than in your code using it. People on this list are unlikely to answer your 
> support query with their limited time and energy. Read more on the mailing 
> lists at https://www.djangoproject.com/community/
>
> For support, please use the django-users mailing list, or IRC #django on 
> Freenode, or a site like Stack Overflow. There are people out there willing 
> to help on those channels, but they might not respond if you don't ask your 
> question well. Stack Overflow's question guide can help you frame it well: 
> https://stackoverflow.com/help/how-to-ask .
>
> Also if you haven't read it, please take a look at Django's Code of 
> Conduct: https://www.djangoproject.com/conduct/ . These are our "ground 
> rules" for working well as a community, and will help you get the most out 
> of Django and our fantastic community.
>
> Thanks for your understanding,
>
> Adam
>
> On Wed, 17 Jul 2019 at 15:56, göktürk sığırtmaç  > wrote:
>
>> Hello dear friends, I will develop web app with Django. How should be 
>> folder structure my project.
>>
>> -- 
>> 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-d...@googlegroups.com .
>> To post to this group, send email to django-d...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/aeea4c69-f0c6-43aa-923f-ea821c1748eb%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Adam
>

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/8071be98-7c06-432e-9be7-6bccf811e56d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: The best django file structure

2019-07-17 Thread Adam Johnson
Hi!

I think you've found the wrong mailing list for this post. This mailing
list is for the development of Django itself, not for support using Django.
This means the discussions of bugs and features in Django itself, rather
than in your code using it. People on this list are unlikely to answer your
support query with their limited time and energy. Read more on the mailing
lists at https://www.djangoproject.com/community/

For support, please use the django-users mailing list, or IRC #django on
Freenode, or a site like Stack Overflow. There are people out there willing
to help on those channels, but they might not respond if you don't ask your
question well. Stack Overflow's question guide can help you frame it well:
https://stackoverflow.com/help/how-to-ask .

Also if you haven't read it, please take a look at Django's Code of
Conduct: https://www.djangoproject.com/conduct/ . These are our "ground
rules" for working well as a community, and will help you get the most out
of Django and our fantastic community.

Thanks for your understanding,

Adam

On Wed, 17 Jul 2019 at 15:56, göktürk sığırtmaç 
wrote:

> Hello dear friends, I will develop web app with Django. How should be
> folder structure my project.
>
> --
> 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 https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/aeea4c69-f0c6-43aa-923f-ea821c1748eb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Adam

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM0Hs7QBzj-roQW_jzm9yFZi0yX%3DN7GurPY-NhkF8sMt1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


The best django file structure

2019-07-17 Thread göktürk sığırtmaç
Hello dear friends, I will develop web app with Django. How should be 
folder structure my project.

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/aeea4c69-f0c6-43aa-923f-ea821c1748eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO FILE

2019-02-13 Thread Adam Johnson
The django documentation can be downloaded as PDF by following the link on
the right of its index page: https://docs.djangoproject.com/en/2.1/

On Wed, 13 Feb 2019 at 08:48, Edward Victorhez 
wrote:

> Good evening, please can I get the PDF note?
>
> On Feb 12, 2019 10:17 AM, "Adam Johnson"  wrote:
>
>> Hi Edward,
>>
>> You probably want the Django "start" page:
>> https://www.djangoproject.com/start/
>>
>> Emailing this mailing list of more than 10,000 addresses for such help is
>> not appropriate. It is for discussion of the creation of Django itself. For
>> other places to go see the "Join the community" header on that page.
>>
>> Thanks,
>>
>> Adam
>>
>> On Mon, 11 Feb 2019 at 22:20, Kosta Dafoulas 
>> wrote:
>>
>>> I’ll give you the files
>>>
>>> On Mon, Feb 11, 2019 at 10:18 AM Edward Victorhez <
>>> edwardvictor...@gmail.com> wrote:
>>>
 PLEASE I  AM NEW IN DJANGO, PLEASE I NEED THE FILES THAT WILL PUT ME
 THROUGH

 --
 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 https://groups.google.com/group/django-developers.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-developers/4bc81098-6d8b-43dd-bafe-2412061a292a%40googlegroups.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> V/r,
>>> Kosta
>>>
>>> --
>>> 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 https://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/CAFh%3DpPe-A6tHRd-DDd2kEe3efA32bLBCrFZNbi-yD6KomOMBYw%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Adam
>>
>> --
>> 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 https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/CAMyDDM3D%3DTMk6bq-St3548W5za%3DOMTWOQRKqt-p-ebQajPiwxQ%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 https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CACzrH1C1THVZjzV5hW0EgGFCPTckpUnA9COsj0kH2HmSP5%3DjqQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Adam

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM0gu5G0YM-JHHvesXK0gcMWf9g%2BjRk0JGZP-qa%3DpcOLPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO FILE

2019-02-13 Thread Edward Victorhez
Good evening, please can I get the PDF note?

On Feb 12, 2019 10:17 AM, "Adam Johnson"  wrote:

> Hi Edward,
>
> You probably want the Django "start" page: https://www.
> djangoproject.com/start/
>
> Emailing this mailing list of more than 10,000 addresses for such help is
> not appropriate. It is for discussion of the creation of Django itself. For
> other places to go see the "Join the community" header on that page.
>
> Thanks,
>
> Adam
>
> On Mon, 11 Feb 2019 at 22:20, Kosta Dafoulas 
> wrote:
>
>> I’ll give you the files
>>
>> On Mon, Feb 11, 2019 at 10:18 AM Edward Victorhez <
>> edwardvictor...@gmail.com> wrote:
>>
>>> PLEASE I  AM NEW IN DJANGO, PLEASE I NEED THE FILES THAT WILL PUT ME
>>> THROUGH
>>>
>>> --
>>> 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 https://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-developers/4bc81098-6d8b-43dd-bafe-
>>> 2412061a292a%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> V/r,
>> Kosta
>>
>> --
>> 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 https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-developers/CAFh%3DpPe-A6tHRd-DDd2kEe3efA32bLBCrFZNbi-
>> yD6KomOMBYw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Adam
>
> --
> 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 https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/CAMyDDM3D%3DTMk6bq-St3548W5za%
> 3DOMTWOQRKqt-p-ebQajPiwxQ%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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CACzrH1C1THVZjzV5hW0EgGFCPTckpUnA9COsj0kH2HmSP5%3DjqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DJANGO FILE

2019-02-12 Thread Adam Johnson
Hi Edward,

You probably want the Django "start" page:
https://www.djangoproject.com/start/

Emailing this mailing list of more than 10,000 addresses for such help is
not appropriate. It is for discussion of the creation of Django itself. For
other places to go see the "Join the community" header on that page.

Thanks,

Adam

On Mon, 11 Feb 2019 at 22:20, Kosta Dafoulas 
wrote:

> I’ll give you the files
>
> On Mon, Feb 11, 2019 at 10:18 AM Edward Victorhez <
> edwardvictor...@gmail.com> wrote:
>
>> PLEASE I  AM NEW IN DJANGO, PLEASE I NEED THE FILES THAT WILL PUT ME
>> THROUGH
>>
>> --
>> 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 https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/4bc81098-6d8b-43dd-bafe-2412061a292a%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> V/r,
> Kosta
>
> --
> 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 https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAFh%3DpPe-A6tHRd-DDd2kEe3efA32bLBCrFZNbi-yD6KomOMBYw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Adam

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM3D%3DTMk6bq-St3548W5za%3DOMTWOQRKqt-p-ebQajPiwxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


DJANGO FILE

2019-02-11 Thread Edward Victorhez
PLEASE I  AM NEW IN DJANGO, PLEASE I NEED THE FILES THAT WILL PUT ME THROUGH

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4bc81098-6d8b-43dd-bafe-2412061a292a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should django File wrapper support .next()?

2017-08-18 Thread Adam Johnson
I looked a bit more and the reason file objects have next() in Py2 is
because "A file object is its own iterator" (
https://docs.python.org/2/library/stdtypes.html#file.next ). This is still
the case in Py3 - "IOBase (and its subclasses) supports the iterator
protocol" ( https://docs.python.org/3/library/io.html#io.IOBase ).

So yes there is a disparity in Django's File. After a quick look at the
code I'm not sure if it's possible to modify it to match though because of
all the logic embedded in __iter__ but it's worth having a try.

On 16 August 2017 at 13:55, Cristiano Coelho <cristianocc...@gmail.com>
wrote:

> I forgot about django dropping support for Python2 so I guess you are
> right this doesn't make much sense if next() is removed, but for Python2 it
> would make sense for django's File object to have the same api as the
> object returned by open().
>
>
> El martes, 15 de agosto de 2017, 19:21:08 (UTC-3), Adam Johnson escribió:
>>
>> The next() method is gone from the return value of open() in Python 3
>> and I don't think it was every necessary. As per the iterator protcool (
>> https://docs.python.org/2/library/stdtypes.html#iterator-types ),
>> __iter__ is meant to return an iterator over the object, and *that* is
>> what the next() method - __next__ on Python 3 - should be attached to.
>> Django's File.__iter__ is a generator function, thus it returns a
>> generator, with comes with a next()/__next__().
>>
>> I think you should just try iterating your files by calling iter() on
>> them first, it's Python 3 compatible too.
>>
>> On 27 July 2017 at 17:24, Cristiano Coelho <cristia...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I have recently found an interesting issue, using a project that relies
>>> on different storage backends, when switching from a custom one to django's
>>> file system storage, I found that existing code that would iterate files
>>> with the next() call would start to fail, since although django's File is
>>> iterable, it doesn't define the next method.
>>>
>>> Now I'm wondering if this is on purpose, or a bug. It's odd that every
>>> stream (or almost) from the python library such as everything from the .io
>>> module or simply the object returned by open() (python 2) supports the next
>>> call but the django File wrapper doesn't.
>>>
>>> This happened with django 1.10 and I believe it wasn't changed with
>>> Django 1.11
>>>
>>> --
>>> 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 https://groups.google.com/group/django-developers.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-developers/09ffad76-e473-4593-ac84-4bca7f76e92c%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-developers/09ffad76-e473-4593-ac84-4bca7f76e92c%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Adam
>>
> --
> 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 https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/cb7c4945-5932-44a0-8eb8-
> 4571813a0ba3%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/cb7c4945-5932-44a0-8eb8-4571813a0ba3%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM0arRQc-5kJiDq1FcxiH_%3DxN04jWGNq4RAp0rxMHSDv2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should django File wrapper support .next()?

2017-08-16 Thread Cristiano Coelho
I forgot about django dropping support for Python2 so I guess you are right 
this doesn't make much sense if next() is removed, but for Python2 it would 
make sense for django's File object to have the same api as the object 
returned by open().


El martes, 15 de agosto de 2017, 19:21:08 (UTC-3), Adam Johnson escribió:
>
> The next() method is gone from the return value of open() in Python 3 and 
> I don't think it was every necessary. As per the iterator protcool ( 
> https://docs.python.org/2/library/stdtypes.html#iterator-types ), __iter__ 
> is meant to return an iterator over the object, and *that* is what the 
> next() method - __next__ on Python 3 - should be attached to. Django's 
> File.__iter__ is a generator function, thus it returns a generator, with 
> comes with a next()/__next__().
>
> I think you should just try iterating your files by calling iter() on 
> them first, it's Python 3 compatible too.
>
> On 27 July 2017 at 17:24, Cristiano Coelho <cristia...@gmail.com 
> > wrote:
>
>> Hello,
>>
>> I have recently found an interesting issue, using a project that relies 
>> on different storage backends, when switching from a custom one to django's 
>> file system storage, I found that existing code that would iterate files 
>> with the next() call would start to fail, since although django's File is 
>> iterable, it doesn't define the next method.
>>
>> Now I'm wondering if this is on purpose, or a bug. It's odd that every 
>> stream (or almost) from the python library such as everything from the .io 
>> module or simply the object returned by open() (python 2) supports the next 
>> call but the django File wrapper doesn't.
>>
>> This happened with django 1.10 and I believe it wasn't changed with 
>> Django 1.11
>>
>> -- 
>> 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 https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/09ffad76-e473-4593-ac84-4bca7f76e92c%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-developers/09ffad76-e473-4593-ac84-4bca7f76e92c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Adam
>

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/cb7c4945-5932-44a0-8eb8-4571813a0ba3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Should django File wrapper support .next()?

2017-08-15 Thread Adam Johnson
The next() method is gone from the return value of open() in Python 3 and I
don't think it was every necessary. As per the iterator protcool (
https://docs.python.org/2/library/stdtypes.html#iterator-types ), __iter__
is meant to return an iterator over the object, and *that* is what the
next() method - __next__ on Python 3 - should be attached to. Django's
File.__iter__ is a generator function, thus it returns a generator, with
comes with a next()/__next__().

I think you should just try iterating your files by calling iter() on them
first, it's Python 3 compatible too.

On 27 July 2017 at 17:24, Cristiano Coelho <cristianocc...@gmail.com> wrote:

> Hello,
>
> I have recently found an interesting issue, using a project that relies on
> different storage backends, when switching from a custom one to django's
> file system storage, I found that existing code that would iterate files
> with the next() call would start to fail, since although django's File is
> iterable, it doesn't define the next method.
>
> Now I'm wondering if this is on purpose, or a bug. It's odd that every
> stream (or almost) from the python library such as everything from the .io
> module or simply the object returned by open() (python 2) supports the next
> call but the django File wrapper doesn't.
>
> This happened with django 1.10 and I believe it wasn't changed with Django
> 1.11
>
> --
> 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 https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/09ffad76-e473-4593-ac84-
> 4bca7f76e92c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/09ffad76-e473-4593-ac84-4bca7f76e92c%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM394-B26RzXpfhCqb8MYJPwpu%2B_eELpttFDqk6Zfn4Rvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Should django File wrapper support .next()?

2017-07-27 Thread Cristiano Coelho
Hello,

I have recently found an interesting issue, using a project that relies on 
different storage backends, when switching from a custom one to django's 
file system storage, I found that existing code that would iterate files 
with the next() call would start to fail, since although django's File is 
iterable, it doesn't define the next method.

Now I'm wondering if this is on purpose, or a bug. It's odd that every 
stream (or almost) from the python library such as everything from the .io 
module or simply the object returned by open() (python 2) supports the next 
call but the django File wrapper doesn't.

This happened with django 1.10 and I believe it wasn't changed with Django 
1.11

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/09ffad76-e473-4593-ac84-4bca7f76e92c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django File-based session doesn't expire

2012-04-19 Thread Paul McMillan
Hi,

This is explained in the docs about sessions:
https://docs.djangoproject.com/en/dev/topics/http/sessions/#clearing-the-session-table

We provide a job you can periodically run to remove expired sessions.
However, looking at the code, it appears that this only works for the
database backed sessions, and does not work for file-backed sessions.
In the usual case, the cookie expires out of the user's browser and so
they have no access to the session on disk, even if it is still
present, but this leaves you with an ever-growing directory of old
files on the disk.

As a practical matter, file-based sessions are extremely slow compared
to the other session backends, so they are not very common in
production environments.

If you'd like to open a ticket (or even write a patch), that would be
great. I would suggest two improvements (probably as separate
tickets). The first is to switch to using the new signing framework
for file-based sessions, which provides the option for stronger
datetime based integrity checking. The second would be to improve the
cleanup command so that it clears out file-based sessions in addition
to the database backed ones.

-Paul

On Thu, Apr 19, 2012 at 11:44 AM, ej  wrote:
> Anyone?
>
>
> On Tuesday, April 17, 2012 4:11:28 PM UTC-7, ej wrote:
>>
>> File-based session backend doesn't expire, unlike db-backed and
>> cache-based sessions. I'm not too sure if this is a bug or an intended (but
>> undocumented) design. I am under the impression that all session backends
>> should behave similarly.
>>
>> If this is an intended design, can someone explains why this is the case?
>>
>> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-developers/-/tsclBizYprkJ.
>
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.

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



Re: Django File-based session doesn't expire

2012-04-19 Thread ej
Anyone?

On Tuesday, April 17, 2012 4:11:28 PM UTC-7, ej wrote:
>
> File-based session backend doesn't expire, unlike db-backed and 
> cache-based sessions. I'm not too sure if this is a bug or an intended (but 
> undocumented) design. I am under the impression that all session backends 
> should behave similarly.
>
> If this is an intended design, can someone explains why this is the case?
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/tsclBizYprkJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Django File-based session doesn't expire

2012-04-17 Thread ej
File-based session backend doesn't expire, unlike db-backed and cache-based 
sessions. I'm not too sure if this is a bug or an intended (but 
undocumented) design. I am under the impression that all session backends 
should behave similarly.

If this is an intended design, can someone explains why this is the case?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/3R1axzWFK3MJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: make the File Storage API works with a file-like object instead of the Django File object.

2012-02-29 Thread Michael
Allright, thank you, I will follow this django ticket then.


On 29 fév, 01:21, Paul McMillan <p...@mcmillan.ws> wrote:
> This ticket is related to the issue:
>
> https://code.djangoproject.com/ticket/16946
>
> -Paul
>
>
>
>
>
>
>
> On Tue, Feb 28, 2012 at 3:29 PM, Jonathan French <m...@jonathanfrench.net> 
> wrote:
> > You can create a Django file object from any file-like object just by
> > passing it to the constructor.
>
> > django.core.files.File(my_file_like_object)
>
> > This is basically what all the storage backends do where there is an
> > existing file object from whatever source, and what you have to do if you
> > want to save an existing file to a FileField.
>
> > - ojno
>
> > On 28 February 2012 22:28, Michael <michael.palumb...@gmail.com> wrote:
>
> >> Hi,
>
> >> The File Storage API only works with the Django File object (https://
> >> docs.djangoproject.com/en/1.3/ref/files/storage/ ;
> >>https://docs.djangoproject.com/en/1.3/ref/files/file/).
> >> Wouldn't it be a good idea to make a Django file-like object instead
> >> and make the Storage API works with it ?
> >> That way we could use the current Django File object when it is real
> >> files but also use a "remote" file object like the urllib2.urlopen
> >> returns.
>
> >> What do you think ?
>
> >> Best,
> >> Michael
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Django developers" group.
> >> To post to this group, send email to django-developers@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> django-developers+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >>http://groups.google.com/group/django-developers?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django developers" group.
> > To post to this group, send email to django-developers@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-developers+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-developers?hl=en.

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



Re: make the File Storage API works with a file-like object instead of the Django File object.

2012-02-28 Thread Paul McMillan
This ticket is related to the issue:

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

-Paul

On Tue, Feb 28, 2012 at 3:29 PM, Jonathan French <m...@jonathanfrench.net> 
wrote:
> You can create a Django file object from any file-like object just by
> passing it to the constructor.
>
> django.core.files.File(my_file_like_object)
>
> This is basically what all the storage backends do where there is an
> existing file object from whatever source, and what you have to do if you
> want to save an existing file to a FileField.
>
> - ojno
>
>
> On 28 February 2012 22:28, Michael <michael.palumb...@gmail.com> wrote:
>>
>> Hi,
>>
>> The File Storage API only works with the Django File object (https://
>> docs.djangoproject.com/en/1.3/ref/files/storage/ ;
>> https://docs.djangoproject.com/en/1.3/ref/files/file/).
>> Wouldn't it be a good idea to make a Django file-like object instead
>> and make the Storage API works with it ?
>> That way we could use the current Django File object when it is real
>> files but also use a "remote" file object like the urllib2.urlopen
>> returns.
>>
>> What do you think ?
>>
>> Best,
>> Michael
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To post to this group, send email to django-developers@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-developers+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-developers?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.

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



Re: make the File Storage API works with a file-like object instead of the Django File object.

2012-02-28 Thread Jonathan French
You can create a Django file object from any file-like object just by
passing it to the constructor.

django.core.files.File(my_file_like_object)

This is basically what all the storage backends do where there is an
existing file object from whatever source, and what you have to do if you
want to save an existing file to a FileField.

- ojno

On 28 February 2012 22:28, Michael <michael.palumb...@gmail.com> wrote:

> Hi,
>
> The File Storage API only works with the Django File object (https://
> docs.djangoproject.com/en/1.3/ref/files/storage/ ;
> https://docs.djangoproject.com/en/1.3/ref/files/file/).
> Wouldn't it be a good idea to make a Django file-like object instead
> and make the Storage API works with it ?
> That way we could use the current Django File object when it is real
> files but also use a "remote" file object like the urllib2.urlopen
> returns.
>
> What do you think ?
>
> Best,
> Michael
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>

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



make the File Storage API works with a file-like object instead of the Django File object.

2012-02-28 Thread Michael
Hi,

The File Storage API only works with the Django File object (https://
docs.djangoproject.com/en/1.3/ref/files/storage/ ;
https://docs.djangoproject.com/en/1.3/ref/files/file/).
Wouldn't it be a good idea to make a Django file-like object instead
and make the Storage API works with it ?
That way we could use the current Django File object when it is real
files but also use a "remote" file object like the urllib2.urlopen
returns.

What do you think ?

Best,
Michael

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