Django how to get post details of a post using slug

2020-07-03 Thread Tanni Seriki
Please family, help me out in solving my project.
How to use slug to get post details.
Here is all my files

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f1d16888-0cd3-455d-93d7-31a08617a269o%40googlegroups.com.
from django.shortcuts import render, get_object_or_404
from .models import Post
from django.core.paginator import Paginator, PageNotAnInteger,EmptyPage
from django.views.generic import ListView, DetailView
from django.db.models import Q


def IndexList(request):
a_list = Post.objects.filter(status=1).order_by('-created_on')
paginator = Paginator(a_list, 3)
page = request.GET.get('page')
try:
index_list = paginator.page(page)
except PageNotAnInteger:
index_list = paginator.page(1)
except EmptyPage:
index_list = paginator.page(paginator.num_pages)
return render(request, 'Home.html', {'a_list': a_list, 'page': page, 'index_list': index_list})


def NewsList(request):
b_list = Post.objects.filter(category=0, status=1).order_by('-created_on')
paginator = Paginator(b_list, 1)
page = request.GET.get('page')
try:
news_list = paginator.page(page)
except PageNotAnInteger:
news_list = paginator.page(1)
except EmptyPage:
news_list = paginator.page(paginator.num_pages)
return render(request, 'News.html', {'b_list': b_list, 'page': page, 'news_list': news_list})


def EntertainmentList(request):
c_list = Post.objects.filter(status=1, category=1).order_by('-created_on')
paginator = Paginator(c_list, 3)
page = request.GET.get('page')
try:
entertainment_list = paginator.page(page)
except PageNotAnInteger:
entertainment_list = paginator.page(1)
except EmptyPage:
entertainment_list = paginator.page(paginator.num_pages)
return render(request, 'Entertainment.html', {'c_list': c_list, 'page': page, 'entertainment_list': entertainment_list })


def SportsList(request):
d_list = Post.objects.filter(status=1, category=2).order_by('-created_on')
paginator = Paginator(d_list, 3)
page = request.GET.get('page')
try:
sport_list = paginator.page(page)
except PageNotAnInteger:
sport_list = paginator.page(1)
except EmptyPage:
sport_list = paginator.page(paginator.num_pages)
return render(request, 'Sports.html', {'d_list': d_list, 'page': page, 'sport_list': sport_list})


def World_NewsList(request):
e_list = Post.objects.filter(status=1, category=3).order_by('-created_on')
paginator = Paginator(e_list, 3)
page = request.GET.get('page')
try:
world_list = paginator.page(page)
except PageNotAnInteger:
world_list = paginator.page(1)
except EmptyPage:
world_list = paginator.page(paginator.num_pages)
return render(request, 'WorldNews.html', {'e_list': e_list, 'page': page, 'world_list': world_list})


class SearchResultsViews(ListView):
model = Post
template_name = 'Search.html'

def get_queryset(self):
query = self.request.GET.get('q')
object_list = Post.objects.filter(Q(title__icontains=query))
return object_list


def post_details_view(request, post):
f = get_object_or_404(Post, slug=post)
return render(request, 'post_details.html', {'f': f})
from django.db import models
from django.urls import reverse

# Create your models here.

STATUS = (
(0, "Draft"),
(1, "Publish")
)

CATEGORY = (
(0, "News"),
(1, "Entertainment"),
(2, "Sports"),
(3, "WorldNews"),
)


class Post(models.Model):
title = models.CharField(max_length=200)
content = models.TextField()
slug = models.SlugField(max_length=200, unique=True)
updated_on = models.DateTimeField(auto_now=True)
created_on = models.DateTimeField(auto_now_add=True)
status = models.IntegerField(choices=STATUS, default=0)
image = models.ImageField(upload_to='images/', blank=True)
image1 = models.ImageField(upload_to='images/', blank=True)
image2 = models.ImageField(upload_to='images/', blank=True)
category = models.IntegerField(choices=CATEGORY, default=0)

class Meta:
ordering = ['-created_on']

def __str__(self):
return self.title

def get_absolute_url(self):
return reverse('Olofofofo:post_details_view', args=[self.slug])
from django.urls import path
from . import views
from .views import SearchResultsViews


urlpatterns = [
path('', views.IndexList, name='index'),
path('news', views.NewsList, name='news'),
path('entertainment', views.EntertainmentList, name='entertainment'),
path('sports', views.SportsList, name='sports'),
path('world_news', views.World_NewsList, name='world_news'),
path('Search', 

Re: Django how get Post details using slug

2020-07-03 Thread Tanni Seriki
Thanks sir, I will make changes.
I really appreciate your time and effort in helping me out with this
Thanks

On Fri, Jul 3, 2020, 11:14 PM coolguy 
wrote:

> One more thing. if your view code is indented exactly the way it is in the
> provided then you need to fix the indentation of
>
> def post_details_view(request, post):
>
> This should be under class SearchResultsViews()
>
> like this...
>
> class SearchResultsViews(ListView):
> model = Post
> template_name = 'Search.html'
>
> def get_queryset(self):
> query = self.request.GET.get('q')
> object_list = Post.objects.filter(Q(title__icontains=query))
> return object_list
>
>
> def post_details_view(request, post):
> f = get_object_or_404(Post, slug=post)
> return render(request, 'post_details.html', {'f': f})
>
>
> On Friday, July 3, 2020 at 5:10:14 PM UTC-4, Tanni Seriki wrote:
>>
>> Please let me know if you have seen the file.
>> Am sorry am sending it to you as file, my phone is malfunctioning
>>
>> On Fri, Jul 3, 2020, 9:49 PM Tanni Seriki  wrote:
>>
>>> Sir here it's all the project, currently my phone camera has fault
>>> please help me out.
>>>
>>> On Fri, Jul 3, 2020, 9:23 PM coolguy  wrote:
>>>
 I am away at this time but can you send the project urls.py screen shot
 as well.

 On Friday, July 3, 2020 at 4:09:01 PM UTC-4, Tanni Seriki wrote:
>
> Here is my WhatsApp number
> +2348095594236
> Please I really need to solve this out
>
> On Fri, Jul 3, 2020, 9:07 PM Tanni Seriki  wrote:
>
>> Coolguy
>> Please can we chat on WhatsApp...
>> The post details is really giving me headache, please help out
>>
>> On Fri, Jul 3, 2020, 9:04 PM coolguy  wrote:
>>
>>> Seems pretty simple unless you have specific question about
>>> something.
>>>
>>> You have a model which has some fields including Slug field which
>>> should be unique i.e. unique=True but your screen shot is not clear..
>>>
>>> In views you are overriding the get_queryset() method of base class
>>> and assigning it to query variable for the 'q' from http GET request. 
>>> Then
>>> filtering Post data with the values in query object you have just 
>>> created.
>>> Finally returned the revised object_list including this new query 
>>> context.
>>>
>>> In post_detail_views you are retrieving data from Post based on the
>>> post slug and assigning it to variable 'f'. Finally you used the 
>>> render()
>>> shortcut to render the retrieved post using a template.
>>>
>>> In your urlpatterns you have defined the path for your post_detail
>>> which send the post as a slug to your view and in turn view returns the
>>> HTTP response.
>>>
>>> On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:

 Please can someone put me through on this, post details view either
 one the function based view or class based view. Thanks
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6bc99e96-0830-4e23-9482-cd4268c14329o%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: Unable to modify Session with signed_cookies backend

2020-07-03 Thread Ogunsanya Opeyemi
Hi,
Serach for pip install url on ubuntu then you for you to get pip installed.
On Friday, July 3, 2020, Krishna Chaitanya  wrote:

> Hi,
>
> When I try to modify a session when using signed_cookies backend it
> creates a new session which voids
> the purpose as I am using session_key as a shared data structures across
> views/functions.
>
> Is this expected or a bug? I am using 1.11 (default on ubuntu 18.04, can't
> update as pip isn't allowed), but even
> looking at the latest source https://github.com/django/django/blob/master/
> django/contrib/sessions/backends/signed_cookies.py#L41
> the behavior isn't changed.
>
> The same logic works fine with db/file backends but can't use that due to
> low storage issues.
>
> Any help is appreciated?
>
> Thanks
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/e399f194-2fd7-4fae-a002-7599badce3b3o%
> 40googlegroups.com
> 
> .
>


-- 
OGUNSANYA OPEYEMI

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABJxPrGaq7b53Ev4HkuZ93XYrwJ5njOS1CCsZ9Gxn%3D-hDKLU0Q%40mail.gmail.com.


Re: Django how get Post details using slug

2020-07-03 Thread coolguy
One more thing. if your view code is indented exactly the way it is in the 
provided then you need to fix the indentation of 

def post_details_view(request, post):

This should be under class SearchResultsViews()

like this...

class SearchResultsViews(ListView):
model = Post
template_name = 'Search.html'

def get_queryset(self):
query = self.request.GET.get('q')
object_list = Post.objects.filter(Q(title__icontains=query))
return object_list


def post_details_view(request, post):
f = get_object_or_404(Post, slug=post)
return render(request, 'post_details.html', {'f': f})


On Friday, July 3, 2020 at 5:10:14 PM UTC-4, Tanni Seriki wrote:
>
> Please let me know if you have seen the file.
> Am sorry am sending it to you as file, my phone is malfunctioning
>
> On Fri, Jul 3, 2020, 9:49 PM Tanni Seriki  > wrote:
>
>> Sir here it's all the project, currently my phone camera has fault please 
>> help me out.
>>
>> On Fri, Jul 3, 2020, 9:23 PM coolguy > > wrote:
>>
>>> I am away at this time but can you send the project urls.py screen shot 
>>> as well.
>>>
>>> On Friday, July 3, 2020 at 4:09:01 PM UTC-4, Tanni Seriki wrote:

 Here is my WhatsApp number
 +2348095594236
 Please I really need to solve this out

 On Fri, Jul 3, 2020, 9:07 PM Tanni Seriki  wrote:

> Coolguy
> Please can we chat on WhatsApp...
> The post details is really giving me headache, please help out 
>
> On Fri, Jul 3, 2020, 9:04 PM coolguy  wrote:
>
>> Seems pretty simple unless you have specific question about something.
>>
>> You have a model which has some fields including Slug field which 
>> should be unique i.e. unique=True but your screen shot is not clear..
>>
>> In views you are overriding the get_queryset() method of base class 
>> and assigning it to query variable for the 'q' from http GET request. 
>> Then 
>> filtering Post data with the values in query object you have just 
>> created. 
>> Finally returned the revised object_list including this new query 
>> context.
>>
>> In post_detail_views you are retrieving data from Post based on the 
>> post slug and assigning it to variable 'f'. Finally you used the 
>> render() 
>> shortcut to render the retrieved post using a template.
>>
>> In your urlpatterns you have defined the path for your post_detail 
>> which send the post as a slug to your view and in turn view returns the 
>> HTTP response.
>>
>> On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:
>>>
>>> Please can someone put me through on this, post details view either 
>>> one the function based view or class based view. Thanks
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6bc99e96-0830-4e23-9482-cd4268c14329o%40googlegroups.com.


Re: Django how get Post details using slug

2020-07-03 Thread coolguy
if the new urls is the main url then its not correctly setup. you have to 
mention the app name

Let assume you are app name 'student' in your project. So the main urls.py 
will have it as follow:

path('students/',  include(students.urls),


This way you are telling Django to handover all the requests sent in with 
students/ to students urls.py in students directory. There is where you will 
handle this and other students related urls.


In urls.py of students app you should have as follow:

path('/', views.post_details_view, name='post_details'),



On Friday, July 3, 2020 at 5:10:14 PM UTC-4, Tanni Seriki wrote:
>
> Please let me know if you have seen the file.
> Am sorry am sending it to you as file, my phone is malfunctioning
>
> On Fri, Jul 3, 2020, 9:49 PM Tanni Seriki  > wrote:
>
>> Sir here it's all the project, currently my phone camera has fault please 
>> help me out.
>>
>> On Fri, Jul 3, 2020, 9:23 PM coolguy > > wrote:
>>
>>> I am away at this time but can you send the project urls.py screen shot 
>>> as well.
>>>
>>> On Friday, July 3, 2020 at 4:09:01 PM UTC-4, Tanni Seriki wrote:

 Here is my WhatsApp number
 +2348095594236
 Please I really need to solve this out

 On Fri, Jul 3, 2020, 9:07 PM Tanni Seriki  wrote:

> Coolguy
> Please can we chat on WhatsApp...
> The post details is really giving me headache, please help out 
>
> On Fri, Jul 3, 2020, 9:04 PM coolguy  wrote:
>
>> Seems pretty simple unless you have specific question about something.
>>
>> You have a model which has some fields including Slug field which 
>> should be unique i.e. unique=True but your screen shot is not clear..
>>
>> In views you are overriding the get_queryset() method of base class 
>> and assigning it to query variable for the 'q' from http GET request. 
>> Then 
>> filtering Post data with the values in query object you have just 
>> created. 
>> Finally returned the revised object_list including this new query 
>> context.
>>
>> In post_detail_views you are retrieving data from Post based on the 
>> post slug and assigning it to variable 'f'. Finally you used the 
>> render() 
>> shortcut to render the retrieved post using a template.
>>
>> In your urlpatterns you have defined the path for your post_detail 
>> which send the post as a slug to your view and in turn view returns the 
>> HTTP response.
>>
>> On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:
>>>
>>> Please can someone put me through on this, post details view either 
>>> one the function based view or class based view. Thanks
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/157d848d-f368-4917-a337-d4b3d0623777o%40googlegroups.com.


Custom-DRF-Response

2020-07-03 Thread Ronaldo Mata
Hi Guys

Somebody can help me?

I want to create a custom response with the follow format:

{
  "status": true,
  "message": "Any message",
  "data": []}


but I don't want create a custom_response function because I must to
modified all Api class based views response. What is the best way to deal
with this?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP%3DoziQW9yHM74Pyc2bYzik0RJFQua1-qWNuE%2B%2B4OU%2BGoutRZA%40mail.gmail.com.


Cannot modify existing sessions using signed_cookies backend

2020-07-03 Thread Krishna Chaitanya
Hi Guys, 

I am using sessions in my webapp, and don't want to use a db/file backends 
as my device
has small storage, so, using signed_cookies backend, I need to store and 
modify per-session data
across places and use the session_key to lookup, modify and then save. But 
every save creates a 
new session, so, the change isn't propagated to other views. 

func_view(request)
   start_async_oper(func_non_view, args=request.session)
   # session is created in another view
   request.session.data = 1

func_view2(request):
   check (request.session.data == 2)

func_non_view(session):
  session = SessionStore(session_key=session.session_key)
  session.data = 2
  session.save()

Session_key is passed from view to non-view and then I am using 
Sessionstore(session_key) to 
lookup the session from non-view, and then after modification normally do a 
save() and from the
view, I read updated session values. 

This logic works if I use either a db/file backend. 
Also confirmed this behavior by looking at the save() function of various 
backends.
https://github.com/django/django/blob/master/django/contrib/sessions/backends/signed_cookies.py#L41

If I just change the session data (not from a view), but don't do a save I 
can see that the session_key hasn't changed
but obviously the change isn't reflected. 

The Django version is 1.11 (Default Ubuntu18.04, cannot update) but looks 
like the signed_cookies code hasn't changed.

Looks like a bug to me? am I missing anything? I can move the session 
update to a view and use some globals but 
this design keeps it simple by storing the data in the session.

Any help is appreciated.

Thanks.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/abca3930-31e5-4de2-8200-1ddab80b8734o%40googlegroups.com.


Unable to modify Session with signed_cookies backend

2020-07-03 Thread Krishna Chaitanya
Hi, 

When I try to modify a session when using signed_cookies backend it creates 
a new session which voids
the purpose as I am using session_key as a shared data structures across 
views/functions.

Is this expected or a bug? I am using 1.11 (default on ubuntu 18.04, can't 
update as pip isn't allowed), but even
looking at the latest source 
https://github.com/django/django/blob/master/django/contrib/sessions/backends/signed_cookies.py#L41
the behavior isn't changed.

The same logic works fine with db/file backends but can't use that due to 
low storage issues.

Any help is appreciated?

Thanks

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e399f194-2fd7-4fae-a002-7599badce3b3o%40googlegroups.com.


Re: Django how get Post details using slug

2020-07-03 Thread Tanni Seriki
Please let me know if you have seen the file.
Am sorry am sending it to you as file, my phone is malfunctioning

On Fri, Jul 3, 2020, 9:49 PM Tanni Seriki  wrote:

> Sir here it's all the project, currently my phone camera has fault please
> help me out.
>
> On Fri, Jul 3, 2020, 9:23 PM coolguy 
> wrote:
>
>> I am away at this time but can you send the project urls.py screen shot
>> as well.
>>
>> On Friday, July 3, 2020 at 4:09:01 PM UTC-4, Tanni Seriki wrote:
>>>
>>> Here is my WhatsApp number
>>> +2348095594236
>>> Please I really need to solve this out
>>>
>>> On Fri, Jul 3, 2020, 9:07 PM Tanni Seriki  wrote:
>>>
 Coolguy
 Please can we chat on WhatsApp...
 The post details is really giving me headache, please help out

 On Fri, Jul 3, 2020, 9:04 PM coolguy  wrote:

> Seems pretty simple unless you have specific question about something.
>
> You have a model which has some fields including Slug field which
> should be unique i.e. unique=True but your screen shot is not clear..
>
> In views you are overriding the get_queryset() method of base class
> and assigning it to query variable for the 'q' from http GET request. Then
> filtering Post data with the values in query object you have just created.
> Finally returned the revised object_list including this new query context.
>
> In post_detail_views you are retrieving data from Post based on the
> post slug and assigning it to variable 'f'. Finally you used the render()
> shortcut to render the retrieved post using a template.
>
> In your urlpatterns you have defined the path for your post_detail
> which send the post as a slug to your view and in turn view returns the
> HTTP response.
>
> On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:
>>
>> Please can someone put me through on this, post details view either
>> one the function based view or class based view. Thanks
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALWCJq1QQiT6x%2BvVh7Bfzd1L%2BE5rkb4eefRT%3DphQ4fbs_pktcg%40mail.gmail.com.


Re: Re : how to deploy django project on iis windows server

2020-07-03 Thread Gurmeet Kaur
Hi,

It shows your static files and folders are not configured in IIS. You can
find the whole process step by step at -

https://www.mattwoodward.com/2016/07/23/running-a-django-application-on-windows-server-2012-with-iis/


It is very cleanly explained here.

On Fri, Jul 3, 2020 at 5:05 PM Avi shah  wrote:

> I am getting the error message while i have deployed the django project on
> my iis windows server , the error in the console log is this :
>
> And the project is working fine on the servers localhost , only having an
> issue while it is on the url/domain
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b3c78e55-927f-47db-9966-1ba9acd0e92fn%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEbKJVhzjiNgApLVt2xL9PUHrtQS2PfaY5_KcVFWbCNoqXjG1w%40mail.gmail.com.


Re: Django how get Post details using slug

2020-07-03 Thread Tanni Seriki
Sir here it's all the project, currently my phone camera has fault please
help me out.

On Fri, Jul 3, 2020, 9:23 PM coolguy  wrote:

> I am away at this time but can you send the project urls.py screen shot as
> well.
>
> On Friday, July 3, 2020 at 4:09:01 PM UTC-4, Tanni Seriki wrote:
>>
>> Here is my WhatsApp number
>> +2348095594236
>> Please I really need to solve this out
>>
>> On Fri, Jul 3, 2020, 9:07 PM Tanni Seriki  wrote:
>>
>>> Coolguy
>>> Please can we chat on WhatsApp...
>>> The post details is really giving me headache, please help out
>>>
>>> On Fri, Jul 3, 2020, 9:04 PM coolguy  wrote:
>>>
 Seems pretty simple unless you have specific question about something.

 You have a model which has some fields including Slug field which
 should be unique i.e. unique=True but your screen shot is not clear..

 In views you are overriding the get_queryset() method of base class and
 assigning it to query variable for the 'q' from http GET request. Then
 filtering Post data with the values in query object you have just created.
 Finally returned the revised object_list including this new query context.

 In post_detail_views you are retrieving data from Post based on the
 post slug and assigning it to variable 'f'. Finally you used the render()
 shortcut to render the retrieved post using a template.

 In your urlpatterns you have defined the path for your post_detail
 which send the post as a slug to your view and in turn view returns the
 HTTP response.

 On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:
>
> Please can someone put me through on this, post details view either
> one the function based view or class based view. Thanks

 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALWCJq2MSEz98Ke7F3x%2BUgfZC9BVRm9RmVbkKL94V7%2BsPFxKXQ%40mail.gmail.com.
{% extends 'base.html'%}from django.shortcuts import render, get_object_or_404
from .models import Post
from django.core.paginator import Paginator, PageNotAnInteger,EmptyPage
from django.views.generic import ListView, DetailView
from django.db.models import Q


def IndexList(request):
a_list = Post.objects.filter(status=1).order_by('-created_on')
paginator = Paginator(a_list, 3)
page = request.GET.get('page')
try:
index_list = paginator.page(page)
except PageNotAnInteger:
index_list = paginator.page(1)
except EmptyPage:
index_list = paginator.page(paginator.num_pages)
return render(request, 'Home.html', {'a_list': a_list, 'page': page, 'index_list': index_list})


def NewsList(request):
b_list = Post.objects.filter(category=0, status=1).order_by('-created_on')
paginator = Paginator(b_list, 1)
page = request.GET.get('page')
try:
news_list = paginator.page(page)
except PageNotAnInteger:
news_list = paginator.page(1)
except EmptyPage:
news_list = paginator.page(paginator.num_pages)
return render(request, 'News.html', {'b_list': b_list, 'page': page, 'news_list': news_list})


def EntertainmentList(request):
c_list = Post.objects.filter(status=1, category=1).order_by('-created_on')
paginator = Paginator(c_list, 3)
page = request.GET.get('page')
try:
entertainment_list = paginator.page(page)
except PageNotAnInteger:
entertainment_list = paginator.page(1)
except EmptyPage:
entertainment_list = paginator.page(paginator.num_pages)
return render(request, 'Entertainment.html', {'c_list': c_list, 'page': page, 'entertainment_list': entertainment_list })


def SportsList(request):

Re: Django how get Post details using slug

2020-07-03 Thread coolguy
I am away at this time but can you send the project urls.py screen shot as 
well.

On Friday, July 3, 2020 at 4:09:01 PM UTC-4, Tanni Seriki wrote:
>
> Here is my WhatsApp number
> +2348095594236
> Please I really need to solve this out
>
> On Fri, Jul 3, 2020, 9:07 PM Tanni Seriki  > wrote:
>
>> Coolguy
>> Please can we chat on WhatsApp...
>> The post details is really giving me headache, please help out 
>>
>> On Fri, Jul 3, 2020, 9:04 PM coolguy > > wrote:
>>
>>> Seems pretty simple unless you have specific question about something.
>>>
>>> You have a model which has some fields including Slug field which should 
>>> be unique i.e. unique=True but your screen shot is not clear..
>>>
>>> In views you are overriding the get_queryset() method of base class and 
>>> assigning it to query variable for the 'q' from http GET request. Then 
>>> filtering Post data with the values in query object you have just created. 
>>> Finally returned the revised object_list including this new query context.
>>>
>>> In post_detail_views you are retrieving data from Post based on the post 
>>> slug and assigning it to variable 'f'. Finally you used the render() 
>>> shortcut to render the retrieved post using a template.
>>>
>>> In your urlpatterns you have defined the path for your post_detail which 
>>> send the post as a slug to your view and in turn view returns the HTTP 
>>> response.
>>>
>>> On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:

 Please can someone put me through on this, post details view either one 
 the function based view or class based view. Thanks
>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.com.


Re: Django how get Post details using slug

2020-07-03 Thread Tanni Seriki
Coolguy
Please can we chat on WhatsApp...
The post details is really giving me headache, please help out

On Fri, Jul 3, 2020, 9:04 PM coolguy  wrote:

> Seems pretty simple unless you have specific question about something.
>
> You have a model which has some fields including Slug field which should
> be unique i.e. unique=True but your screen shot is not clear..
>
> In views you are overriding the get_queryset() method of base class and
> assigning it to query variable for the 'q' from http GET request. Then
> filtering Post data with the values in query object you have just created.
> Finally returned the revised object_list including this new query context.
>
> In post_detail_views you are retrieving data from Post based on the post
> slug and assigning it to variable 'f'. Finally you used the render()
> shortcut to render the retrieved post using a template.
>
> In your urlpatterns you have defined the path for your post_detail which
> send the post as a slug to your view and in turn view returns the HTTP
> response.
>
> On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:
>>
>> Please can someone put me through on this, post details view either one
>> the function based view or class based view. Thanks
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALWCJq073zXnm3NBAh10KNJiBbD%3DQTZj9B%3DXeBAfQ4mcrP0%2BoA%40mail.gmail.com.


Re: Django how get Post details using slug

2020-07-03 Thread Tanni Seriki
Here is my WhatsApp number
+2348095594236
Please I really need to solve this out

On Fri, Jul 3, 2020, 9:07 PM Tanni Seriki  wrote:

> Coolguy
> Please can we chat on WhatsApp...
> The post details is really giving me headache, please help out
>
> On Fri, Jul 3, 2020, 9:04 PM coolguy 
> wrote:
>
>> Seems pretty simple unless you have specific question about something.
>>
>> You have a model which has some fields including Slug field which should
>> be unique i.e. unique=True but your screen shot is not clear..
>>
>> In views you are overriding the get_queryset() method of base class and
>> assigning it to query variable for the 'q' from http GET request. Then
>> filtering Post data with the values in query object you have just created.
>> Finally returned the revised object_list including this new query context.
>>
>> In post_detail_views you are retrieving data from Post based on the post
>> slug and assigning it to variable 'f'. Finally you used the render()
>> shortcut to render the retrieved post using a template.
>>
>> In your urlpatterns you have defined the path for your post_detail which
>> send the post as a slug to your view and in turn view returns the HTTP
>> response.
>>
>> On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:
>>>
>>> Please can someone put me through on this, post details view either one
>>> the function based view or class based view. Thanks
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALWCJq3iJpHpiqRZ2%3D2240AMaedNoMHmJL1fPdAzM%3DzYvsd%2BRA%40mail.gmail.com.


Re: Django how get Post details using slug

2020-07-03 Thread coolguy
Seems pretty simple unless you have specific question about something.

You have a model which has some fields including Slug field which should be 
unique i.e. unique=True but your screen shot is not clear..

In views you are overriding the get_queryset() method of base class and 
assigning it to query variable for the 'q' from http GET request. Then 
filtering Post data with the values in query object you have just created. 
Finally returned the revised object_list including this new query context.

In post_detail_views you are retrieving data from Post based on the post 
slug and assigning it to variable 'f'. Finally you used the render() 
shortcut to render the retrieved post using a template.

In your urlpatterns you have defined the path for your post_detail which 
send the post as a slug to your view and in turn view returns the HTTP 
response.

On Friday, July 3, 2020 at 11:10:22 AM UTC-4, Tanni Seriki wrote:
>
> Please can someone put me through on this, post details view either one 
> the function based view or class based view. Thanks

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.com.


Re: Need Covid 19 Database for Experiments

2020-07-03 Thread Mohsen Pahlevanzadeh
https://www.who.int/data/gho/info/athena-api

On Fri, Jul 3, 2020 at 7:39 PM Shubham Garg  wrote:
>
> Hi Balaji,
>
> You can get COVID-19 dataset from kaggle.com
>
> Let me know if you have any questions.
> Thanks,
>
> On Thu, Jul 2, 2020 at 11:07 PM Balaji Shetty  wrote:
>>
>> Hi
>>
>> Can anyone provide me Covid 19 Database.
>> I need Covid 19 Database for Experiments
>>
>> Thank you
>>
>>
>> --
>> Mr Shetty Balaji
>> Asst. Prof.
>> IT Department
>> SGGS I
>> Nanded. My. India
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAECSbOuuNCY58sB1g2f_ftHtpAs3FamSq%2BBJJZ%2BA5mv_3%3Dw3NQ%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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAD01mrWQ9XfEkuXccrFeJrHXm6tyvESXGtEPF9iiv-rL1h3RAw%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJFFGZLi3pBz3oi820G9gzuQnFGkadh1PKha8rna-fZiAoSfxA%40mail.gmail.com.


Re: Need Covid 19 Database for Experiments

2020-07-03 Thread Shubham Garg
Hi Balaji,

You can get COVID-19 dataset from kaggle.com

Let me know if you have any questions.
Thanks,

On Thu, Jul 2, 2020 at 11:07 PM Balaji Shetty 
wrote:

> Hi
>
> Can anyone provide me Covid 19 Database.
> I need Covid 19 Database for Experiments
>
> Thank you
>
>
> --
> Mr Shetty Balaji
> Asst. Prof.
> IT Department
> SGGS I
> Nanded. My. India
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAECSbOuuNCY58sB1g2f_ftHtpAs3FamSq%2BBJJZ%2BA5mv_3%3Dw3NQ%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD01mrWQ9XfEkuXccrFeJrHXm6tyvESXGtEPF9iiv-rL1h3RAw%40mail.gmail.com.


Re: User.objects.all() only returns username

2020-07-03 Thread Тарас Лисак
Hello,
you get this because in django by default implements __str__ method of User
model, which returns only username of each user. If you want to have
different behaviour, you should implement your one __str__ method in User
model.

пт, 3 лип. 2020 о 09:35 Mohsen Pahlevanzadeh 
пише:

> When  I use select * from auth_user; I get the following result:
> 
>
> ++++--+--++---+--+--+---++
> | id |
> password
> | last_login | is_superuser | username | first_name | last_name |
> email| is_staff | is_active |
> date_joined|
>
> ++++--+--++---+--+--+---++
> |  1 |
> pbkdf2_sha256$18$8waw72qXD5IL$nDgySLTPAt3uLNnUMhzpPVodbkGYtYJJsmBilA7X6g8=
> | NULL   |1 | mohsen   ||   |
> moh...@pahlevanzadeh.net |1 | 1 | 2020-07-03
> 05:57:34.351606 |
> |  2 |
> pbkdf2_sha256$18$NNVfAk9Z98Uz$5m6HPp42ytlZeyLiy8jsYgUKjREu8WbDeLhAb7dFi0M=
> | NULL   |1 | ali  ||   |
> a...@example.com|1 | 1 | 2020-07-03
> 05:58:09.429542 |
>
> ++++--+--++---+--+--+---++
> 2 rows in set (0.000 sec)
>
> #
>
> And When I print(User.objects.all()) , I get the following result:
> #
> , ]>
> [03/Jul/2020 05:58:33] "GET /sql/ HTTP/1.1" 200 4
> ##
>
> Why I can't see all of my fields?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/12b372dc-973d-482f--0f79997bdadeo%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL8eTise2xYtcnCLYpRczjjTADefPgQdQr%2B02YKU%3DsBDH4hwtQ%40mail.gmail.com.


Re: Django +Ajax + jQuery problem

2020-07-03 Thread Andréas Kühne
Hi,

The reason for this is that you are replacing the buttons when you update
the answer. The event listener that you attached is on the first one and
not the second one.
You can solve this in 2 ways:

1. Reregister the event listener when you have loaded the answer again.
2. Use a different way to add the event listeners in the first place. You
can register it this way instead: $('body').on('click', '.upvote',
function() {});

Regards,

Andréas


Den tors 2 juli 2020 kl 19:16 skrev Jan Gregorczyk :

> My problem is that site registers only the first click on .upvote or
> .downvote element and ignores next ones.
> {% extends 'base.html' %}
> {% load votes_exists %}
> {% block title %}{{question.title|truncatechars:52}}{% endblock %}
> {% block content %}
> {{question.title}}
> {{question.content}}
> {% for answer in question.answers.all %}
> {{answer.author}}
> {{answer.content}}
>
> 
> {% votes_up_exists answer request.user.id as is_upvoted %}
> {% votes_down_exists answer request.user.id as is_downvoted %}
> 
> {{answer.vote_score}}
> 
> 
> {% endfor %}
> 
> {% csrf_token %}
> {{form.as_p}}
> 
> 
> {% endblock %}
> {% block javascript %}
> {% load static %}
> https://cdn.jsdelivr.net/npm/js-cookie@rc/dist/js.cookie.min.js";>
> 
> //upvote and downvote script
> var csrftoken = window.Cookies.get('csrftoken');
> function csrfSafeMethod(method) {
> // these HTTP methods do not require CSRF protection
> return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
> }
> $.ajaxSetup({
> beforeSend: function(xhr, settings) {
> if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
> xhr.setRequestHeader("X-CSRFToken", csrftoken);
> }
> }
> });
> $(".upvote").click( function() {
> let answerid = $(this).data("answer-id");
> $.post("{% url 'upvote' %}", {answer_id:answerid}, function(response) {
> /*$("#score-" + answerid).load(window.location.href + " " + "#score-" +
> answerid);
> $("#upvote-" + answerid).load(window.location.href + " " + "#upvote-" +
> answerid);
> $("#downvote-" + answerid).load(window.location.href + " " + "#downvote-"
> + answerid);*/
> $("#answer-" + answerid).load(window.location.href + " " + "#answer-" +
> answerid);
> alert(response);
> });
> });
> $(".downvote").click( function() {
> let answerid = $(this).data("answer-id");
> $.post("{% url 'downvote' %}", {answer_id:answerid}, function(response) {
> /*
> $("#score-" + answerid).load(window.location.href + " " + "#score-" +
> answerid);
> $("#upvote-" + answerid).load(window.location.href + " " + "#upvote-" +
> answerid);
> $("#downvote-" + answerid).load(window.location.href + " " + "#downvote-"
> + answerid);*/
> $("#answer-" + answerid).load(window.location.href + " " + "#answer-" +
> answerid);
> alert(response);
> });
> });
> 
> {% endblock %}
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFyHfE3_EogRCb-2xvGpS6ACDNPbF_JxBLzsfD%3D2XLoBKsJysA%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCeOLmLxGDSQuEzCN51Pr6%2BRWfwNc8UqvrAAsj_JMQFWEw%40mail.gmail.com.


Re: User.objects.all() only returns username

2020-07-03 Thread Jatin Agrawal
When we do, User.objects.all(), it returns a queryset which will show you 
all the objects that are present in the database for the model. So, when 
you print that queryset, it just displays the username of the user.

This is also because the def __str__ method of the User model must be 
returning the username. So, if you want to see all the fields of, check out 
this link: 
https://stackoverflow.com/questions/3106295/django-get-list-of-model-fields

On Friday, July 3, 2020 at 12:05:10 PM UTC+5:30, Mohsen Pahlevanzadeh wrote:
>
> When  I use select * from auth_user; I get the following result:
> 
>
> ++++--+--++---+--+--+---++
> | id | 
> password  
>  
> | last_login | is_superuser | username | first_name | last_name | 
> email| is_staff | is_active | 
> date_joined|
>
> ++++--+--++---+--+--+---++
> |  1 | 
> pbkdf2_sha256$18$8waw72qXD5IL$nDgySLTPAt3uLNnUMhzpPVodbkGYtYJJsmBilA7X6g8=
>  
> | NULL   |1 | mohsen   ||   | 
> moh...@pahlevanzadeh.net  |1 | 1 | 
> 2020-07-03 05:57:34.351606 |
> |  2 | 
> pbkdf2_sha256$18$NNVfAk9Z98Uz$5m6HPp42ytlZeyLiy8jsYgUKjREu8WbDeLhAb7dFi0M=
>  
> | NULL   |1 | ali  ||   | 
> a...@example.com |1 | 1 | 
> 2020-07-03 05:58:09.429542 |
>
> ++++--+--++---+--+--+---++
> 2 rows in set (0.000 sec)
>
> #
>
> And When I print(User.objects.all()) , I get the following result:
> #
> , ]>
> [03/Jul/2020 05:58:33] "GET /sql/ HTTP/1.1" 200 4
> ##
>
> Why I can't see all of my fields?
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a4372a4b-d02d-4859-b34c-8e3fcd31b24eo%40googlegroups.com.


Re: User.objects.all() only returns username

2020-07-03 Thread Mohsen Pahlevanzadeh

By managed.py inspectdb auth_user :
$ ./manage.py inspectdb auth_user;

from django.db import models
class AuthUser(models.Model):
password = models.CharField(max_length=128)
last_login = models.DateTimeField(blank=True, null=True)
is_superuser = models.IntegerField()
username = models.CharField(unique=True, max_length=150)
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=150)
email = models.CharField(max_length=254)
is_staff = models.IntegerField()
is_active = models.IntegerField()
date_joined = models.DateTimeField()
class Meta:
managed = False
db_table = 'auth_user'

On Friday, July 3, 2020 at 11:10:17 AM UTC+4:30, RANGA BHARATH JINKA wrote:
>
> send me your models.py 
>
> On Fri, Jul 3, 2020 at 12:06 PM Mohsen Pahlevanzadeh  > wrote:
>
>> When  I use select * from auth_user; I get the following result:
>> 
>>
>> ++++--+--++---+--+--+---++
>> | id | 
>> password 
>>   
>> | last_login | is_superuser | username | first_name | last_name | 
>> email| is_staff | is_active | 
>> date_joined|
>>
>> ++++--+--++---+--+--+---++
>> |  1 | 
>> pbkdf2_sha256$18$8waw72qXD5IL$nDgySLTPAt3uLNnUMhzpPVodbkGYtYJJsmBilA7X6g8=
>>  
>> | NULL   |1 | mohsen   ||   | 
>> moh...@pahlevanzadeh.net  |1 | 1 | 
>> 2020-07-03 05:57:34.351606 |
>> |  2 | 
>> pbkdf2_sha256$18$NNVfAk9Z98Uz$5m6HPp42ytlZeyLiy8jsYgUKjREu8WbDeLhAb7dFi0M=
>>  
>> | NULL   |1 | ali  ||   | 
>> a...@example.com |1 | 1 | 
>> 2020-07-03 05:58:09.429542 |
>>
>> ++++--+--++---+--+--+---++
>> 2 rows in set (0.000 sec)
>>
>> #
>>
>> And When I print(User.objects.all()) , I get the following result:
>> #
>> , ]>
>> [03/Jul/2020 05:58:33] "GET /sql/ HTTP/1.1" 200 4
>> ##
>>
>> Why I can't see all of my fields?
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/12b372dc-973d-482f--0f79997bdadeo%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b53cffce-c9b8-47a3-b911-ad2e526f82cfo%40googlegroups.com.


Re: User.objects.all() only returns username

2020-07-03 Thread Hella Nick
send me your models.py and views.py


RANGA BHARATH JINKA 于2020年7月3日 周五15:13写道:

> Send me views.py
>
> On Fri, 3 Jul 2020, 12:36 pm Mohsen Pahlevanzadeh, <
> m.pahlevanza...@gmail.com> wrote:
>
>> I don't have model.py for auth_user.
>>
>> On Friday, July 3, 2020 at 11:10:17 AM UTC+4:30, RANGA BHARATH JINKA
>> wrote:
>>>
>>> send me your models.py
>>>
>>> On Fri, Jul 3, 2020 at 12:06 PM Mohsen Pahlevanzadeh <
>>> m.pahle...@gmail.com> wrote:
>>>
 When  I use select * from auth_user; I get the following result:
 

 ++++--+--++---+--+--+---++
 | id |
 password
 | last_login | is_superuser | username | first_name | last_name |
 email| is_staff | is_active |
 date_joined|

 ++++--+--++---+--+--+---++
 |  1 |
 pbkdf2_sha256$18$8waw72qXD5IL$nDgySLTPAt3uLNnUMhzpPVodbkGYtYJJsmBilA7X6g8=
 | NULL   |1 | mohsen   ||   |
 moh...@pahlevanzadeh.net |1 | 1 | 2020-07-03
 05:57:34.351606 |
 |  2 |
 pbkdf2_sha256$18$NNVfAk9Z98Uz$5m6HPp42ytlZeyLiy8jsYgUKjREu8WbDeLhAb7dFi0M=
 | NULL   |1 | ali  ||   |
 a...@example.com|1 | 1 | 2020-07-03
 05:58:09.429542 |

 ++++--+--++---+--+--+---++
 2 rows in set (0.000 sec)


 #

 And When I print(User.objects.all()) , I get the following result:
 #
 , ]>
 [03/Jul/2020 05:58:33] "GET /sql/ HTTP/1.1" 200 4
 ##

 Why I can't see all of my fields?

 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/12b372dc-973d-482f--0f79997bdadeo%40googlegroups.com
 
 .

>>>
>>>
>>> --
>>> Thanks and Regards
>>>
>>> J. Ranga Bharath
>>> cell: 9110334114
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/a6dc1475-d6ac-48fa-872d-3f8698293414o%40googlegroups.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK5m316kK5StndUas_i%2BDxzb4EW-QLfufNFA-FidUWxt5skz-w%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHfGPEd6sUbfq2cfWb3wiGTxt5VbvBXC_mPTt38fdWs7jz69KA%40mail.gmail.com.


Re: User.objects.all() only returns username

2020-07-03 Thread RANGA BHARATH JINKA
Send me views.py

On Fri, 3 Jul 2020, 12:36 pm Mohsen Pahlevanzadeh, <
m.pahlevanza...@gmail.com> wrote:

> I don't have model.py for auth_user.
>
> On Friday, July 3, 2020 at 11:10:17 AM UTC+4:30, RANGA BHARATH JINKA wrote:
>>
>> send me your models.py
>>
>> On Fri, Jul 3, 2020 at 12:06 PM Mohsen Pahlevanzadeh <
>> m.pahle...@gmail.com> wrote:
>>
>>> When  I use select * from auth_user; I get the following result:
>>> 
>>>
>>> ++++--+--++---+--+--+---++
>>> | id |
>>> password
>>> | last_login | is_superuser | username | first_name | last_name |
>>> email| is_staff | is_active |
>>> date_joined|
>>>
>>> ++++--+--++---+--+--+---++
>>> |  1 |
>>> pbkdf2_sha256$18$8waw72qXD5IL$nDgySLTPAt3uLNnUMhzpPVodbkGYtYJJsmBilA7X6g8=
>>> | NULL   |1 | mohsen   ||   |
>>> moh...@pahlevanzadeh.net |1 | 1 | 2020-07-03
>>> 05:57:34.351606 |
>>> |  2 |
>>> pbkdf2_sha256$18$NNVfAk9Z98Uz$5m6HPp42ytlZeyLiy8jsYgUKjREu8WbDeLhAb7dFi0M=
>>> | NULL   |1 | ali  ||   |
>>> a...@example.com|1 | 1 | 2020-07-03
>>> 05:58:09.429542 |
>>>
>>> ++++--+--++---+--+--+---++
>>> 2 rows in set (0.000 sec)
>>>
>>> #
>>>
>>> And When I print(User.objects.all()) , I get the following result:
>>> #
>>> , ]>
>>> [03/Jul/2020 05:58:33] "GET /sql/ HTTP/1.1" 200 4
>>> ##
>>>
>>> Why I can't see all of my fields?
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/12b372dc-973d-482f--0f79997bdadeo%40googlegroups.com
>>> 
>>> .
>>>
>>
>>
>> --
>> Thanks and Regards
>>
>> J. Ranga Bharath
>> cell: 9110334114
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a6dc1475-d6ac-48fa-872d-3f8698293414o%40googlegroups.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK5m316kK5StndUas_i%2BDxzb4EW-QLfufNFA-FidUWxt5skz-w%40mail.gmail.com.


Re: User.objects.all() only returns username

2020-07-03 Thread Mohsen Pahlevanzadeh
I don't have model.py for auth_user.

On Friday, July 3, 2020 at 11:10:17 AM UTC+4:30, RANGA BHARATH JINKA wrote:
>
> send me your models.py 
>
> On Fri, Jul 3, 2020 at 12:06 PM Mohsen Pahlevanzadeh  > wrote:
>
>> When  I use select * from auth_user; I get the following result:
>> 
>>
>> ++++--+--++---+--+--+---++
>> | id | 
>> password 
>>   
>> | last_login | is_superuser | username | first_name | last_name | 
>> email| is_staff | is_active | 
>> date_joined|
>>
>> ++++--+--++---+--+--+---++
>> |  1 | 
>> pbkdf2_sha256$18$8waw72qXD5IL$nDgySLTPAt3uLNnUMhzpPVodbkGYtYJJsmBilA7X6g8=
>>  
>> | NULL   |1 | mohsen   ||   | 
>> moh...@pahlevanzadeh.net  |1 | 1 | 
>> 2020-07-03 05:57:34.351606 |
>> |  2 | 
>> pbkdf2_sha256$18$NNVfAk9Z98Uz$5m6HPp42ytlZeyLiy8jsYgUKjREu8WbDeLhAb7dFi0M=
>>  
>> | NULL   |1 | ali  ||   | 
>> a...@example.com |1 | 1 | 
>> 2020-07-03 05:58:09.429542 |
>>
>> ++++--+--++---+--+--+---++
>> 2 rows in set (0.000 sec)
>>
>> #
>>
>> And When I print(User.objects.all()) , I get the following result:
>> #
>> , ]>
>> [03/Jul/2020 05:58:33] "GET /sql/ HTTP/1.1" 200 4
>> ##
>>
>> Why I can't see all of my fields?
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/12b372dc-973d-482f--0f79997bdadeo%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a6dc1475-d6ac-48fa-872d-3f8698293414o%40googlegroups.com.


Re: User.objects.all() only returns username

2020-07-03 Thread RANGA BHARATH JINKA
send me your models.py

On Fri, Jul 3, 2020 at 12:06 PM Mohsen Pahlevanzadeh <
m.pahlevanza...@gmail.com> wrote:

> When  I use select * from auth_user; I get the following result:
> 
>
> ++++--+--++---+--+--+---++
> | id |
> password
> | last_login | is_superuser | username | first_name | last_name |
> email| is_staff | is_active |
> date_joined|
>
> ++++--+--++---+--+--+---++
> |  1 |
> pbkdf2_sha256$18$8waw72qXD5IL$nDgySLTPAt3uLNnUMhzpPVodbkGYtYJJsmBilA7X6g8=
> | NULL   |1 | mohsen   ||   |
> moh...@pahlevanzadeh.net |1 | 1 | 2020-07-03
> 05:57:34.351606 |
> |  2 |
> pbkdf2_sha256$18$NNVfAk9Z98Uz$5m6HPp42ytlZeyLiy8jsYgUKjREu8WbDeLhAb7dFi0M=
> | NULL   |1 | ali  ||   |
> a...@example.com|1 | 1 | 2020-07-03
> 05:58:09.429542 |
>
> ++++--+--++---+--+--+---++
> 2 rows in set (0.000 sec)
>
> #
>
> And When I print(User.objects.all()) , I get the following result:
> #
> , ]>
> [03/Jul/2020 05:58:33] "GET /sql/ HTTP/1.1" 200 4
> ##
>
> Why I can't see all of my fields?
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/12b372dc-973d-482f--0f79997bdadeo%40googlegroups.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK5m317krnrFBVM3aRvXnCbg7Jfuhj_SHmk9jdWums6j%3DO_M2Q%40mail.gmail.com.


User.objects.all() only returns username

2020-07-03 Thread Mohsen Pahlevanzadeh
When  I use select * from auth_user; I get the following result:

++++--+--++---+--+--+---++
| id | 
password   
| last_login | is_superuser | username | first_name | last_name | 
email| is_staff | is_active | 
date_joined|
++++--+--++---+--+--+---++
|  1 | 
pbkdf2_sha256$18$8waw72qXD5IL$nDgySLTPAt3uLNnUMhzpPVodbkGYtYJJsmBilA7X6g8= 
| NULL   |1 | mohsen   ||   | 
moh...@pahlevanzadeh.net |1 | 1 | 2020-07-03 
05:57:34.351606 |
|  2 | 
pbkdf2_sha256$18$NNVfAk9Z98Uz$5m6HPp42ytlZeyLiy8jsYgUKjREu8WbDeLhAb7dFi0M= 
| NULL   |1 | ali  ||   | 
a...@example.com|1 | 1 | 2020-07-03 
05:58:09.429542 |
++++--+--++---+--+--+---++
2 rows in set (0.000 sec)

#

And When I print(User.objects.all()) , I get the following result:
#
, ]>
[03/Jul/2020 05:58:33] "GET /sql/ HTTP/1.1" 200 4
##

Why I can't see all of my fields?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/12b372dc-973d-482f--0f79997bdadeo%40googlegroups.com.