Django POST from links to the view that is not specified in URLTypeError at /signup 'NoneType' object is not callable in DjangoDjango Authentication from .NET using HttpWebRequest and HttpWebResponse via HTTP POSTHow to combine 2 or more querysets in a Django view?How to send request from one django server to another serverAuthentication not working in Django?Django optional url parametersDjango POST request to my view from Pyres worker - CSRF tokenHow to view a particluar list of contacts or only my contacts in Django application?Django redirects to login page even after logging inDjango POST - unable to retrieve form data, POST check failshow to store my entered data from the form in the mysql database using xampp in django?
Is oxalic acid dihydrate considered a primary acid standard in analytical chemistry?
How does the UK government determine the size of a mandate?
Is there a good way to store credentials outside of a password manager?
Integer addition + constant, is it a group?
Failed to fetch jessie backports repository
A particular customize with green line and letters for subfloat
Pole-zeros of a real-valued causal FIR system
Term for the "extreme-extension" version of a straw man fallacy?
Is a stroke of luck acceptable after a series of unfavorable events?
Do the temporary hit points from the Battlerager barbarian's Reckless Abandon stack if I make multiple attacks on my turn?
Lay out the Carpet
Return the Closest Prime Number
How can I get through very long and very dry, but also very useful technical documents when learning a new tool?
Why Were Madagascar and New Zealand Discovered So Late?
Escape a backup date in a file name
Why are there no referendums in the US?
Inappropriate reference requests from Journal reviewers
How does buying out courses with grant money work?
How to check is there any negative term in a large list?
How to Reset Passwords on Multiple Websites Easily?
How to run a prison with the smallest amount of guards?
What is the opposite of 'gravitas'?
How do we know the LHC results are robust?
How easy is it to start Magic from scratch?
Django POST from links to the view that is not specified in URL
TypeError at /signup 'NoneType' object is not callable in DjangoDjango Authentication from .NET using HttpWebRequest and HttpWebResponse via HTTP POSTHow to combine 2 or more querysets in a Django view?How to send request from one django server to another serverAuthentication not working in Django?Django optional url parametersDjango POST request to my view from Pyres worker - CSRF tokenHow to view a particluar list of contacts or only my contacts in Django application?Django redirects to login page even after logging inDjango POST - unable to retrieve form data, POST check failshow to store my entered data from the form in the mysql database using xampp in django?
The page signup.html have url as shown
urls.py
urlpatterns = [
...
path('signup', views.Sign_up,name="signup"),
...
]
signup.html
<form class="signup-form initial-signup-form gtm_signup_register_form" action="." accept-charset="UTF-8" method="POST">
...
</form>
But when the form is submitted instead of accessing Signup() view,it points to Login_view(). I got output as "invalid login details supplied!". But the expected output is home.html.
views.py
def Sign_up(request):
Fname = request.POST.get("first_name")
Lname = request.POST.get("last_name")
Mno = request.POST.get("Mobile")
email = request.POST.get("email")
Pass = request.POST.get("pass")
Role = request.POST.get("role")
Loc = request.POST.get("self_loc")
if request.method == "POST":
userM = UserManager()
if Role=="Consumer":
userV= userM.create_user(Mno,Role,Pass)
else:
userV= userM.create_staffuser(Mno,Role,Pass)
userV.first_name=Fname
userV.last_name=Lname
userV.email=email
userV.location=Loc
return render(request, "home.html", )
else:
return render(request, "registration/signup.html", )
def Login_view(request):
print(request.method)
if request.method == "POST":
Uname = request.POST.get("Mobile")
PassW = request.POST.get("password")
print(Uname, PassW)
user = authenticate(mobile_no = Uname, password=PassW)
if user:
if user.is_active:
login(request,user)
if user.is_staff:
return HttpResponseRedirect(reverse('index'))
else:
return HttpResponseRedirect(reverse('home'))
else:
return HttpResponse("Account Not Active")
else:
print("Someone tried to login and failed")
print("Mobile_no: and password ".format(Uname,PassW))
return HttpResponse("invalid login details supplied!")
else:
return render(request,"registration/login.html", )
django django-forms django-views django-urls
add a comment |
The page signup.html have url as shown
urls.py
urlpatterns = [
...
path('signup', views.Sign_up,name="signup"),
...
]
signup.html
<form class="signup-form initial-signup-form gtm_signup_register_form" action="." accept-charset="UTF-8" method="POST">
...
</form>
But when the form is submitted instead of accessing Signup() view,it points to Login_view(). I got output as "invalid login details supplied!". But the expected output is home.html.
views.py
def Sign_up(request):
Fname = request.POST.get("first_name")
Lname = request.POST.get("last_name")
Mno = request.POST.get("Mobile")
email = request.POST.get("email")
Pass = request.POST.get("pass")
Role = request.POST.get("role")
Loc = request.POST.get("self_loc")
if request.method == "POST":
userM = UserManager()
if Role=="Consumer":
userV= userM.create_user(Mno,Role,Pass)
else:
userV= userM.create_staffuser(Mno,Role,Pass)
userV.first_name=Fname
userV.last_name=Lname
userV.email=email
userV.location=Loc
return render(request, "home.html", )
else:
return render(request, "registration/signup.html", )
def Login_view(request):
print(request.method)
if request.method == "POST":
Uname = request.POST.get("Mobile")
PassW = request.POST.get("password")
print(Uname, PassW)
user = authenticate(mobile_no = Uname, password=PassW)
if user:
if user.is_active:
login(request,user)
if user.is_staff:
return HttpResponseRedirect(reverse('index'))
else:
return HttpResponseRedirect(reverse('home'))
else:
return HttpResponse("Account Not Active")
else:
print("Someone tried to login and failed")
print("Mobile_no: and password ".format(Uname,PassW))
return HttpResponse("invalid login details supplied!")
else:
return render(request,"registration/login.html", )
django django-forms django-views django-urls
add a comment |
The page signup.html have url as shown
urls.py
urlpatterns = [
...
path('signup', views.Sign_up,name="signup"),
...
]
signup.html
<form class="signup-form initial-signup-form gtm_signup_register_form" action="." accept-charset="UTF-8" method="POST">
...
</form>
But when the form is submitted instead of accessing Signup() view,it points to Login_view(). I got output as "invalid login details supplied!". But the expected output is home.html.
views.py
def Sign_up(request):
Fname = request.POST.get("first_name")
Lname = request.POST.get("last_name")
Mno = request.POST.get("Mobile")
email = request.POST.get("email")
Pass = request.POST.get("pass")
Role = request.POST.get("role")
Loc = request.POST.get("self_loc")
if request.method == "POST":
userM = UserManager()
if Role=="Consumer":
userV= userM.create_user(Mno,Role,Pass)
else:
userV= userM.create_staffuser(Mno,Role,Pass)
userV.first_name=Fname
userV.last_name=Lname
userV.email=email
userV.location=Loc
return render(request, "home.html", )
else:
return render(request, "registration/signup.html", )
def Login_view(request):
print(request.method)
if request.method == "POST":
Uname = request.POST.get("Mobile")
PassW = request.POST.get("password")
print(Uname, PassW)
user = authenticate(mobile_no = Uname, password=PassW)
if user:
if user.is_active:
login(request,user)
if user.is_staff:
return HttpResponseRedirect(reverse('index'))
else:
return HttpResponseRedirect(reverse('home'))
else:
return HttpResponse("Account Not Active")
else:
print("Someone tried to login and failed")
print("Mobile_no: and password ".format(Uname,PassW))
return HttpResponse("invalid login details supplied!")
else:
return render(request,"registration/login.html", )
django django-forms django-views django-urls
The page signup.html have url as shown
urls.py
urlpatterns = [
...
path('signup', views.Sign_up,name="signup"),
...
]
signup.html
<form class="signup-form initial-signup-form gtm_signup_register_form" action="." accept-charset="UTF-8" method="POST">
...
</form>
But when the form is submitted instead of accessing Signup() view,it points to Login_view(). I got output as "invalid login details supplied!". But the expected output is home.html.
views.py
def Sign_up(request):
Fname = request.POST.get("first_name")
Lname = request.POST.get("last_name")
Mno = request.POST.get("Mobile")
email = request.POST.get("email")
Pass = request.POST.get("pass")
Role = request.POST.get("role")
Loc = request.POST.get("self_loc")
if request.method == "POST":
userM = UserManager()
if Role=="Consumer":
userV= userM.create_user(Mno,Role,Pass)
else:
userV= userM.create_staffuser(Mno,Role,Pass)
userV.first_name=Fname
userV.last_name=Lname
userV.email=email
userV.location=Loc
return render(request, "home.html", )
else:
return render(request, "registration/signup.html", )
def Login_view(request):
print(request.method)
if request.method == "POST":
Uname = request.POST.get("Mobile")
PassW = request.POST.get("password")
print(Uname, PassW)
user = authenticate(mobile_no = Uname, password=PassW)
if user:
if user.is_active:
login(request,user)
if user.is_staff:
return HttpResponseRedirect(reverse('index'))
else:
return HttpResponseRedirect(reverse('home'))
else:
return HttpResponse("Account Not Active")
else:
print("Someone tried to login and failed")
print("Mobile_no: and password ".format(Uname,PassW))
return HttpResponse("invalid login details supplied!")
else:
return render(request,"registration/login.html", )
django django-forms django-views django-urls
django django-forms django-views django-urls
edited Mar 22 at 0:41
VA splash
asked Mar 21 at 15:27
VA splashVA splash
2410
2410
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In signup.html form's action attribute should point to "signup"
instead of .
<form class="signup-form initial-signup-form gtm_signup_register_form" action="signup" accept-charset="UTF-8" method="POST">
...
</form>
Got error : "'NoneType' object is not callable"
– VA splash
Mar 21 at 15:44
Can you post traceback?
– Yugandhar Chaudhari
Mar 21 at 15:46
in views.py , userV= userM.create_user(Mno,Role,Pass) and mobile_no=mobile_no, in models.py
– VA splash
Mar 21 at 15:48
post your create_user and are your sure all the data your are passing from form? most probably you are calling something onMno,Role,Pass
in create_user and it is None
– Yugandhar Chaudhari
Mar 21 at 15:50
model is added to the question
– VA splash
Mar 21 at 15:58
|
show 1 more comment
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283925%2fdjango-post-from-links-to-the-view-that-is-not-specified-in-url%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In signup.html form's action attribute should point to "signup"
instead of .
<form class="signup-form initial-signup-form gtm_signup_register_form" action="signup" accept-charset="UTF-8" method="POST">
...
</form>
Got error : "'NoneType' object is not callable"
– VA splash
Mar 21 at 15:44
Can you post traceback?
– Yugandhar Chaudhari
Mar 21 at 15:46
in views.py , userV= userM.create_user(Mno,Role,Pass) and mobile_no=mobile_no, in models.py
– VA splash
Mar 21 at 15:48
post your create_user and are your sure all the data your are passing from form? most probably you are calling something onMno,Role,Pass
in create_user and it is None
– Yugandhar Chaudhari
Mar 21 at 15:50
model is added to the question
– VA splash
Mar 21 at 15:58
|
show 1 more comment
In signup.html form's action attribute should point to "signup"
instead of .
<form class="signup-form initial-signup-form gtm_signup_register_form" action="signup" accept-charset="UTF-8" method="POST">
...
</form>
Got error : "'NoneType' object is not callable"
– VA splash
Mar 21 at 15:44
Can you post traceback?
– Yugandhar Chaudhari
Mar 21 at 15:46
in views.py , userV= userM.create_user(Mno,Role,Pass) and mobile_no=mobile_no, in models.py
– VA splash
Mar 21 at 15:48
post your create_user and are your sure all the data your are passing from form? most probably you are calling something onMno,Role,Pass
in create_user and it is None
– Yugandhar Chaudhari
Mar 21 at 15:50
model is added to the question
– VA splash
Mar 21 at 15:58
|
show 1 more comment
In signup.html form's action attribute should point to "signup"
instead of .
<form class="signup-form initial-signup-form gtm_signup_register_form" action="signup" accept-charset="UTF-8" method="POST">
...
</form>
In signup.html form's action attribute should point to "signup"
instead of .
<form class="signup-form initial-signup-form gtm_signup_register_form" action="signup" accept-charset="UTF-8" method="POST">
...
</form>
answered Mar 21 at 15:35
Yugandhar ChaudhariYugandhar Chaudhari
1,11011024
1,11011024
Got error : "'NoneType' object is not callable"
– VA splash
Mar 21 at 15:44
Can you post traceback?
– Yugandhar Chaudhari
Mar 21 at 15:46
in views.py , userV= userM.create_user(Mno,Role,Pass) and mobile_no=mobile_no, in models.py
– VA splash
Mar 21 at 15:48
post your create_user and are your sure all the data your are passing from form? most probably you are calling something onMno,Role,Pass
in create_user and it is None
– Yugandhar Chaudhari
Mar 21 at 15:50
model is added to the question
– VA splash
Mar 21 at 15:58
|
show 1 more comment
Got error : "'NoneType' object is not callable"
– VA splash
Mar 21 at 15:44
Can you post traceback?
– Yugandhar Chaudhari
Mar 21 at 15:46
in views.py , userV= userM.create_user(Mno,Role,Pass) and mobile_no=mobile_no, in models.py
– VA splash
Mar 21 at 15:48
post your create_user and are your sure all the data your are passing from form? most probably you are calling something onMno,Role,Pass
in create_user and it is None
– Yugandhar Chaudhari
Mar 21 at 15:50
model is added to the question
– VA splash
Mar 21 at 15:58
Got error : "'NoneType' object is not callable"
– VA splash
Mar 21 at 15:44
Got error : "'NoneType' object is not callable"
– VA splash
Mar 21 at 15:44
Can you post traceback?
– Yugandhar Chaudhari
Mar 21 at 15:46
Can you post traceback?
– Yugandhar Chaudhari
Mar 21 at 15:46
in views.py , userV= userM.create_user(Mno,Role,Pass) and mobile_no=mobile_no, in models.py
– VA splash
Mar 21 at 15:48
in views.py , userV= userM.create_user(Mno,Role,Pass) and mobile_no=mobile_no, in models.py
– VA splash
Mar 21 at 15:48
post your create_user and are your sure all the data your are passing from form? most probably you are calling something on
Mno,Role,Pass
in create_user and it is None– Yugandhar Chaudhari
Mar 21 at 15:50
post your create_user and are your sure all the data your are passing from form? most probably you are calling something on
Mno,Role,Pass
in create_user and it is None– Yugandhar Chaudhari
Mar 21 at 15:50
model is added to the question
– VA splash
Mar 21 at 15:58
model is added to the question
– VA splash
Mar 21 at 15:58
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283925%2fdjango-post-from-links-to-the-view-that-is-not-specified-in-url%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown