Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
django-import-export not showing in admin

I have a problem with django import-export tool. Simmilat to the one described in This topic. Problem is there is no solution for the problem posted there and I need it badly. Buttons for import/export in my admin panel do not show up. Did change the order of declaration, run collectstatic, restarted server ...

I could use your help django masters.

 from django.contrib import admin
    #from actions import export_to_csv
    from import_export import resources
    from import_export.admin import ImportExportModelAdmin, ImportExportMixin, ImportMixin, ExportActionModelAdmin, ImportExportActionModelAdmin
    from .models import Library
    from datetime import datetime
    from django import forms
    from redactor.widgets import RedactorEditor

     # registered models

    class LibraryResource(resources.ModelResource):

        class Meta:
            model = Library

    class LibraryAdmin(ImportExportModelAdmin, admin.ModelAdmin):
        resource_class = LibraryResource

        list_display = ...
        list_display_links = ...
        search_fields =...
        list_filter = ...


        def name(self, obj):
            return obj.library.name
            name.admin_order_field  = 'name'  #Allows column order sorting
            name.short_description = 'Biblioteka'
about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Remove , admin.ModelAdmin from this line and it should start working: class LibraryAdmin(ImportExportModelAdmin, admin.ModelAdmin):

about 4 years ago · Santiago Trujillo Report

0

  1. After installing the django-import-export package using:

    pip install django-import-export

  2. Within the settings.py file, add 'import_export' to the list of installed apps:

    INSTALLED_APPS = [ ... 'import_export' ... ]

  3. Within the admin.py file, here is how to use the import_export package:

    from django.contrib import admin

    from import_export.admin import ImportExportModelAdmin

    from .models import Bot

    admin.site.register(Bot, ImportExportModelAdmin)

about 4 years ago · Santiago Trujillo Report

0

In my case, I was overriding Django admin list template:

{% extends "admin/change_list.html" %}

{% block object-tools-items %}
  {{ block.super }}

  <Code>
{% endblock %}

But in order for import_export buttons to appear, you need to override their template, so the first line should be:

{% extends "admin/import_export/change_list_import_export.html" %}
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!