Comments (7)
Sure thing. Worth noting that I verified that this package was installed correctly (i.e. in INSTALLED_APPS
) and that I had run the migrations.
Python==3.5.6
Django==2.1.5
djangorestframework==3.7.7
Edit: typo
from djangorestframework-api-key.
Excellent, thank you for following up with this in such a timely manner! Unfortunately I'm a bit busy to attempt a PR at the moment, but I'll keep it in mind if I get a moment.
My temporary fix that I listed in the first comment is working well for my project, especially since I made many custom modifications in the form of subclassing your models.
from djangorestframework-api-key.
Hi Scott, thanks for reporting this. I did not get this error on my side. Also this is the first time someone has issues with the admin panel not showing up in the admin site. Can you share the Python, Django and DRF versions you are using?
from djangorestframework-api-key.
So, I was able to reproduce the issue with the versions you listed. I just had to run system checks after creating a new project and adding the DRF and DRF-api-key apps:
$ ./manage.py check
SystemCheckError: System check identified some issues:
ERRORS:
<class 'rest_framework_api_key.admin.APIKeyAdmin'>: (admin.E108) The value of 'list_display[4]' refers to 'has_expired_func', which is not a callable, an attribute of 'APIKeyAdmin', or an attribute or method on 'rest_framework_api_key.APIKey'.
System check identified 1 issue (0 silenced).
Upgrading the Django and DRF versions to the latest available did not fix this either, so this is definitely a serious bug!
The following fixed the system checks:
- Edit
models.py
, basically unwrapping the custom@djangoproperty
:
def _has_expired(self) -> bool:
...
_has_expired.short_description = "Has expired"
_has_expired.boolean = True
has_expired = property(_has_expired)
- Edit
admin.py
to use_has_expired
.
If you're up for it, feel free to open a PR with these. :-)
from djangorestframework-api-key.
Gotcha, I'll try and find some time to publish the fix later today then. :-) I suppose this is affecting all users of 1.2, so it's best if we get this out asap.
especially since I made many custom modifications in the form of subclassing your models.
We have an open issue to provide an abstract API key model to make it easier to customize API keys: #34. If that's something you'd be interested in, feel free to check it out and share your thoughts!
from djangorestframework-api-key.
Same is happening with Django 2.1.*, Python 3.7.3 and DRF 3.9
from djangorestframework-api-key.
Released in v1.2.1. 👍
from djangorestframework-api-key.
Related Issues (20)
- Getting 'Authentication credentials were not provided' in test project
- `KeyParser` should match `keyword` exactly HOT 1
- get_usable_keys() is empty
- APIKey generation in `CreateView` on a per-User basis?
- Best way to create and validate keys?
- Import not working
- Infinite loop with Django, MongoDB and Djongo with HasApiKey - Solved? HOT 1
- API_KEY_CUSTOM_HEADER not working HOT 2
- Migration file in `site-packages` folder for generating a custom API Key model HOT 1
- Is the API_KEY generated always unique? HOT 1
- IntegrityError using AbstractAPIKey
- Cannot authenticate with API key HOT 5
- API Key object pk/id created with api-key and hashed api key HOT 1
- About second to permission check HOT 1
- There is no clearly documented way to manually validate an API key HOT 2
- Customizing Api-Key name (documentation incorrect) HOT 1
- Hide DRF's browsable API page title when API Key is missing/invalid HOT 3
- Expired APIKey's are considered as valid APIKey
- Making invalid API Key raise 403 forbidden
- Declaring support for Django 5.0 (and Python 3.12)? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djangorestframework-api-key.