{"componentChunkName":"component---src-templates-doc-tsx","path":"/product/sentry-basics/guides/integrate-backend/getting-started/","result":{"data":{"file":{"id":"a49da518-1748-542e-ae0d-06937bd796f5","relativePath":"product/sentry-basics/guides/integrate-backend/getting-started.mdx","sourceInstanceName":"docs","childMarkdownRemark":null,"childMdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Getting Started\",\n  \"redirect_from\": [\"/guides/integrate-backend/getting-started/\"]\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar CodeTabs = makeShortcode(\"CodeTabs\");\nvar CodeBlock = makeShortcode(\"CodeBlock\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"In this tutorial, you will import the backend app source code into your local development environment, add the Sentry SDK, and initialize it.\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Note:\"), \" If you're using your source code you can skip this tutorial and instead\"), mdx(\"ul\", {\n    parentName: \"blockquote\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Follow the instructions in our \", mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"/platforms/python/guides/django/\"\n  }), \"Getting Started\"), \" docs. Notice that you can select the desired platform.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"Continue with \", mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"/guides/integrate-backend/configuration-options/\"\n  }), \"Configuration Options\")))), mdx(\"h2\", {\n    \"id\": \"prerequisites\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#prerequisites\",\n    \"aria-label\": \"prerequisites permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Prerequisites\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"The demo app source code requires a \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Python\"), \" development environment to build install and run the application. Make sure that you have the following in place:\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"A source code editor (like \", mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://code.visualstudio.com\"\n  }), \"VS-Code\"), \")\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://www.python.org/download/releases/3.0/\"\n  }), \"Python3\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"/product/cli/\"\n  }), \"Sentry-CLI\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"https://www.npmjs.com/\"\n  }), \"NPM\")))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"To start monitoring errors in your application you'll need to create a new project in your Sentry account. \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Please\"), \" view the \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/guides/integrate-frontend/create-new-project/\"\n  }), \"frontend tutorial\"), \" to learn more about how to create a project and define alert rules.\"))), mdx(\"h2\", {\n    \"id\": \"step-1-get-the-code\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#step-1-get-the-code\",\n    \"aria-label\": \"step 1 get the code permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Step 1: Get the Code\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Open the sample \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://github.com/sentry-tutorials/backend-monitoring\"\n  }), \"code repository\"), \" on GitHub\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Click on \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Fork\"), \" and select the target GitHub account you wish this repository to be forked in to\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Once the fork is complete, click on \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Clone or download\"), \" and copy the repository HTTPS URL\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"span\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1200px\"\n    }\n  }), \"\\n      \", mdx(\"a\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/20ead6ebffebdd023b3958c9b801a9e4/166a3/fork_n_clone.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }), \"\\n    \", mdx(\"span\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"34.66666666666667%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAIAAACHqfpvAAAACXBIWXMAAAsSAAALEgHS3X78AAABM0lEQVQY0x1RSW4cMQzs//8hf4ifECAPiH30gozt9sy0WislSiK1hTFQKBDgUkVyC5Uvji6+XRy/av7r2othWwetlccsU7CEU2s6RmzNYo5E38ybx/x+6CvUt8PvPquIZ8pnTC5nXwsQmZQSt1J75aEAAhH2LrOwj41byxkLUW1trtnmaGNw7zxGIsrMWEkj/P7486ReU62SHWsJqPetMCsf7sYGzDJCIOk+J/dx+mBjhFSuoH88/nx4/qWMUdqAeJFa5q32bsQkovDhgoYolhJ3C3G/fr3v+00pRCRs1GYq1ThZtPQx5lrbCeXlZncDdyhHrLeQJbB1Ruo2ZQ0IOYvWESIyYSmCtZZ0jjk3qP1Te5tSpAbEZ4h30Y/oCskVr6HKO1Sir1CBmgOwzstF5vzf/w81no9gH/pruwAAAABJRU5ErkJggg==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  })), \"\\n  \", mdx(\"img\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"Clone Repository\",\n    \"title\": \"Clone Repository\",\n    \"src\": \"/static/20ead6ebffebdd023b3958c9b801a9e4/c1b63/fork_n_clone.png\",\n    \"srcSet\": [\"/static/20ead6ebffebdd023b3958c9b801a9e4/5a46d/fork_n_clone.png 300w\", \"/static/20ead6ebffebdd023b3958c9b801a9e4/0a47e/fork_n_clone.png 600w\", \"/static/20ead6ebffebdd023b3958c9b801a9e4/c1b63/fork_n_clone.png 1200w\", \"/static/20ead6ebffebdd023b3958c9b801a9e4/d61c2/fork_n_clone.png 1800w\", \"/static/20ead6ebffebdd023b3958c9b801a9e4/166a3/fork_n_clone.png 1980w\"],\n    \"sizes\": \"(max-width: 1200px) 100vw, 1200px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\"\n  })), \"\\n  \"), \"\\n    \"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Clone the forked repository to your local environment\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \">\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"git\"), \" clone \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"<\"), \"repository HTTPS url\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \">\")))))))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Now that the sample code is available locally, open the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"backend-monitoring\"), \" project in your preferred code editor\"))), mdx(\"h2\", {\n    \"id\": \"step-2-enable-commit-tracking-for-your-repository\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#step-2-enable-commit-tracking-for-your-repository\",\n    \"aria-label\": \"step 2 enable commit tracking for your repository permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Step 2: Enable Commit Tracking for your Repository\"), mdx(\"p\", null, \"Sentry can help you resolve your errors faster by suggesting a suspect commit that might have introduced the error into your codebase. This is enabled by configuring \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Commit Tracking\"), \". Integrating your source code management solution and adding your code repositories is required to enable commit tracking, for more information see \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/releases/?platform=node#associate-commits-with-a-release\"\n  }), \"this link\"), \".\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Open your Sentry account and navigate to \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"Settings > Integrations\"), \" to enable the GitHub integration and add your \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"backend-monitoring\"), \" repository. For more information follow the steps described in \", mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"/product/integrations/github/\"\n  }), \"Global Integrations > GitHub\"), \".\")), mdx(\"h2\", {\n    \"id\": \"step-3-install-the-sdk\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#step-3-install-the-sdk\",\n    \"aria-label\": \"step 3 install the sdk permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Step 3: Install the SDK\"), mdx(\"p\", null, \"Sentry captures data by using a platform-specific SDK within your application runtime. To use the SDK, import, initialize and configure it in your source code.\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"To start working with the SDK in our Django app we install the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry-sdk\"), \" by defining the dependency in the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"requirements.txt\"), \" file. The SDK documentation and release information are available in the \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://github.com/getsentry/sentry-python\"\n  }), \"Sentry SDK\"), \" GitHub repository.\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Open the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"settings.py\"), \" file (located under \", \"_\", \"./backend-monitoring/myproject/settings.py). This is where we initialize and configure the Sentry SDK in our application.\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"After importing the Sentry SDK to the app, it is important to import the Sentry Django integration as well. Integrations extend the functionality of the SDK for some common frameworks and libraries.\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"python\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"python\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-python\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-python\"\n  }), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token keyword\"\n  }), \"import\"), \" sentry_sdk\\n \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token keyword\"\n  }), \"from\"), \" sentry_sdk\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \".\"), \"integrations\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \".\"), \"django \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token keyword\"\n  }), \"import\"), \" DjangoIntegration\"))))))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"In the Sentry SDK configuration, enter the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"dsn\"), \" key value you copied from the project created in the previous tutorial.\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"python\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"python\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-python\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-python\"\n  }), \"sentry_sdk\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \".\"), \"init\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"(\"), \"\\n    dsn\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"\\\"YOUR_DSN\\\"\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \",\"), \"\\n    integrations\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"[\"), \"DjangoIntegration\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"(\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \")\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"]\"), \"\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \")\"))))))))), mdx(\"h2\", {\n    \"id\": \"step-4-install-dependencies--run-the-demo-app\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#step-4-install-dependencies--run-the-demo-app\",\n    \"aria-label\": \"step 4 install dependencies  run the demo app permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Step 4: Install Dependencies & Run the Demo App\"), mdx(\"p\", null, \"To build and run the Demo application on your localhost\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Open a shell terminal and change directory to the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"backend-monitoring\"), \" project root folder\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"If you haven't installed Python3, do so by running the following:\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \" brew \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"install\"), \" python3\"))))))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Install \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"virtualenv\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"virtualenvwrapper\"), \":\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \" pip3 \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"install\"), \" virtualenv virtualenvwrapper\\n \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token builtin class-name\"\n  }), \"echo\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"\\\"source /usr/local/bin/virtualenvwrapper.sh\\\"\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \">>\"), \" ~/.bashrc\\n \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token builtin class-name\"\n  }), \"exec\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"bash\")))))))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Install Sentry's command-line tool to use release tracking and GitHub integration for commit data:\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"npm\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"install\"), \" -g @sentry/cli\"))))))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Setup and activate a Python 3 virtual environment in the project root.\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \" mkvirtualenv --python\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \"python3 sentry-demo-django\")))))), mdx(\"blockquote\", {\n    parentName: \"li\"\n  }, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"You can name the virtual environment whatever you feel that is appropriate, in our case we named it sentry-demo-django\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"To activate the virtual environment run:\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \" workon sentry-demo-django\"))))))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Open the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Makefile\"), \" included in the project's root folder. The file is used here to mimic a CI/CD flow.\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Follow the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"deploy\"), \" target execution flow.\"), mdx(\"blockquote\", {\n    parentName: \"li\"\n  }, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"Notice that in addition to installing Python requirements and running the server, we also utilize the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry-cli\"), \" to create a new Sentry Release, and associate commits to that release. Sentry will lookup through those commits when suggesting a suspect commit for your project issues.\\nCommands mentioned within the Makefile will be explained in detail in the next part \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/guides/integrate-backend/configuration-options/\"\n  }), \"Configuration Options\")))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"To execute the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sentry-cli\"), \" commands, follow the instructions described \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/guides/integrate-frontend/upload-source-maps/#step-1-prepare-the-build-environment\"\n  }), \"here\"), \" to obtain the values for your \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"SENTRY_AUTH_TOKEN\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"SENTRY_ORG\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"SENTRY_PROJECT\"), \" environment variables.\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"span\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1200px\"\n    }\n  }), \"\\n      \", mdx(\"a\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/1ad6e01f29904a11008817cddffff6c9/21b4d/makefile_config.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }), \"\\n    \", mdx(\"span\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"60.333333333333336%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAIAAADtbgqsAAAACXBIWXMAAAsSAAALEgHS3X78AAABnElEQVQoz31Sy07cQBD0d+CFeU9Pz9s2a28sWCIuICEunKJwjYTyBfmGnPPDac9GCRAlZcvutqe7q2qmA+fKeFmPd+XjQzkcD7f3dRiUUraB/RfdBRcsT/jlu/v6ozx/Wx8/3dwc13WNMYYQzhsu/oGOca4w5KeX8vRy+fB5vbo6LMv19XFpAABEpHW7hneNOs6YUbIk50FHBI8Y4oaUUq21NNAX6pJL0Vq/ru+IupQyZ3QIQiqKSbB8hd+pNoZz/nYy5/QDwJBGAEe9ae1JMDonhDix3Uj3Pb1o7nnLt+JTb+/dMORxzABWKWqgtLEaHI0Tki5BgdRW0E0xcdFmc1s1INpxrLmQ1Oi9JxcceltGG5JzzmqFMdtUoUwWnE8Zx70QvBVrTem8TPv9MM8TFVsS4AMdAOujkgJTNiFDrsoYtlHud7sz4t8RP2Fd3/fkCHlcyOEU8/wh1CnVwYVI20ESpHEKUCrNTl4x9kdz8DAvgyfDlRbNXtKm2rOB/zLp3T7rBlq/LPNYC9YRy7B5HQLtMEloYWCM/X3CfgLbaW2aqQ93AwAAAABJRU5ErkJggg==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  })), \"\\n  \", mdx(\"img\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"Makefile Config\",\n    \"title\": \"Makefile Config\",\n    \"src\": \"/static/1ad6e01f29904a11008817cddffff6c9/c1b63/makefile_config.png\",\n    \"srcSet\": [\"/static/1ad6e01f29904a11008817cddffff6c9/5a46d/makefile_config.png 300w\", \"/static/1ad6e01f29904a11008817cddffff6c9/0a47e/makefile_config.png 600w\", \"/static/1ad6e01f29904a11008817cddffff6c9/c1b63/makefile_config.png 1200w\", \"/static/1ad6e01f29904a11008817cddffff6c9/21b4d/makefile_config.png 1280w\"],\n    \"sizes\": \"(max-width: 1200px) 100vw, 1200px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\"\n  })), \"\\n  \"), \"\\n    \")), mdx(\"blockquote\", {\n    parentName: \"li\"\n  }, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"The sentry-cli can be configured by providing these values either through environment variables or through a dedicated configuration file. For more information see \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/cli/configuration/\"\n  }), \"Sentry CLI > Configuration and Authentication\")))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Run the following command to install the required Python libraries, set up the Sentry Release, and run the Django server:\"), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"make\"), \" deploy\")))))), mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"span\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1146px\"\n    }\n  }), \"\\n      \", mdx(\"a\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/8aa4989e7ee0e2ed9f2e10619795730d/fe9e8/run_django_server.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }), \"\\n    \", mdx(\"span\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"82.66666666666667%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAIAAABSJhvpAAAACXBIWXMAAAsSAAALEgHS3X78AAACH0lEQVQ4y31STY/aMBB1PiCOEzufJoQ4WdoLWvXKiQJV6ZbSC91m2Ugs0FUlpB76B/rz+0KARauWp2g0GXueZ+YN+fNz++v313JXrr6vqurxoXwoy7Kx2+12v9+v1+uqqp7WT7vtbn3CZrN5/vFMZh9no9HofY3xbPZpOv0wmUzGY5jp3d3n+2/3wHK5XK1W1WP15YD5fI7IYrEgSSI5Z67rCOHAiSI/DP0gEPiiyIuiwPfxG3DOTdMkr5B0uOsQh+mBr7uuTi3CbPxqlBLEDYNcQ5apIAg9z8MDvV4WS6lUrvIcryGSpmkYhpRS27Yty4JjGEa73YYDS6IoclG04+C2lBK3EYGvlJIyTg/odrudTocxdOe2Wi04uA86goPwACEEDsCHKtAhzkCPPjVNM/5X/TnZcRitYcVxnCQJKJD+zxTQHW0YxraNOeNhzDlyHJTG0a3nBbbNyHVIKTBYy9K5q9k2Pp0x3aa1L4TRamnXklG151Hutj1heoIyZnLeFiBEPiVm3aymn4BSG+eYfHv77qb/BvKkaSZlJ8+Lfv9tr6eK4kapAnHOXf8AaIFBYhbQAqOtk/McOgdhCIM+BW5ABowXx0cxr6ARUFyg0RDBxmIHmvGeR/3yOxgMeqhSKVgQYSUgFSggHorEwqDghv1Y6iWKokBOcgA0x+0syxABRbNziCiV4fRlTmcMh0M0BvpmsWCRUK/eaRlel3qBv1+TSbHMRt/AAAAAAElFTkSuQmCC')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  })), \"\\n  \", mdx(\"img\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"Deploy & Serve\",\n    \"title\": \"Deploy & Serve\",\n    \"src\": \"/static/8aa4989e7ee0e2ed9f2e10619795730d/fe9e8/run_django_server.png\",\n    \"srcSet\": [\"/static/8aa4989e7ee0e2ed9f2e10619795730d/5a46d/run_django_server.png 300w\", \"/static/8aa4989e7ee0e2ed9f2e10619795730d/0a47e/run_django_server.png 600w\", \"/static/8aa4989e7ee0e2ed9f2e10619795730d/fe9e8/run_django_server.png 1146w\"],\n    \"sizes\": \"(max-width: 1146px) 100vw, 1146px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\"\n  })), \"\\n  \"), \"\\n    \")), mdx(\"blockquote\", {\n    parentName: \"li\"\n  }, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"In the terminal, notice that a new release is created and commits are associated with it. Once the deploy finishes successfully, you'll see the confirmation in your terminal\")))), mdx(\"h2\", {\n    \"id\": \"next\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#next\",\n    \"aria-label\": \"next permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Next\"), mdx(\"p\", null, mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/guides/integrate-backend/configuration-options/\"\n  }), \"Configuration Options\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#prerequisites","title":"Prerequisites"},{"url":"#step-1-get-the-code","title":"Step 1: Get the Code"},{"url":"#step-2-enable-commit-tracking-for-your-repository","title":"Step 2: Enable Commit Tracking for your Repository"},{"url":"#step-3-install-the-sdk","title":"Step 3: Install the SDK"},{"url":"#step-4-install-dependencies--run-the-demo-app","title":"Step 4: Install Dependencies & Run the Demo App"},{"url":"#next","title":"Next"}]},"internal":{"type":"Mdx"}}}},"pageContext":{"excerpt":"In this tutorial, you will import the backend app source code into your local development environment, add the Sentry SDK, and initialize it. Note:  If you're using your source code you can skip this tutorial and instead Follow the instructions in our  Getting Started  docs. Notice that you can select the desired platform. Continue with  Configuration Options Prerequisites The demo app source code requires a  Python  development environment to build install and run the application. Make sure that you have the following in place: A source code editor (like  VS-Code ) Python3 Sentry-CLI NPM To start monitoring errors in your application you'll need to create a new project in your Sentry account.  Please  view the  frontend tutorial  to learn more about how to create a project and define alert rules. Step 1: Get the Code Open the sample  code repository  on GitHub Click on  Fork  and select the target GitHub account you wish this repository to be forked in to Once the fork is complete, click on  Clone or download  and copy the repository HTTPS URL Clone the forked repository to your local environment Now that the sample code is available locally, open the  backend-monitoring  project in your preferred code editor Step 2: Enable Commit Tracking for your Repository Sentry can help you resolve your errors faster by suggesting a suspect commit that might have introduced the error into your codebase. This is enabled by configuring  Commit Tracking . Integrating your source code management solution and adding your code repositories is required to enable commit tracking, for more information see  this link . Open your Sentry account and navigate to  Settings > Integrations  to enable the GitHub integration and add your  backend-monitoring  repository. For more information follow the steps described in  Global Integrations > GitHub . Step 3: Install the SDK Sentry captures data by using a platform-specific SDK within your application runtime. To use the SDK, import, initialize and configure it in your source code. To start working with the SDK in our Django app we install the  sentry-sdk  by defining the dependency in the  requirements.txt  file. The SDK documentation and release information are available in the  Sentry SDK  GitHub repository. Open the  settings.py  file (located under  _ ./backend-monitoring/myproject/settings.py). This is where we initialize and configure the Sentry SDK in our application. After importing the Sentry SDK to the app, it is important to import the Sentry Django integration as well. Integrations extend the functionality of the SDK for some common frameworks and libraries. In the Sentry SDK configuration, enter the  dsn  key value you copied from the project created in the previous tutorial. Step 4: Install Dependencies & Run the Demo App To build and run the Demo application on your localhost Open a shell terminal and change directory to the  backend-monitoring  project root folder If you haven't installed Python3, do so by running the following: Install  virtualenv  and  virtualenvwrapper : Install Sentry's command-line tool to use release tracking and GitHub integration for commit data: Setup and activate a Python 3 virtual environment in the project root. You can name the virtual environment whatever you feel that is appropriate, in our case we named it sentry-demo-django To activate the virtual environment run: Open the  Makefile  included in the project's root folder. The file is used here to mimic a CI/CD flow. Follow the  deploy  target execution flow. Notice that in addition to installing Python requirements and running the server, we also utilize the  sentry-cli  to create a new Sentry Release, and associate commits to that release. Sentry will lookup through those commits when suggesting a suspect commit for your project issues.\nCommands mentioned within the Makefile will be explained in detail in the next part  Configuration Options To execute the  sentry-cli  commands, follow the instructions described  here  to obtain the values for your  SENTRY_AUTH_TOKEN ,  SENTRY_ORG , and  SENTRY_PROJECT  environment variables. The sentry-cli can be configured by providing these values either through environment variables or through a dedicated configuration file. For more information see  Sentry CLI > Configuration and Authentication Run the following command to install the required Python libraries, set up the Sentry Release, and run the Django server: In the terminal, notice that a new release is created and commits are associated with it. Once the deploy finishes successfully, you'll see the confirmation in your terminal Next Configuration Options","title":"Getting Started","description":null,"draft":null,"noindex":null,"notoc":null,"sidebar_order":null,"redirect_from":["/guides/integrate-backend/getting-started/"],"keywords":null,"id":"a49da518-1748-542e-ae0d-06937bd796f5","legacy":false}},"staticQueryHashes":["1218203755","1222113826","1222113826","1766336459","2158593473","2764967025","3345802723","3818502851","3990806462","4015007367","4192517163","4264099332","518019976"]}