How to retrieve data from database and display on web page ,example i want to display the details of the user on a web page which he has entered in a form which is stored in database.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmA0Cjjx8S_SqeGF1wBDQggGAXszKdApOD45-1CPBPXG0g%40mail.gmail.com.
How to retrieve data from database and display on web page ,example i want to display the details of the user on a web page which he has entered in a form which is stored in database.
--
Hello Fahad
If you didn’t extend user model your view.py it will be like
@login_required
def userdetails(request):
user_details = User.objects.get(username=request.user)
context {
"user_details": user_details,
}
return render(request, 'accounts/profile.html', context)
Then on your app.urls
from .views import user_details
app_name = "your_app_name"
urlpatterns = [
path('details/', user_details, name="profile")
]
On profile.html
{% block content %}
<div class="container">
<p>First Name: {{user_details.first_name}}</p>
<p>Last Name: {{user_details.last_name}}</p>
<p>Email:{{user_details.email}} </p>
...
</div>
{% endblock content %}
--
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/660971716.362954.1588515193796%40mail.yahoo.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/940225696.366548.1588517794311%40mail.yahoo.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmDYKr5ztuh3meeTCt-fQvnC9OjZ1cMFK2pFAw%3DLM%2BnLoA%40mail.gmail.com.
In my django project ,when a user sign up, a form is redirected to fill user information,further iam displaying this info on other page ,but whats happening is when i am dislaying the information of the current user who had logged in ,information of all users is displayed who had been signed up earlier.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmCraF9id7A24CX%2B1gFHnnknoskE4ZBV-LFj6se1nHfmTQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHV4E-csZDBbNz5HKHpto_6mtn%2B2jLOLAzjSgV95dDPX72NfhQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPsfuofX_-iKHYpa%3D5gDjxLzsGb7CcpYu8coiWvUb4piawD%2Bhg%40mail.gmail.com.
In my django project ,when a user sign up, a form is redirected to fill user information,further iam displaying this info on other page ,but whats happening is when i am dislaying the information of the current user who had logged in ,information of all users is displayed who had been signed up earlier.
--
I am unable to redirect to my login page from signup page and nor i am able to store sign up form details in the database .please someone help its urgent..
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmBdoviTSbHH%3D8yMo86MO6vpGpHyNQz1FtXgRf-UiL7zYw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BndhOMiCvjoY3e5hnypg0_rHEmymem3mspAnG4Mw6Vc46NKCQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BndhOP0CEYKKZks-sURQcd_71LYGj33AMh_h0EY3aFHHm_fqA%40mail.gmail.com.
I am working on project which is a diet planner,for that a user have to signup ,fill a form and them meal plan is generated,in that i have made two groups one for admin and other for customer,now i am unable to retroeve data of the customer who is logged in.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmCijsSTAp-r3iXkT6T0XpXifUOyRxZJwJ8C4UWt9PVA3g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmCfZ_0eFtYviMpM1U5LiOx9a0S2-ybfjM7K%2Brt6VX8PUQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmCE4gxFtUSaXYRCTfuni3iS65TNrOOGQpz8CueD38u2pQ%40mail.gmail.com.
--
Can someone tell that how to perform an operation ,for example we retreive two numbers from database and want to add them and display on template in django
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmCzazz4W5AuwKOzgvyjSDAMbXwgD-B%3DkM%2BtG3T0t2Mb%3DQ%40mail.gmail.com.