# Backend code

**URL:** https://meta.discourse.org/t/backend-code/257537
**Category:** Development
**Created:** [March 8, 2023, 8:29pm UTC](https://meta.discourse.org/t/backend-code/257537 "2023-03-08T20:29:43Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 8, 2023, 8:38pm UTC](https://meta.discourse.org/t/backend-code/257537/3 "2023-03-08T20:38:24Z")

</div>

> [@Julien\_Bonnier](#):
>
> I’m trying to find a way to execute some code in the backend.

You will need to write a plugin for that. See [Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/developing-discourse-plugins-part-1-create-a-basic-plugin/30515).

> [@Julien\_Bonnier](#):
>
> The ultimate goal is to call the Maxmind API and redirect users coming from outside of Quebec to another site.

No need for API calls, as Discourse ships with MaxMind integration out of the box, and you can simply call `DiscourseIpInfo.get(ip)` from your plugin.

> [@Julien\_Bonnier](#):
>
> I found this [post](https://meta.discourse.org/t/theme-component-v-plugin-whats-the-difference/153951) and I understand that to do this I would have to use a self-hosted Discourse.

If you are on our hosting, please contact our support. We can help you with custom plugins in our Enterprise plan.

---

_[View the full topic](https://meta.discourse.org/t/backend-code/257537)._
