# I want to configure agent APM Python Django with Elastic Agent

**URL:** <https://discuss.elastic.co/t/i-want-to-configure-agent-apm-python-django-with-elastic-agent/312029>\
**Category:** Elastic Agent\
**Created:** [August 12, 2022, 5:24pm UTC](https://discuss.elastic.co/t/i-want-to-configure-agent-apm-python-django-with-elastic-agent/312029 "2022-08-12T17:24:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![odelacruzc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/odelacruzc/32/48992_2.png) [@odelacruzc](https://discuss.elastic.co/u/odelacruzc)\
**Post date:** [August 12, 2022, 5:24pm UTC](https://discuss.elastic.co/t/i-want-to-configure-agent-apm-python-django-with-elastic-agent/312029/1 "2022-08-12T17:24:03Z")

</div>

I want to configure agent APM Python Django with Elastic Agent, but don't know where this configuration goes, what es the file or filepath please?

//

# Add the agent to the installed apps

INSTALLED\_APPS = (  
'elasticapm.contrib.django',

# ...

)

ELASTIC\_APM = {

# Set the required service name. Allowed characters:

# a-z, A-Z, 0-9, -, \_, and space

#'SERVICE\_NAME': 'unknown-python-service',

# Use if APM Server requires a secret token

'SECRET\_TOKEN': '\*\*\*\*\*\*',

# Set the custom APM Server URL (default: [http://localhost:8200](http://localhost:8200))

'SERVER\_URL': '\*\*\*\*\*\*\*\*\*\*\*\*',

# Set the service environment

'ENVIRONMENT': 'production',  
}

# To send performance metrics, add our tracing middleware:

MIDDLEWARE = (  
'elasticapm.contrib.django.middleware.TracingMiddleware',  
#...  
)  
//

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 9, 2022, 5:24pm UTC](https://discuss.elastic.co/t/i-want-to-configure-agent-apm-python-django-with-elastic-agent/312029/2 "2022-09-09T17:24:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
