Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name 'url' from 'django.urls' #51

Open
VFansss opened this issue Aug 13, 2020 · 0 comments
Open

cannot import name 'url' from 'django.urls' #51

VFansss opened this issue Aug 13, 2020 · 0 comments

Comments

@VFansss
Copy link

VFansss commented Aug 13, 2020

Hi!

Before all: thanks for doing everything! 😄

I'm trying to install the package on my website, and I'm following the readme.md

On THIS part of the readme, you are doing:

from django.urls import url, include

urlpatterns = [
    ...
    url('', include('pwa.urls')),  # You MUST use an empty string as the URL prefix
    ...
]

But I don't know if I'm doing something wrong (I'm don't know python perfectly) but including your snipper (aka the url inside urlpatterns in the main app/urls.py) gave me this error:

ImportError: cannot import name 'url' from 'django.urls'

Because I usually include a "path" and not an "url" inside "urlpatterns" list, and I saw that in your demo you done the same, I've changed it in a more familiar:

urlpatterns = [
    ...
    path('', include('pwa.urls')),  # You MUST use an empty string as the URL prefix
    ...
]

And is working.

Is the readme.md wrong or there's something I didn't get in django, python or django-pwa?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant