Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Unable to integrate django application running in elasticbeanstalk with new relic


My configs:

new relic.conf:
newrelic: []

command: newrelic-admin generate-config [REDACTED INFO] newrelic.ini
from sys import version_info
print('my python version '+str( version_info[0]))

import newrelic.agent
import os
newrelic.agent.initialize(os.path.join(os.path.dirname(file), “newrelic.ini”))

os.environ.setdefault(“DJANGO_SETTINGS_MODULE”, “clickpost.settings”)

from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise

application = get_wsgi_application()
application = DjangoWhiteNoise(application)

Each time i deploy code i get error ImportError: No module named ‘newrelic’

Please help me out. It’s been long time i am stuck here,



@deepanshu.kartikey Thanks for your post. Would you happen to be using a virtual environment? If so, is the Python agent installed in the same virtual environment as your Django app?

Also, on a side note, there are two primary ways to integrate the Python agent with a Django app .

  1. Using the newrelic-admin wrapper script command.
  2. Manually integrating (described here).

Are you using both methods?