Amritha Menon
Amritha Menon

Reputation: 145

Django import-export buttons DO NOT appear in admin screen

I followed the django import-export manual but the Import Export buttons do not appear in my admin screen.

This is what I have in my admin.py. Is there anything else I need to do? I have added import-export to my settings.py.

from django.contrib import admin
from costtool import models as m
from costtool.models import UserProfile, Prices
from import_export import resources
from import_export.admin import ImportExportModelAdmin, ImportMixin

class PriceResource(resources.ModelResource):
    class Meta:
        model = Prices

class PriceAdmin(ImportExportModelAdmin):
    resource_class = PriceResource
    pass

admin.site.register(UserProfile)
admin.site.register(Prices)

Upvotes: 2

Views: 1717

Answers (1)

Mounir
Mounir

Reputation: 11726

Just tell the admin what ModelAdmin to use:

admin.site.register(Prices, PriceAdmin)

You can check Django's ModelAdmin doc and try to use the new register decorator if you're using Django 1.7

Upvotes: 6

Related Questions