slyapustin / django-classified

Django Classified
https://github.com/slyapustin/django-classified-demo
MIT License
171 stars 77 forks source link

NameError: name 'patterns' is not defined #59

Closed Sammeeey closed 1 year ago

Sammeeey commented 1 year ago

If I just add

urlpatterns = patterns(
    url(r'', include('django_classified.urls', namespace='django_classified'),
)

to uls.py - as described in Installation - I get this error:

 )
     ^
SyntaxError: unexpected EOF while parsing

If I add an additional bracket at the end...

urlpatterns = patterns(
    url(r'', include('django_classified.urls', namespace='django_classified'),
))

I get:

urlpatterns = patterns(
NameError: name 'patterns' is not defined
damascene commented 1 year ago

Not sure if this could help, I was able to view the main page without error with this, but unable to login:

from django.contrib import admin
from django.urls import path, re_path, include
# ~ from django.conf.urls import include, url

urlpatterns = [
    re_path('', include('django_classified.urls', namespace='django_classified')),
    path('admin/', admin.site.urls),
]

also had to add these apps in addition to the one in the documents:

    'django.contrib.sites',
    'django.contrib.humanize',
slyapustin commented 1 year ago

This was addressed in the #62