0

I'm a beginner to Django and trying to make a website where users can store their contacts in a list. So far I have been successful in adding list items via a form. However, I'm using cloud9 and path can't be imported and I'm trying to find a way around it but I can't. I've seen the documentation and this tutorial and they both use path.

  • Try using `url` – Umair Mohammad Jun 05 '18 at 07:31
  • Confirm that you're actually using Django 2.0+, and if not, switch to the documentation for the version you're using. – Wiggy A. Jun 05 '18 at 08:58
  • Thanks @Umair for your suggestion, but can you please show me the proper syntax for url, because I don't know how it's going to work in this case. `path('accounts/', include('django.contrib.auth.urls')),`. According to the documentation, this line adds the Django site authentication urls but I don't know how I'm going to use urls if I have a "include()" in it and what view would I link it to? Any links would be helpful, thank you – X-TremeFighter12 Jun 05 '18 at 16:36
  • @Wiggy A. thanks for your feedback and I'm in fact using `Django version 2.0.5, `, but I feel that it's just Cloud9 that's messing everything up – X-TremeFighter12 Jun 05 '18 at 16:38

1 Answers1

0

Use urls first import it with include

from django.conf.urls import url, include

then this is how you switch from path to urls, quite simple actually

Take admin url for example, this is what path looks like

path('admin/', admin.site.urls),

this is what urls looks like

url(r'^admin/', include(admin.site.urls)),

Good work X-TremeFighter12!