Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Configure IPython configuration dir in the API (#4376)

Dhruv Bhanushalida24631c234e
diff --git a/api/.gitignore b/api/.gitignore
index 4345cc69e..a2249689b 100644
--- a/api/.gitignore
+++ b/api/.gitignore
@@ -14,3 +14,11 @@ openapi.json
# Schemathesis
.hypothesis
+
+# IPython (except startup scripts)
+.ipython/*
+!.ipython/profile_default/
+.ipython/profile_default/*
+!.ipython/profile_default/startup/
+.ipython/profile_default/startup/*
+!.ipython/profile_default/startup/*.py
diff --git a/api/.ipython/profile_default/startup/10_imports.py b/api/.ipython/profile_default/startup/10_imports.py
new file mode 100644
index 000000000..2c189a6b7
--- /dev/null
+++ b/api/.ipython/profile_default/startup/10_imports.py
@@ -0,0 +1,3 @@
+from django.conf import settings as settings
+
+from api.models import * # noqa: F403
diff --git a/api/env.docker b/api/env.docker
index 179c61027..e31d7a5cc 100644
--- a/api/env.docker
+++ b/api/env.docker
@@ -23,3 +23,5 @@ SEMANTIC_VERSION=1.0.0
ELASTICSEARCH_URL=es
WATERMARK_ENABLED=True
+
+IPYTHONDIR=/api/.ipython
diff --git a/api/env.template b/api/env.template
index 011040586..aa920195a 100644
--- a/api/env.template
+++ b/api/env.template
@@ -57,3 +57,5 @@ IS_PROXIED=False
FILTER_DEAD_LINKS_BY_DEFAULT=False
ENABLE_FILTERED_INDEX_QUERIES=True
# SHOW_COLLECTION_DOCS=True
+
+IPYTHONDIR=/api/.ipython