django-admin.py shebang

2015-04-01 Thread Stan
Hi devs,

Is there a good reason for having the shebang line in django-admin.py at 
#!/usr/bin/python
"instead" of #!/usr/bin/env python ?

My problem is I have a newer version of Python installed in 
*/usr/local/opt/* declared in my PATH 
that I want to test but the hardcoded path to /usr/bin/python ignore the 
PATH value.

I know that virtualenv is the way to go...

Thanks !

--
Stan

-- 
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/7994d713-3685-43dc-b021-d9cb2b8b6746%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin.py shebang

2015-04-01 Thread Collin Anderson
Hi Stan,

In the source, it's looks like it's been using #!/usr/bin/env python for 
almost 10 years:
https://github.com/django/django/blame/master/django/bin/django-admin.py

My quick guess is that gets modified when installing. Did you use the newer 
version of python to install django?

Collin

On Wednesday, April 1, 2015 at 7:46:34 AM UTC-4, Stan wrote:
>
> Hi devs,
>
> Is there a good reason for having the shebang line in django-admin.py at 
> #!/usr/bin/python
> "instead" of #!/usr/bin/env python ?
>
> My problem is I have a newer version of Python installed in 
> */usr/local/opt/* declared in my PATH 
> that I want to test but the hardcoded path to /usr/bin/python ignore the 
> PATH value.
>
> I know that virtualenv is the way to go...
>
> Thanks !
>
> --
> Stan
>

-- 
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/0d9b4be9-acf6-4258-a6bd-3aa8e89a0836%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin.py shebang

2015-04-01 Thread Markus Holtermann
Hi Stan,

how did you install Django? As a system package via the system's package 
manager or via pip. If its the system package manager, please raise that bug in 
the bug tracker of your Linux distribution. If the answer is "via pip", from 
where? PyPI or something obscure?

As Collin already wrote, Django uses "/usr/bin/env python" for years.

/Markus


On April 1, 2015 3:58:13 PM GMT+02:00, Collin Anderson  
wrote:
>Hi Stan,
>
>In the source, it's looks like it's been using #!/usr/bin/env python
>for 
>almost 10 years:
>https://github.com/django/django/blame/master/django/bin/django-admin.py
>
>My quick guess is that gets modified when installing. Did you use the
>newer 
>version of python to install django?
>
>Collin
>
>On Wednesday, April 1, 2015 at 7:46:34 AM UTC-4, Stan wrote:
>>
>> Hi devs,
>>
>> Is there a good reason for having the shebang line in django-admin.py
>at 
>> #!/usr/bin/python
>> "instead" of #!/usr/bin/env python ?
>>
>> My problem is I have a newer version of Python installed in 
>> */usr/local/opt/* declared in my PATH 
>> that I want to test but the hardcoded path to /usr/bin/python ignore
>the 
>> PATH value.
>>
>> I know that virtualenv is the way to go...
>>
>> Thanks !
>>
>> --
>> Stan
>>

-- 
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/FEBDCB09-96A0-409D-8801-C674105A881B%40markusholtermann.eu.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin.py shebang

2015-04-01 Thread Stan


On Wednesday, April 1, 2015 at 3:58:13 PM UTC+2, Collin Anderson wrote:
>
> Hi Stan,
>
> In the source, it's looks like it's been using #!/usr/bin/env python for 
> almost 10 years:
> https://github.com/django/django/blame/master/django/bin/django-admin.py
>

I didn't check that... 
 

>
> My quick guess is that gets modified when installing. Did you use the 
> newer version of python to install django?
>

No, it was installed with the Debian Wheezy package version (2.7.3). Thanks 
for the tips. 

--
Stan 


> Collin
>
> On Wednesday, April 1, 2015 at 7:46:34 AM UTC-4, Stan wrote:
>>
>> Hi devs,
>>
>> Is there a good reason for having the shebang line in django-admin.py at 
>> #!/usr/bin/python
>> "instead" of #!/usr/bin/env python ?
>>
>> My problem is I have a newer version of Python installed in 
>> */usr/local/opt/* declared in my PATH 
>> that I want to test but the hardcoded path to /usr/bin/python ignore the 
>> PATH value.
>>
>> I know that virtualenv is the way to go...
>>
>> Thanks !
>>
>> --
>> Stan
>>
>

-- 
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/7caeae63-bd68-4a27-b309-bc38607d6bca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin.py shebang

2015-04-01 Thread Stan


On Wednesday, April 1, 2015 at 4:15:25 PM UTC+2, Markus Holtermann wrote:
>
> Hi Stan, 
>
> how did you install Django? As a system package via the system's package 
> manager or via pip. If its the system package manager, please raise that 
> bug in the bug tracker of your Linux distribution. If the answer is "via 
> pip", from where? PyPI or something obscure? 
>

A classical pip install Django command without --mirrors or --use-mirrors 
modifier.

I did some --upgrade, but the first installation is not 10 years old (2 
maybe).

 
Pip is a Debian package (1.1.3)

[$ whereis django-admin
django-admin: /usr/local/bin/django-admin.py /usr/local/bin/django-admin
$ cat /usr/local/bin/django-admin
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 
'Django==1.7.4','console_scripts','django-admin'
__requires__ = 'Django==1.7.4'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
sys.exit(
load_entry_point('Django==1.7.4', 'console_scripts', 
'django-admin')()
)
$ cat /usr/local/bin/django-admin.py 
#!/usr/bin/python
from django.core import management

if __name__ == "__main__":
management.execute_from_command_line()




> As Collin already wrote, Django uses "/usr/bin/env python" for years. 
>
> /Markus 
>
>
> On April 1, 2015 3:58:13 PM GMT+02:00, Collin Anderson  > wrote: 
> >Hi Stan, 
> > 
> >In the source, it's looks like it's been using #!/usr/bin/env python 
> >for 
> >almost 10 years: 
> >https://github.com/django/django/blame/master/django/bin/django-admin.py 
> > 
> >My quick guess is that gets modified when installing. Did you use the 
> >newer 
> >version of python to install django? 
> > 
> >Collin 
> > 
> >On Wednesday, April 1, 2015 at 7:46:34 AM UTC-4, Stan wrote: 
> >> 
> >> Hi devs, 
> >> 
> >> Is there a good reason for having the shebang line in django-admin.py 
> >at 
> >> #!/usr/bin/python 
> >> "instead" of #!/usr/bin/env python ? 
> >> 
> >> My problem is I have a newer version of Python installed in 
> >> */usr/local/opt/* declared in my PATH 
> >> that I want to test but the hardcoded path to /usr/bin/python ignore 
> >the 
> >> PATH value. 
> >> 
> >> I know that virtualenv is the way to go... 
> >> 
> >> Thanks ! 
> >> 
> >> -- 
> >> Stan 
> >> 
>
>

-- 
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/87438910-d81b-4541-8143-5c37099e662e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin.py shebang

2015-04-01 Thread James Bennett
On Wed, Apr 1, 2015 at 10:28 AM, Stan  wrote:

> A classical pip install Django command without --mirrors or --use-mirrors
> modifier.
>
> I did some --upgrade, but the first installation is not 10 years old (2
> maybe).
>
>
> Pip is a Debian package (1.1.3)
>
> [$ whereis django-admin
> django-admin: /usr/local/bin/django-admin.py /usr/local/bin/django-admin
>
>
This right here is the giveaway that what you're looking at is Debian's
version of Django (they modify the name from 'django-admin.py' to
'django-admin' to suit their policies for file naming).

-- 
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/CAL13Cg80zy6DDk9kpnxaNyWgKNFT%3DVA7jrDX5g6oqF55v%2BwoUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin.py shebang

2015-04-01 Thread Collin Anderson
Hi Stan,

If possible, I'd recommend (somehow) getting a pip built against your 
/usr/local/bin/python, then "/usr/local/bin/pip install django" should do 
what you want.

Collin

On Wednesday, April 1, 2015 at 11:28:33 AM UTC-4, Stan wrote:
>
>
>
> On Wednesday, April 1, 2015 at 4:15:25 PM UTC+2, Markus Holtermann wrote:
>>
>> Hi Stan, 
>>
>> how did you install Django? As a system package via the system's package 
>> manager or via pip. If its the system package manager, please raise that 
>> bug in the bug tracker of your Linux distribution. If the answer is "via 
>> pip", from where? PyPI or something obscure? 
>>
>
> A classical pip install Django command without --mirrors or --use-mirrors 
> modifier.
>
> I did some --upgrade, but the first installation is not 10 years old (2 
> maybe).
>
>  
> Pip is a Debian package (1.1.3)
>
> [$ whereis django-admin
> django-admin: /usr/local/bin/django-admin.py /usr/local/bin/django-admin
> $ cat /usr/local/bin/django-admin
> #!/usr/bin/python
> # EASY-INSTALL-ENTRY-SCRIPT: 
> 'Django==1.7.4','console_scripts','django-admin'
> __requires__ = 'Django==1.7.4'
> import sys
> from pkg_resources import load_entry_point
>
> if __name__ == '__main__':
> sys.exit(
> load_entry_point('Django==1.7.4', 'console_scripts', 
> 'django-admin')()
> )
> $ cat /usr/local/bin/django-admin.py 
> #!/usr/bin/python
> from django.core import management
>
> if __name__ == "__main__":
> management.execute_from_command_line()
>
>
>
>
>> As Collin already wrote, Django uses "/usr/bin/env python" for years. 
>>
>> /Markus 
>>
>>
>> On April 1, 2015 3:58:13 PM GMT+02:00, Collin Anderson <
>> cmawe...@gmail.com> wrote: 
>> >Hi Stan, 
>> > 
>> >In the source, it's looks like it's been using #!/usr/bin/env python 
>> >for 
>> >almost 10 years: 
>> >https://github.com/django/django/blame/master/django/bin/django-admin.py 
>> > 
>> >My quick guess is that gets modified when installing. Did you use the 
>> >newer 
>> >version of python to install django? 
>> > 
>> >Collin 
>> > 
>> >On Wednesday, April 1, 2015 at 7:46:34 AM UTC-4, Stan wrote: 
>> >> 
>> >> Hi devs, 
>> >> 
>> >> Is there a good reason for having the shebang line in django-admin.py 
>> >at 
>> >> #!/usr/bin/python 
>> >> "instead" of #!/usr/bin/env python ? 
>> >> 
>> >> My problem is I have a newer version of Python installed in 
>> >> */usr/local/opt/* declared in my PATH 
>> >> that I want to test but the hardcoded path to /usr/bin/python ignore 
>> >the 
>> >> PATH value. 
>> >> 
>> >> I know that virtualenv is the way to go... 
>> >> 
>> >> Thanks ! 
>> >> 
>> >> -- 
>> >> Stan 
>> >> 
>>
>>

-- 
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/170c7dfd-ecc3-4a6a-8c4f-9ceec79518c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin.py shebang

2015-04-01 Thread Florian Apolloner
On Wednesday, April 1, 2015 at 5:34:55 PM UTC+2, James Bennett wrote:
>
> This right here is the giveaway that what you're looking at is Debian's 
> version of Django (they modify the name from 'django-admin.py' to 
> 'django-admin' to suit their policies for file naming). 
>

Newer Django versions have it as django-admin too! 
https://github.com/django/django/blob/master/setup.py#L47-L49 

-- 
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/aa1e3e44-da04-4812-a1a5-240e8913f138%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-admin.py shebang

2015-04-01 Thread Shai Berger
On Wednesday 01 April 2015 18:34:35 James Bennett wrote:
> On Wed, Apr 1, 2015 at 10:28 AM, Stan  wrote:
> > A classical pip install Django command without --mirrors or --use-mirrors
> > modifier.
> > 
> > I did some --upgrade, but the first installation is not 10 years old (2
> > maybe).
> > 
> > 
> > Pip is a Debian package (1.1.3)
> > 
> > [$ whereis django-admin
> > django-admin: /usr/local/bin/django-admin.py /usr/local/bin/django-admin
> 
> This right here is the giveaway that what you're looking at is Debian's
> version of Django 

Actually, it proves the opposie. Debian's packages don't install into 
/usr/local/bin, but into /usr/bin.

Also, I've just checked -- Debian's django-admin is a bash script, with 
#!/bin/sh.

Shai.


Re: Pre-DEP: community support of unmaintained versions of Django

2015-04-01 Thread John Paulett
Carl, your proposal sounds good to me.  I would be happy to contribute to a
DEP, if formalization of the process is necessary.

Christian, let's coordinate to set up a public/private repo pair with the
appropriate warnings and have one of us apply for the pre-release
notifications (if you haven't already).

Personally, I want to ensure we stay true to the core team's wishes. So as
we proceed, please reach out if there is anything we could be doing better,
particularly clarification that this is an unofficial community effort and
encouraging the transition to the official release.

John


On Fri, Mar 27, 2015 at 6:43 PM, Marc Tamlyn  wrote:

> Sounds broadly good to me. I'd be happy for it to be pushed to pypi under
> django-legacy or similar name.
>
> Marc
> On 27 Mar 2015 16:36, "Tim Graham"  wrote:
>
>> Sounds good to me.
>>
>> On Friday, March 27, 2015 at 12:28:09 PM UTC-4, Carl Meyer wrote:
>>>
>>> Hi Christian,
>>>
>>> On 03/26/2015 05:11 PM, Christian Hammond wrote:
>>> > I know you guys are still sorting out how you want to run this, but I
>>> > wanted to let you know that, given our current dependence on Python
>>> 2.6,
>>> > I'm willing to do what's needed to maintain security backports for
>>> > either an official or unofficial fork.
>>> >
>>> > I'd love to know some further thoughts on the logistics for this.
>>> Things
>>> > like how versioning would work, what you'd need from me, what kind of
>>> > timeframes we'd have to work with, any legalese needed to be notified
>>> of
>>> > security issues, etc.
>>>
>>> Tim pointed you to the details for requesting security pre-notification.
>>> We pre-notify a week in advance, so that's the timeframe you'd have
>>> available to get a patch (or patches) prepped to apply to your fork.
>>> Obviously we'd expect that you wouldn't push any patches to a public
>>> fork until the embargo ends with our release announcement; you could
>>> manage that by simply staging patches on a local machine, or by
>>> coordinating patches during the embargo in a private GitHub repo.
>>>
>>> Carl
>>>
>>>  --
>> 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/3eaf7467-90bc-41d6-b903-6b3198bd38d2%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/CAMwjO1EizLpYtKMjrshPLn%3DspjuyjtnW04LwEH23v0NyJFckSg%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/CANRBGvYAiuGQXee6JAJhtnnjiP4zDu8S6c5hYG_hOqz0TfFEig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ANNOUNCE] Django 1.8 released

2015-04-01 Thread Tim Graham
Django 1.8, the next long-term support release, is now available:

https://www.djangoproject.com/weblog/2015/apr/01/release-18-final/

With the release of Django 1.8, Django 1.6 has reached end-of-life. As 
such, Django 1.6.11 is the final release of the 1.6 series. Django 1.7 will 
continue to receive security updates until the release of Django 1.9 (planned 
for October 2015 ). 
Django 1.4 (the previous LTS) will receive security updates for another six 
months (ending October 1, 2015) to give time for users to upgrade to Django 
1.8 LTS.

-- 
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/d86fa26c-5423-405a-9cc3-d349f8cd0c64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using AbstractBaseUser without django.contrib.auth

2015-04-01 Thread Dan Watson
While trying out Django 1.8 with one of my sites that uses a custom User 
model (and doesn't have django.contrib.auth in INSTALLED_APPS), I noticed a 
few unexpected deprecation warnings:

/Users/dcwatson/Documents/Environments/reader/lib/python3.4/site-packages/django/contrib/auth/models.py:41:
 
RemovedInDjango19Warning: Model class django.contrib.auth.models.Permission 
doesn't declare an explicit app_label and either isn't in an application in 
INSTALLED_APPS or else was imported before its application was loaded. This 
will no longer be supported in Django 1.9.
  class Permission(models.Model):

Same thing for User and Group. Is it required to have django.contrib.auth 
installed to use custom User models now? Seems like it would be easy enough 
to move AbstractBaseUser (and probably UserManager/BaseUserManager) to a 
separate modules and import them from django.contrib.auth.models, so sites 
could use them without triggering these errors. If this sounds reasonable, 
I can open a ticket/PR.

Dan

-- 
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/02f98a6f-9fbf-4c57-8285-80f3c2c3e2ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using AbstractBaseUser without django.contrib.auth

2015-04-01 Thread Curtis Maloney
Does your model inherit from PermissionsMixin?

If you're using Admin, or any of Django's permissions machinery, you will
need django.contrib.auth in there to use the Group and Permission models.

--
Curtis

On 2 April 2015 at 13:47, Dan Watson  wrote:

> While trying out Django 1.8 with one of my sites that uses a custom User
> model (and doesn't have django.contrib.auth in INSTALLED_APPS), I noticed a
> few unexpected deprecation warnings:
>
> /Users/dcwatson/Documents/Environments/reader/lib/python3.4/site-packages/django/contrib/auth/models.py:41:
> RemovedInDjango19Warning: Model class django.contrib.auth.models.Permission
> doesn't declare an explicit app_label and either isn't in an application in
> INSTALLED_APPS or else was imported before its application was loaded. This
> will no longer be supported in Django 1.9.
>   class Permission(models.Model):
>
> Same thing for User and Group. Is it required to have django.contrib.auth
> installed to use custom User models now? Seems like it would be easy enough
> to move AbstractBaseUser (and probably UserManager/BaseUserManager) to a
> separate modules and import them from django.contrib.auth.models, so sites
> could use them without triggering these errors. If this sounds reasonable,
> I can open a ticket/PR.
>
> Dan
>
> --
> 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/02f98a6f-9fbf-4c57-8285-80f3c2c3e2ef%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/CAG_XiSCbwNzsJMKHVDjf%2B2XnQbnPe9UgbsDZ_FvAgW3L17NC4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using AbstractBaseUser without django.contrib.auth

2015-04-01 Thread Dan Watson
On Wednesday, April 1, 2015 at 10:50:17 PM UTC-4, Curtis Maloney wrote:
>
> Does your model inherit from PermissionsMixin?
>
> If you're using Admin, or any of Django's permissions machinery, you will 
> need django.contrib.auth in there to use the Group and Permission models.
>
>
I'm using my own permissions system, but implementing 
everything PermissionsMixin does (without subclassing it) so the admin 
still works.
 

> --
> Curtis
>
> On 2 April 2015 at 13:47, Dan Watson > 
> wrote:
>
>> While trying out Django 1.8 with one of my sites that uses a custom User 
>> model (and doesn't have django.contrib.auth in INSTALLED_APPS), I noticed a 
>> few unexpected deprecation warnings:
>>
>> /Users/dcwatson/Documents/Environments/reader/lib/python3.4/site-packages/django/contrib/auth/models.py:41:
>>  
>> RemovedInDjango19Warning: Model class django.contrib.auth.models.Permission 
>> doesn't declare an explicit app_label and either isn't in an application in 
>> INSTALLED_APPS or else was imported before its application was loaded. This 
>> will no longer be supported in Django 1.9.
>>   class Permission(models.Model):
>>
>> Same thing for User and Group. Is it required to have django.contrib.auth 
>> installed to use custom User models now? Seems like it would be easy enough 
>> to move AbstractBaseUser (and probably UserManager/BaseUserManager) to a 
>> separate modules and import them from django.contrib.auth.models, so sites 
>> could use them without triggering these errors. If this sounds reasonable, 
>> I can open a ticket/PR.
>>
>> Dan
>>
>> -- 
>> 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/02f98a6f-9fbf-4c57-8285-80f3c2c3e2ef%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/44df83a3-5006-4be0-bbb1-cb5d0803381d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using AbstractBaseUser without django.contrib.auth

2015-04-01 Thread Shai Berger
On Thursday 02 April 2015 05:50:04 Curtis Maloney wrote:
> Does your model inherit from PermissionsMixin?
> 
> If you're using Admin, or any of Django's permissions machinery, you will
> need django.contrib.auth in there to use the Group and Permission models.
> 

The problem is not with permissions; the problem is that you can't import 
AbstractBaseUser without importing the concrete Permission, Group and User 
models,  because they're all in the same module.

> On 2 April 2015 at 13:47, Dan Watson wrote:
>>
>> /Users/dcwatson/Documents/Environments/reader/lib/python3.4/site-
packages/django/contrib/auth/models.py:41: 
>> RemovedInDjango19Warning: Model class django.contrib.auth.models.Permission 
>> doesn't declare an explicit app_label and either isn't in an application in 
>> INSTALLED_APPS or else was imported before its application was loaded. This 
>> will no longer be supported in Django 1.9.
>>   class Permission(models.Model):
>>
>> Same thing for User and Group.

I am not sure what the proper fix should be; on one hand, you are using code 
from django.contib.auth, so it makes some sense to require it to be installed. 
On the other hand, that forces two redundant tables on you (Group and 
Permission are not swappable).

Please do open a ticket -- my instinct is that django.contrib.auth will need 
to be installed, but the impact of installing it should be minimised.

Shai.


Re: Using AbstractBaseUser without django.contrib.auth

2015-04-01 Thread Marc Tamlyn
Moving them into another module won't make much difference as their
definition requires Permission and Group and therefore they'd still need to
import Permission and Group. We'd need an "AbstractAbstractBaseUser" which
would be silly.

Of course, there is no requirement to use AbstractBaseUser for your custom
model at all, though this does result in some otherwise unnecessary code
duplication. I would say your choice is either two empty tables in your
database, or code duplication between Django's source and your custom user.
Personally I'd prefer the former.

On 2 April 2015 at 07:09, Shai Berger  wrote:

> On Thursday 02 April 2015 05:50:04 Curtis Maloney wrote:
> > Does your model inherit from PermissionsMixin?
> >
> > If you're using Admin, or any of Django's permissions machinery, you will
> > need django.contrib.auth in there to use the Group and Permission models.
> >
>
> The problem is not with permissions; the problem is that you can't import
> AbstractBaseUser without importing the concrete Permission, Group and User
> models,  because they're all in the same module.
>
> > On 2 April 2015 at 13:47, Dan Watson wrote:
> >>
> >> /Users/dcwatson/Documents/Environments/reader/lib/python3.4/site-
> packages/django/contrib/auth/models.py:41:
> >> RemovedInDjango19Warning: Model class
> django.contrib.auth.models.Permission
> >> doesn't declare an explicit app_label and either isn't in an
> application in
> >> INSTALLED_APPS or else was imported before its application was loaded.
> This
> >> will no longer be supported in Django 1.9.
> >>   class Permission(models.Model):
> >>
> >> Same thing for User and Group.
>
> I am not sure what the proper fix should be; on one hand, you are using
> code
> from django.contib.auth, so it makes some sense to require it to be
> installed.
> On the other hand, that forces two redundant tables on you (Group and
> Permission are not swappable).
>
> Please do open a ticket -- my instinct is that django.contrib.auth will
> need
> to be installed, but the impact of installing it should be minimised.
>
> Shai.
>

-- 
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/CAMwjO1E5-Fh9u%3Dh7yucyAcSz4TKBbWjvwVyjHv1FyPRN5NnhPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.