NoReverseMatch with keyword argument uidb64 with Django 2.0

In Django 2.0 and 2.1 you should call decode() after base64 encoding the uid, to convert it to a string: message = render_to_string(‘acc_active_email.html’, { ‘user’: user, ‘domain’: current_site.domain, ‘uid’: urlsafe_base64_encode(force_bytes(user.pk)).decode(), ‘token’: account_activation_token.make_token(user), }) See the note in the Django 2.0 release notes for more info. In Django 2.2+, urlsafe_base64_encode returns a string, so there is … Read more

ImportError: No module named ‘django.core.urlresolvers’

Django 2.0 removes the django.core.urlresolvers module, which was moved to django.urls in version 1.10. You should change any import to use django.urls instead, like this: from django.urls import reverse Note that Django 2.0 removes some features that previously were in django.core.urlresolvers, so you might have to make some more changes before your code works. See … Read more

Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries

You can change the property categorie of the class Article like this: categorie = models.ForeignKey( ‘Categorie’, on_delete=models.CASCADE, ) and the error should disappear. Eventually you might need another option for on_delete, check the documentation for more details: https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.ForeignKey EDIT: As you stated in your comment, that you don’t have any special requirements for on_delete, you … Read more