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?













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

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현