Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8659477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:01:26+00:00 2026-06-12T16:01:26+00:00

can anyone help me on my problem, when trying to save my page get

  • 0

can anyone help me on my problem, when trying to save my page get an error 404. here is the coding

urls.py

urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^$', PatientView.as_view()),
(r'^patientList/$', PatientView.as_view(), name ="forside"),
(r'^rehab_diab/(?P<pk>\d+)/$', RehabDiabetesView.as_view(), name="rehabDiabetes_view"),

views.py

class RehabDiabetesView(UpdateView):
template_name="rehab_diab.html"
model = RehabDiabetes
form_class = RehabDiabetesForm

def get_context_data(self, **kwargs):
    context = super(RehabDiabetesView, self).get_context_data(**kwargs)
    context['pk']=self.kwargs['pk']
    return context

def get_object(self, queryset = None):
    try: 
        obj = RehabDiabetes.objects.get(owner = Patient.objects.get(id = self.kwargs['pk']))
    except: 
        obj = RehabDiabetes.objects.create(owner = Patient.objects.get(id = self.kwargs['pk']))
    return obj

def form_valid(self, form):
    form.save()
    return HttpResponseRedirect(reverse("forside"))

rehab_diab.html

<form id="content" action="rehabDiabetes_view pk" method="POST" style="opacity: 1; ">
{% csrf_token %}
<input type="submit" value="Gem" class="ui-button ui-widget ui-state-default ui-corner-all" />

——-#rest of the code..

and here is the error

Page not found (404)
Request Method: POST
Request URL:    http:xxx.xxx.xxx/rehab_diab/1/rehabDiabetes_view%20pk
Using the URLconf defined in rehab3.urls, Django tried these URL patterns, in this order:
^admin/
^$
^patientList/$ [name='forside']
^rehab_diab/(?P<pk>\d+)/$ [name='rehabDiabetes_view']
The current URL, rehab_diab/1/rehabDiabetes_view pk, didn't match any of these.

what is the missing link?? can’t figure it out since im newbies in django..:(
thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:01:28+00:00Added an answer on June 12, 2026 at 4:01 pm

    Did you mean action="{% url rehabDiabetes_view pk %}"?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me with a little problem I can't solve. I am trying
Can anyone help with a Postgres syntax problem? I'm trying to insert a record,
Can anyone help me spot the problem on this PLEASE? I'm eternally grateful for
Can anyone help with a small problem. I've got a nice simple CSS dropdown
Can anyone help with an odd Ruby Gem problem I'm having - note I've
can anyone help, i have problem doing a sort, I thought i had it
can anyone help? I have a problem aligning rounded corners in IE6/7. Basically everything
Can anyone help me to get good WordPress interview questions and answers. Any link
Can anyone help me with a MySQL query I'm trying to put together. I
Can anyone help solve this problem, no matter what i try i cannot display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.