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?

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

Student evaluations of teaching assistants

How will losing mobility of one hand affect my career as a programmer?

Go Pregnant or Go Home

Trouble understanding overseas colleagues

Is it correct to write "is not focus on"?

Is there a good way to store credentials outside of a password manager?

What is the oldest known work of fiction?

How to be diplomatic in refusing to write code that breaches the privacy of our users

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

What is the term when two people sing in harmony, but they aren't singing the same notes?

Why is delta-v is the most useful quantity for planning space travel?

voltage of sounds of mp3files

Is there any easy technique written in Bhagavad GITA to control lust?

Can I use my Chinese passport to enter China after I acquired another citizenship?

Is there any reason not to eat food that's been dropped on the surface of the moon?

Personal Teleportation as a Weapon

Confused about a passage in Harry Potter y la piedra filosofal

Is expanding the research of a group into machine learning as a PhD student risky?

when is out of tune ok?

Why are on-board computers allowed to change controls without notifying the pilots?

Should my PhD thesis be submitted under my legal name?

How could Frankenstein get the parts for his _second_ creature?

Can criminal fraud exist without damages?



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?













0















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", )









share|improve this question




























    0















    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", )









    share|improve this question


























      0












      0








      0








      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", )









      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 22 at 0:41







      VA splash

















      asked Mar 21 at 15:27









      VA splashVA splash

      2410




      2410






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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>





          share|improve this answer























          • 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 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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>





          share|improve this answer























          • 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 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















          0














          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>





          share|improve this answer























          • 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 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













          0












          0








          0







          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>





          share|improve this answer













          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>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 21 at 15:35









          Yugandhar ChaudhariYugandhar Chaudhari

          1,0681924




          1,0681924












          • 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 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

















          • 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 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
















          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



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript