# Auth0 for Django App on IOS - Problem

**URL:** <https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349>\
**Category:** Get Help\
**Tags:** django, ios\
**Created:** [June 9, 2020, 6:11am UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349 "2020-06-09T06:11:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![it18](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/it18/32/15311_2.png) [@it18](https://community.auth0.com/u/it18)\
**Post date:** [June 9, 2020, 6:11am UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/1 "2020-06-09T06:11:19Z")

</div>

I have a django web application that implements auth0 and works beautifully on any browser on pcs, macs and android, but when users started trying to go to my website from an iOS device (iphone, ipad, etc.), they found that when they try to type in their email or use Google or another authentication method, the device asks to download a file and then downloads a file called “en” and does nothing.

Has anyone else experienced such an issue? Any ideas what the problem is?

Thank you.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 9, 2020, 1:21pm UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/2 "2020-06-09T13:21:17Z")

</div>

Hey there!

Can you tell us what element of our stack are you using? Any docs / quickstarts links? Screenshots of the situation? Thanks!

---

<div class="post-metadata">

**Author:** ![it18](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/it18/32/15311_2.png) [@it18](https://community.auth0.com/u/it18)\
**Post date:** [June 9, 2020, 1:35pm UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/3 "2020-06-09T13:35:23Z")

</div>

I used the Django SDK quickstart. Here are some screenshots. After clicking to login, I get a document to download at the bottom.

 ![pic1](https://global.discourse-cdn.com/auth0/original/3X/d/7/d7fb88cddcdc0981c619326ed103fbbb439d32ad.png) . After clicking to download, the screen looks like this: ![pic2](https://global.discourse-cdn.com/auth0/original/3X/5/9/59e4ad213002cf07ae415b61d2fd1636578db06b.png).  
When I opened the document in Notepad++, it was the html file that auth0 should redirect to that was downloaded instead of rendered.  
On the website on the iOS device, it just keeps hanging.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 9, 2020, 1:59pm UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/4 "2020-06-09T13:59:44Z")

</div>

Can you raise that issue directly in the Django SDK repo on GitHub so we can work most effectively with the maintainer? Make sure to share the link to the issue here so we can ping them. Thanks!

---

<div class="post-metadata">

**Author:** ![it18](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/it18/32/15311_2.png) [@it18](https://community.auth0.com/u/it18)\
**Post date:** [June 14, 2020, 7:14am UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/5 "2020-06-14T07:14:16Z")

</div>

I did post this issue on github. I figured I would update my comments here as well in case anyone has experienced a similar issue. [Auth0 for Django App on iOS causes application to download html instead of render · Issue #218 · auth0/auth0-python · GitHub](https://github.com/auth0/auth0-python/issues/218)

I have narrowed the issue down to this: If I require login through auth0 and pass a context in the view the application has the behavior described above. If I don’t require login, passing a context is no problem. If I don’t pass a context, requiring login through auth0 is no problem. Again this issue only exists on iOS devices.

Even passing an empty context causes a problem.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 15, 2020, 8:41am UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/6 "2020-06-15T08:41:06Z")

</div>

Thanks for providing that context! I pinged repo maintainers regarding the issue

---

<div class="post-metadata">

**Author:** ![it18](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/it18/32/15311_2.png) [@it18](https://community.auth0.com/u/it18)\
**Post date:** [June 17, 2020, 6:15am UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/7 "2020-06-17T06:15:32Z")

</div>

Ok. I figured this out. Problem is solved.  
In the Django SDK, you show that you should pass in what I thought was an extra parameter for auth0:  
{  
‘auth0User’: auth0user,  
‘userdata’: json.dumps(userdata, indent=4)  
}

Not realizing that the above is the context parameter, I also added my own context in the return statement of the view like this:  
return render(request, ‘mypage.html’, context, { ‘auth0User’: auth0user, ‘userdata’: json.dumps(userdata, indent=4)} )  
So for some reason this worked on pcs and androids to pass in two contexts, but iOS didn’t like it.

Once I combined the two contexts  
return render(request, ‘mypage.html’, {‘contextvar1’: ‘data’, ‘contextvar2’: ‘moredata’, ‘auth0User’: auth0user, ‘userdata’: json.dumps(userdata, indent=4)} )  
everything works.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [June 17, 2020, 10:57am UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/8 "2020-06-17T10:57:19Z")

</div>

Perfect! Thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 2, 2020, 10:57am UTC](https://community.auth0.com/t/auth0-for-django-app-on-ios-problem/44349/9 "2020-07-02T10:57:23Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
