Hello @kartik,
You have to override get_changeform_initial_data method in your model Admin class in admin.py as follows:
# admin.py
class ClientDetailsAdmin(admin.ModelAdmin):
def get_changeform_initial_data(self, request):
get_data = super(ClientDetailsAdmin, self).get_changeform_initial_data(request)
get_data['created_by'] = request.user.pk
return get_data
admin.site.register(ClientDetails, ClientDetailsAdmin)
In such way you obtain the most elegant solution since the created_by field is filed up when you create new record.
Hope this works!