Q:

Multi settings in Django

I've created in my project settings folder, where I handle development and production. I've added an extra application in production file:
INSTALLED_APPS += [
    'google_analytics'] 

Now I need to add re_path('djga/', include('google_analytics.urls')) to main urls.py. How i can add it when settings are in production mode?

A:

You can check from DEBUG = True/ Flase from settings varible. make condition in urls.py 
if settings.DEBUG:
    urlpatterns += re_path('djga/', include('google_analytics.urls'))

