Search code examples
pythondjangodjango-dev-server

Turning off model validation on Django dev-server


Stage of models validation is most longest in Django dev-server startup. And in my case it mostly waste of time, since my models сhanging infrequently.

Is there way to turn off this?


Solution

  • This is not possible without modifying the source code of Django (which is not recommended). The only validation Django does on start-up is to check if the syntax of your model code is okay or not. It should not take more than 2-3 seconds. So, there are few other initialization are being done during startup which are also taking time.

    During development, you do not need to restart the server every time you modify the code- especially if you are not touching the definition of the models at all. The Django dev server automatically reloads itself if it detects any change in your code. So, leave it running while you develop and hopefully your experience will improve.