1👍
You can use raw_id_fields
class CompanyAdmin(admin.ModelAdmin):
raw_id_fields = ("cities",)
1👍
23000 is actually “nothing” for a database.
First, you need to identify the “culprit” of a slowdown, which query is slow. This is where django-debug-toolbar
would help a lot. Then, you can run the queries manually with EXPLAIN
and see what can be improved – for example, adding indexes could help.
Also, consider using django-cache-machine
or johnny-cache
packages.
Also see:
- [Answered ]-Django-admin brite force protection and more
- [Answered ]-In upgrading to Django 1.8, why do I get the AttributeError 'ManyToManyRel' object has no attribute 'rel'?
- [Answered ]-Django unused method arguments
- [Answered ]-Django – Change timeuntil language without changing application language
Source:stackexchange.com