Django-nonrel + Django-registration problem: unexpected keyword argument 'uidb36' when resetting password
Tag : django , By : glisignoli
Date : March 29 2020, 07:55 AM
I wish this help you My solution was to comment out urlpatterns defined in registration\auth_urls.py, and redefine them as a copy of urlpatterns defined in django.contrib.auth. Here's my auth_urls.py after the change: """
URL patterns for the views included in ``django.contrib.auth``.
Including these URLs (via the ``include()`` directive) will set up the
following patterns based at whatever URL prefix they are included
under:
* User login at ``login/``.
* User logout at ``logout/``.
* The two-step password change at ``password/change/`` and
``password/change/done/``.
* The four-step password reset at ``password/reset/``,
``password/reset/confirm/``, ``password/reset/complete/`` and
``password/reset/done/``.
The default registration backend already has an ``include()`` for
these URLs, so under the default setup it is not necessary to manually
include these views. Other backends may or may not include them;
consult a specific backend's documentation for details.
"""
from django.conf.urls.defaults import *
#from django.contrib.auth import views as auth_views
from django.contrib.auth import urls as auth_urls
urlpatterns = auth_urls.urlpatterns
'''
Commented out, this is what caused my problems:
urlpatterns = patterns('',
url(r'^login/$',
auth_views.login,
{'template_name': 'registration/login.html'},
name='auth_login'),
url(r'^logout/$',
auth_views.logout,
{'template_name': 'registration/logout.html'},
name='auth_logout'),
url(r'^password/change/$',
auth_views.password_change,
name='auth_password_change'),
url(r'^password/change/done/$',
auth_views.password_change_done,
name='auth_password_change_done'),
url(r'^password/reset/$',
auth_views.password_reset,
name='auth_password_reset'),
url(r'^password/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
auth_views.password_reset_confirm,
name='auth_password_reset_confirm'),
url(r'^password/reset/complete/$',
auth_views.password_reset_complete,
name='auth_password_reset_complete'),
url(r'^password/reset/done/$',
auth_views.password_reset_done,
name='auth_password_reset_done'),
)
'''
|
django conditional url verify_exists
Date : March 29 2020, 07:55 AM
Any of those help What django does is it use's the URLValidator to see if the url is valid or not. what you could is use the same validations which is present in django.core EDIT: For example lets say you have to validate if django official website with url https://www.djangoproject.com/, exists or not. the code would simply look like this: from django.core.validators import URLValidator
from django.core.exceptions import ValidationError
my_url_validator = URLValidator(verify_exists=True) #creates a URLValidator object with verify_exists.
my_url = "https://www.djangoproject.com/" #url to be verified
#check if url is valid :)
try:
my_url_validator(my_url)
except ValidationError:
#not valid!! :_(
#fix: custom stuff to the rescue :)
CustomStuff()...
|
Django release 1.5: 'url' requires a non-empty first argument. The syntax changed in Django 1.5
Tag : django , By : user152319
Date : March 29 2020, 07:55 AM
Any of those help I really hate doing all this junk by hand, so I wrote a sed script to do it for me. Make sure you have a backup first, then run this in your templates directory: find . -type f -print0 | xargs -0 sed -i 's/{% url \([^" >][^ >]*\)/{% url "\1"/g'
{% url something.else foo bar %}
{% url "something.else" foo bar %}
|
Tag : python , By : Michael Gunderson
Date : March 29 2020, 07:55 AM
like below fixes the issue I have a variable named email in view. , Maybe pass it as kwargs: ManageSerializers(interviewData, many = True, email= email)
ManageSerializers(interviewData, many = True, context={'email': email})
|
Django 1.11.7 - Django Compressor - argument 5: <class 'TypeError'>: expected LP_OVERLAPPED instance instead of po
Date : March 29 2020, 07:55 AM
around this issue In my case, this was due to a conflict with the youtube-dl package having similarly-named classes, variables and methods as the django-compressor package. I was able to confirm this by "hacking" the names of the various tokens in both instances, resulting in an error argument 5: : expected LP_OVERLAPPED2 instance instead of pointer to OVERLAPPED3 I have removed the youtube-dl package from my environment for now as a temporary solution to getting this running in my local dev environment.
|