Comments (5)
Hey, thanks for using my app :D. I'm just not entirely sure HOW you are using it. Since the context should always be available in the admin, I assume you must be using the template tag directly, on some other page than the admin. I'm really interested since I never thought about using it for anything else :)
from django-admin-shortcuts.
Hey, thanks for writing this app. I am also having that same error: KeyError: Context.
Do you mind explaining how to set up the "context"?
from django-admin-shortcuts.
Hey guys,
Alesdotio was correct, 'the context should always be available in the admin'. What I was doing was expanding the admin to include some more pages which is what I guess Kikin81 is doing too. Now the pages I was adding didn't technically count as admin pages as I was using another app to create them. Although I can't remember which now because I eventually took a different route with that site. (Still using admin-shortcuts!)
...(goes to look at site)...
That's right, I was using dbsettings (https://github.com/sciyoshi/django-dbsettings) Which created new pages and tables in the db used to edit global site settings instead of lumping stuff in the settings.py
The problem is that these pages weren't strictly admin pages and the context wasn't passed through to them. This meant that when admin-shortcuts wanted to use the context it couldn't find it.
I ended up dropping dbsettings because it wasn't quite as versatile as what I wanted. I ended up creating models wherein the the site itself was a foreign key and the settings attributed to that key (I have examples if wanted).
Alesdotio, do you find that having the context in there is particularly beneficial? The problem being that it ties the use of the app to the django admin as opposed to being able to use it elsewhere. Obviously the name of the app is admin-shortcuts so it is implied that it provides shortcuts for the admin! But food for thought I guess.
from django-admin-shortcuts.
the context was added in this pull request #5
from django-admin-shortcuts.
Now it shouldn't raise a KeyError anymore. Does that help?
from django-admin-shortcuts.
Related Issues (20)
- Customizing the icons
- Index only HOT 4
- Usage of ``count`` and ``count_new`` at the same time. HOT 1
- 'str' object does not support item assignment on admin_shortcuts/templates/admin/index.html HOT 1
- How to set Count and Count new HOT 2
- caching
- (enhancement) extending django-admin-shortcuts to all app pages in admin HOT 4
- Solution regarding compatibility issue with django-admin-interface
- The right way to extend index.html HOT 2
- Django 1.3: 'admin_static' is not a valid tag library HOT 1
- Django 2 HOT 3
- Python 3.4: Type str doesn't support the buffer API HOT 1
- Version 2.0.0 Incompatible with DjangoCMS Admin Style HOT 4
- Doesn't work with Grappelli HOT 5
- Allow no icons & remove external icon resources
- rtl support
- icon alignment
- 'admin_shortcuts_tags' is not a valid tag library: ImportError raised loading admin_shortcuts.templatetags.admin_shortcuts_tags: No module named importlib HOT 5
- KeyError at /admin/ HOT 3
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 django-admin-shortcuts.