-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Removing django.contrib.auth app #3262
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Yes, you're completely free to remove it.
It looks like you're most likely importing from django or rest_framework before the settings are loaded. This is a Django usage issue (and possibly scope for improvement in Django core - unsure?) but nothing to do with REST framework. |
@tomchristie @mkohram We ran into this as well when using DRF without doing authorization. It's not technically a DRF bug but there is some behaviour that makes it a huge gotcha. The problem is that the default value for UNAUTHENTICATED_USER is AnonymousUser (from contrib.auth). So if you don't set that setting to something else because you don't care to provide your own (likely, if you don't use auth) you will get this warning. So for the record, if your API does not use authentication make sure that this is in your DRF settings: |
@ivanvenosdel I don't think using AnonymousUser is an issue. It's provided by Django but doesn't require any table to be loaded, does it ? |
@xordoquy You are correct, it doesn't require a table to be loaded. There are no functional problems at the present time.
We hope so but the fact that it's a deprecation warning makes us concerned that something in 1.9 will make it more than a warning. Also since the Django error is not able to determine what app usage is producing the behaviour it makes it something we would prefer to fix now instead of in the middle of an upgrade. Otherwise I guess if you are certain that referencing it won't become a problem in 1.9 maybe the false alarm is a bug in Django core? Though I am not sure how they could possibly distinguish a reference from usage. We are at the latest 1.8 release. |
Well, 1.9 alpha has been released so this is readily testable ATM. Would happily accept an issue for it if there is a demonstrable problem. |
@tomchristie Good point, here is what I get with 1.9a1 (Note: For us this is when loading a DRF URL not when running the server):
So it looks like it does turn into an explicit failure. If I put in the 'UNAUTHENTICATED_USER': None setting I mentioned above it goes away. |
Submitted issue as #3494 |
@ivanvenosdel Thanks for clearing this up. |
Is there any way to remove the django.contrib.auth app if I don't need authentication. The six tables it creates in my database are pretty ugly. Here is my config:
I get deprecation warnings:
The text was updated successfully, but these errors were encountered: