# Django on localhost CORS error on setup process

**URL:** <https://community.forestadmin.com/t/django-on-localhost-cors-error-on-setup-process/4641>\
**Category:** Help me!\
**Tags:** setup\
**Created:** [May 5, 2022, 1:13pm UTC](https://community.forestadmin.com/t/django-on-localhost-cors-error-on-setup-process/4641 "2022-05-05T13:13:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThibautLucas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/thibautlucas/32/4434_2.png) [@ThibautLucas](https://community.forestadmin.com/u/ThibautLucas)\
**Post date:** [May 5, 2022, 1:13pm UTC](https://community.forestadmin.com/t/django-on-localhost-cors-error-on-setup-process/4641/1 "2022-05-05T13:13:08Z")

</div>

## Feature(s) impacted

The “Add new data source” process for Django

## Observed behavior

Once the Package installed, app added to settings.py and FOREST dict added, forestadmin try to call the /forest endpoint but get CORS error

## Expected behavior

## Failure Logs

## Context

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/c/cdc430af58070a5c77c5f3ba39e70d4995eb7c58.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/b/bbfaa31f93c1343139808697e16cb5613ecd9cea.png)

- Project name: Platform Usage
- Team name: Operations
- Environment name: Django
- Agent type & version: django-forestadmin==1.2.2
- Recent changes made on your end if any: …

---

<div class="post-metadata">

**Author:** ![anon6357957](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@anon6357957](https://community.forestadmin.com/u/anon6357957)\
**Post date:** [May 5, 2022, 1:23pm UTC](https://community.forestadmin.com/t/django-on-localhost-cors-error-on-setup-process/4641/2 "2022-05-05T13:23:27Z")

</div>

Hi @ThibautLucas ,

Did you add the `init_forest()` in your wsgi.py (or asgi.py) file, as explained in the onboarding process ?

Thank’s

---

<div class="post-metadata">

**Author:** ![ThibautLucas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/thibautlucas/32/4434_2.png) [@ThibautLucas](https://community.forestadmin.com/u/ThibautLucas)\
**Post date:** [May 5, 2022, 1:26pm UTC](https://community.forestadmin.com/t/django-on-localhost-cors-error-on-setup-process/4641/3 "2022-05-05T13:26:18Z")

</div>

Yep 🙂 on wsgi.py file not the asgi.py one, should I ?

---

<div class="post-metadata">

**Author:** ![anon6357957](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@anon6357957](https://community.forestadmin.com/u/anon6357957)\
**Post date:** [May 5, 2022, 2:03pm UTC](https://community.forestadmin.com/t/django-on-localhost-cors-error-on-setup-process/4641/4 "2022-05-05T14:03:15Z")

</div>

Depends if you deploy Django with the Asgi mode or with the Wsgi mode ?  
Could you copy/paste your settings file and your wsgi file without your credentials please.
