40
change_form.html
contains the following url tag:
{% url 'admin:app_list' app_label=opts.app_label %}
So you should pass the opts
variable to the template context:
data = {'test': 'test',
'opts': MyModel._meta}
UPDATE: The change_form.html
template uses the {% submit_row %}
template tag which requires some other context variables so the data
dictionary should be like this:
data = {'test': 'test',
'opts': MyModel._meta,
'change': True,
'is_popup': False,
'save_as': False,
'has_delete_permission': False,
'has_add_permission': False,
'has_change_permission': False}
3
This is caused most likely because you have a {% url %}
tag that is trying to link to the app_list. It could be in your admin/form_change.html or in some other included/extended template.
This is usually caused by context that is not passed correctly such as if you have a tag that looks like {% url 'app_list' %}
or {% url 'app_list' var %}
and the var
is empty.
- [Django]-Django – No module named _sqlite3
- [Django]-UUID as default value in Django model
- [Django]-Django – getting Error "Reverse for 'detail' with no arguments not found. 1 pattern(s) tried:" when using {% url "music:fav" %}
-1
I know it is late answer but for those who is struggle with that now like me, it is because of {% for fieldset in adminform %} adminform – is a form passed as context in change_form.html, however I currently have no idea how to pass it in my extension… Appreciate any comments.
- [Django]-How to run a celery worker with Django app scalable by AWS Elastic Beanstalk?
- [Django]-Nginx doesn't serve static
- [Django]-Warning: Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'