There can be no permanent reference to this accepted and corresponding answer to your question. So just pasting it: -
server = request.META.get('wsgi.file_wrapper', None) if server is not None and server.__module__ == 'django.core.servers.basehttp': print 'inside dev'
Of course, wsgi.file_wrapper can be installed on META and have a class from a module named django.core.servers.basehttp using extreme matching in a different server environment, but I hope this affects you.
PS: see How do I know if a Django application is running on a development server? More details
Godman
source share