How to run test database in Django?

What is the best way to performance test a Django app?

  • What techniques would you use to analyze the database interactivity within the app to identify bottlenecks?  Since the database query design is largely abstracted from Django, I'm looking for the best methods on how to find issues before you run into them with users.

  • Answer:

    In the last Django application I worked on, I used the Django debug toolbar to check all the SQL that was ran. http://pypi.python.org/pypi/django-debug-toolbar/ It's not your average profiler, obviously, but it was immensely useful and pointed out where I had code that ended up generating hundreds of SQL queries. Django can also log it's SQL queries: https://docs.djangoproject.com/en/1.4/topics/logging/ If you're making lots of queries, it will be very obvious, very quickly.

Rob Roland at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.