# Django ORM as a standalone library

**URL:** <https://forum.djangoproject.com/t/django-orm-as-a-standalone-library/4971>\
**Category:** Using the ORM\
**Created:** [October 27, 2020, 1:27pm UTC](https://forum.djangoproject.com/t/django-orm-as-a-standalone-library/4971 "2020-10-27T13:27:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![carltongibson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/carltongibson/32/267_2.png) [@carltongibson](https://forum.djangoproject.com/u/carltongibson)\
**Post date:** [October 27, 2020, 1:52pm UTC](https://forum.djangoproject.com/t/django-orm-as-a-standalone-library/4971/2 "2020-10-27T13:52:41Z")

</div>

This works:

```auto
import os 
import django 

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
django.setup()

# And you're good... 

```

You can do `settings.configure()` if you don’t want to provide the settings module.

I hope that helps.

---

_[View the full topic](https://forum.djangoproject.com/t/django-orm-as-a-standalone-library/4971)._
