GithubHelp home page GithubHelp logo

Comments (20)

JohnVonNeumann avatar JohnVonNeumann commented on July 19, 2024 2

@aaguiarz I'm back on this problem (probably about to burn a branch), have you guys gotten that Django2.0 version out yet?

from auth0-django-web-app.

slivingston avatar slivingston commented on July 19, 2024 1

is the error that you get like the following?

'Specifying a namespace in include() without providing an app_name '
django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.

from auth0-django-web-app.

aaguiarz avatar aaguiarz commented on July 19, 2024

The sample is written for Django 1.x, we'll be porting it to Django 2 in the next few weeks.

from auth0-django-web-app.

brianjenkins94 avatar brianjenkins94 commented on July 19, 2024

Thanks for your reply.

I'm going to give it another honest try once I familiarize myself more with Django and Auth0.

It's great to hear that you guys are planning to keep up with the latest frameworks though. I also need to debug an issue I am encountering with the dotnetcore 2.0 sample so if I make any traction on either of these projects I will certainly make a pull request with my contributions.

Worst case scenario I learn something. 😄

from auth0-django-web-app.

JohnVonNeumann avatar JohnVonNeumann commented on July 19, 2024

I got it working (not nicely) in Django2.0, if anyone has questions and even suggestions until the tutorial is updated, feel free to hit me up or tag me with your suggestions.

from auth0-django-web-app.

aaguiarz avatar aaguiarz commented on July 19, 2024

If someone has a PR to submit, we'll happily review it ;)

from auth0-django-web-app.

JohnVonNeumann avatar JohnVonNeumann commented on July 19, 2024

Alright I got it working fine in Django2.0.4. The only thing I changed was my URLConf to actually use Django2 syntaxing, and make sure your callback url is set to http://localhost:3000/complete/auth0

Note: I didn't actually use this example, I used the quick start django guide on the site.

from auth0-django-web-app.

bld2104 avatar bld2104 commented on July 19, 2024

I am having the exact same problem and would appreciate help! I tried changing

url(r'^', include('django.contrib.auth.urls', namespace='auth')),
url(r'^', include('social_django.urls', namespace='social')),

to:

path('auth/', include('django.contrib.auth.urls')),
path('social/', include('social_django.urls')),

That doesn't give me an error, but it also doesn't work :/ Any idea what I'm missing? @JohnVonNeumann

from auth0-django-web-app.

FlipperPA avatar FlipperPA commented on July 19, 2024

@bld2104 In Django 1.x, the namespace argument was kept in URLs, but this didn't make much sense as it is used in the app itself. So in Django 2.0, this was replaced by moving the app_name in its place into the app itself, in the urls.py file. I checked social_django and version 2.1 seems to be Django 2.0 compatible (it has an app_name in its urls.py); you can see it here: https://github.com/python-social-auth/social-app-django/blob/master/social_django/urls.py#L11

I noticed your routes in Django 1.x are at the root of the site, and in the 2.x version, they are not. Have you tried this under Django 2.x?

from django.urls import re_path

...

urlpatterns = [
    re_path(r'^', include('django.contrib.auth.urls')),
    re_path(r'^', include('social_django.urls')),
]

from auth0-django-web-app.

bld2104 avatar bld2104 commented on July 19, 2024

Thank you @FlipperPA ! That solved the error, but now when I try to go to the login page, I get this error:

"ModuleNotFoundError at /login/auth0
No module named '[MY_PROJECT_NAME].auth0backend'"

If I add app_name = '[MY_APP_NAME]' to my_app/urls.py, I then get this error:

"NoReverseMatch at /login/auth0
'social' is not a registered namespace"

Guidance here is much appreciated if possible @brianjenkins94 @slivingston @aaguiarz @JohnVonNeumann

from auth0-django-web-app.

bld2104 avatar bld2104 commented on July 19, 2024

Making progress on this - turns out I had auth0backend.py in the wrong place. Once I moved it I am now getting the following error on line 15 of auth0backend.py:

"must be str, not NoneType"

from auth0-django-web-app.

bld2104 avatar bld2104 commented on July 19, 2024

If I change self.setting('DOMAIN') in that line to my Auth0 domain it seems to work, but is this really a good idea? Is there a way to define the DOMAIN somewhere or a reason this is breaking? If it doesn't matter, I can just go in and manually chance all of the self.setting('DOMAIN') instances to my Auth0 domain. Still would appreciate guidance!

from auth0-django-web-app.

bld2104 avatar bld2104 commented on July 19, 2024

Update: Jose in support let me know that I can manually type in my domain. That worked, but now I'm facing the error: no such table: social_auth_usersocialauth. I keep trying to run python manage.py migrate, and have followed these instructions but nothing is working.

https://github.com/omab/python-social-auth/blob/master/MIGRATING_TO_SOCIAL.md#django
https://stackoverflow.com/questions/42545981/no-such-table-social-auth-usersocialauth

from auth0-django-web-app.

windhamwong avatar windhamwong commented on July 19, 2024

As Django 2.0 is using Python 3, make sure you update the library python-jose file jsoe.py to Py3 format, i.e. print().

from auth0-django-web-app.

bld2104 avatar bld2104 commented on July 19, 2024

Thank you for responding @windhamwong ! I checked every file in the jose package and can't find a print statement anywhere. I think you are correct that it has to do with Django 2.0 though, because Auth0 support said that they couldn't replicate the problem on django 1.11 with social-app-auth-django 2.1.0. My requirements.txt file is attached (some of those I'm not using and need to delete, I realize the file is long!)

requiremenets.txt

from auth0-django-web-app.

d33tah avatar d33tah commented on July 19, 2024

@JohnVonNeumann could you describe what problem you are having?

from auth0-django-web-app.

aaguiarz avatar aaguiarz commented on July 19, 2024

Re: Django2, not yet, we don't have a date for it yet.

from auth0-django-web-app.

riodw avatar riodw commented on July 19, 2024

Are their any updates for this?

from auth0-django-web-app.

albertoperdomo avatar albertoperdomo commented on July 19, 2024

Hello @riodw - See #19
Quickstart and sample will be updated in the coming days.

from auth0-django-web-app.

avanibhatnagar avatar avanibhatnagar commented on July 19, 2024

@JohnVonNeumann, I know you commented a while ago. But I followed the quickstart guide completely for Django. I am able to authenticate 2 different apps but not using the same universal login - I have raised an issue here:
#27

Let me know if you have any suggestions!

from auth0-django-web-app.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.