Re: Please help me out?

2020-05-30 Thread Sharva kant
Hi Meera,

I believe you would have to use Javascript framework on front end to do
that. You can use Vuejs, Angular js , React or Ember to do that

Cheers
Sharva

On Sat, 30 May 2020 at 22:31, meera gangani 
wrote:

>  I want to generate trello-board in my django application
> Can anyone tell me the How to do this?
> Trello-board is like( to-do and future enhancements and doing ) where
> there are 3-4 columns
>
>
> In-advance thank you
> -Meera Gangani
>
> --
> 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/CANaPPP%2BZO-552o6%3DJDoc-mCBZ1Q%3DCrv0JE%2B-e%3DzFKRAzfHFMgQ%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/CAKRQzujLOV%2BtUKZkh4%2Bi1VJWcE%3DeHLWoaKcbZXbjaMq_xoBOEw%40mail.gmail.com.


Please help me out?

2020-05-30 Thread meera gangani
 I want to generate trello-board in my django application
Can anyone tell me the How to do this?
Trello-board is like( to-do and future enhancements and doing ) where there
are 3-4 columns


In-advance thank you
-Meera Gangani

-- 
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/CANaPPP%2BZO-552o6%3DJDoc-mCBZ1Q%3DCrv0JE%2B-e%3DzFKRAzfHFMgQ%40mail.gmail.com.


Re: Why is "Hello World!" alternating with Django welcome page after following tutorial?

2020-05-30 Thread Thomas G. McNeill
Well, never mind. I changed some stuff, and then I changed it all back, as 
far as I know. But now it is working correctly. I have no idea what I 
changed.

On Saturday, May 30, 2020 at 5:41:52 PM UTC-6, Thomas G. McNeill wrote:
>
> I just followed this tutorial to create the simplest possible Django 
> application:
>
> https://aws.amazon.com/getting-started/hands-on/deploy-python-application/
>
> I used *campaign* instead of *tutorial* and *app* instead of *hello_world* 
> because 
> I intend to transform the tutorial into a simple production application.
>
> When I load the app in my browser, I get either "Hello, World!" (the 
> expected result) or the Django welcome page ("The install worked 
> successfully! Congratulations! You are seeing this page because DEBUG=True 
> is in your settings file and you have not configured any URLs"). The two 
> alternate. It's not random -- I always get one and then the other when I 
> reload the page.
>
> campaign/app/urls.py contains:
>
> from django.urls import path
> from . import views
>
> urlpatterns = [
>  path('', views.index, name='index'),
> ]
>
>
> campaign/campaign/urls.py contains:
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('', include('app.urls')),
> path('admin/', admin.site.urls),
> ]
>
>
> I don't get how it works as expected every OTHER time. Obviously I can't 
> move on until I get this fixed.
>
>
>
>
>
>
>
>
>

-- 
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/3efafd05-7f3b-4afa-8f77-7b81ecdaebdf%40googlegroups.com.


Why is "Hello World!" alternating with Django welcome page after following tutorial?

2020-05-30 Thread Thomas G. McNeill
I just followed this tutorial to create the simplest possible Django 
application:

https://aws.amazon.com/getting-started/hands-on/deploy-python-application/

I used *campaign* instead of *tutorial* and *app* instead of *hello_world* 
because 
I intend to transform the tutorial into a simple production application.

When I load the app in my browser, I get either "Hello, World!" (the 
expected result) or the Django welcome page ("The install worked 
successfully! Congratulations! You are seeing this page because DEBUG=True 
is in your settings file and you have not configured any URLs"). The two 
alternate. It's not random -- I always get one and then the other when I 
reload the page.

campaign/app/urls.py contains:

from django.urls import path
from . import views

urlpatterns = [
 path('', views.index, name='index'),
]


campaign/campaign/urls.py contains:

from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path('', include('app.urls')),
path('admin/', admin.site.urls),
]


I don't get how it works as expected every OTHER time. Obviously I can't 
move on until I get this fixed.








-- 
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/51f3e62a-62c0-4db4-a8d0-2f96a6af3cf7%40googlegroups.com.


Re: Command open postgresql in from cmd in windows

2020-05-30 Thread Samuel Nogueira
you just need to specify the username wich you want to use. So type "psql
-U postgres", as postgres being your username.


Em sáb., 30 de mai. de 2020 às 18:47, sunday honesty <
honesty202...@gmail.com> escreveu:

> Here is it again
>
> On Sat, May 30, 2020, 10:44 PM Samuel Nogueira 
> wrote:
>
>> Sorry but i think your screenshot wasn’t attached to your last email,
>> please end it again
>>
>> *De: *sunday honesty 
>> *Enviado:*sábado, 30 de maio de 2020 18:28
>> *Para: *django-users@googlegroups.com
>> *Assunto: *Re: Command open postgresql in from cmd in windows
>>
>>
>>
>> Here is the screenshot... Pls download.
>>
>>
>>
>> PS: I was connected to the internet and also tried it without internet
>> connection.
>>
>>
>>
>> On Sat, May 30, 2020, 10:17 PM Samuel Nogueira 
>> wrote:
>>
>> Can you send  me more details about the error? A screenshot should be
>> enough
>>
>> *De: *sunday honesty 
>> *Enviado:*sábado, 30 de maio de 2020 15:18
>> *Para: *django-users@googlegroups.com
>> *Assunto: *Re: Command open postgresql in from cmd in windows
>>
>>
>>
>> @Samuel,
>>
>> I did that and psql now opened and prompted me to enter password for my
>> user name(system). I entered the password I created while installing
>> postgresql and got a fatal error even when I was connected to the
>> internet...
>>
>>
>>
>> PS: the username it gave me during installation is postgres but prompted
>> me to enter password for my computer username
>>
>>
>>
>> On Sat, May 30, 2020, 6:39 PM Samuel Nogueira 
>> wrote:
>>
>> Set path For PostgreSQL in Windows:
>>
>>
>>
>>1. Searching for env will show Edit environment variables for your
>>account
>>2. Select Environment Variables
>>
>>
>>1. From the System Variables box click new(to add new path)
>>
>>
>>
>> Include the bin directory of your PostgreSQL installation. then add new
>> path there
>>
>> [for example]
>>
>> C:\Program Files\PostgreSQL\12\bin
>>
>> After that click OK and then try to type psql in your command shell
>>
>>
>>
>> I adapted this from a comment in stackoverflow in the link bellow, if it
>> doesnt work I suggest you to go there.
>>
>>
>> https://stackoverflow.com/questions/11460823/setting-windows-path-for-postgres-tools
>>
>>
>>
>> *De: *sunday honesty 
>> *Enviado:*sábado, 30 de maio de 2020 14:20
>> *Para: *Django users 
>> *Assunto: *Command open postgresql in from cmd in windows
>>
>>
>>
>> I have been in a message before I could successfully install postgresql
>> on my windows; it seems everyone is using Linux or Mac.
>>
>>
>>
>> Pls can someone help me now...
>>
>> I want to open postgres she'll from my command prompt so I can continue
>> what am learning... The Tutorial am following is using Linux and the
>> command to "psql" to open shell is not working on my windows.
>>
>>
>>
>> Anybody please.
>>
>>
>>
>> --
>>
>> 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/e2396f7b-9e27-442d-a2aa-302a089bead8%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/029CFE67-6146-41CD-A684-E616D519A356%40hxcore.ol
>> 
>> .
>>
>> --
>> 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/CALcuGNuGh1hKneW5cfB6rRwiKspy_U%2BpKNYpXf1-t1wKuWnHmg%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/82EDD67E-5365-4148-BCE2-F2442C82E8BB%40hxcore.ol
>> 
>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this 

Re: Command open postgresql in from cmd in windows

2020-05-30 Thread sunday honesty
Here is it again

On Sat, May 30, 2020, 10:44 PM Samuel Nogueira  wrote:

> Sorry but i think your screenshot wasn’t attached to your last email,
> please end it again
>
> *De: *sunday honesty 
> *Enviado:*sábado, 30 de maio de 2020 18:28
> *Para: *django-users@googlegroups.com
> *Assunto: *Re: Command open postgresql in from cmd in windows
>
>
>
> Here is the screenshot... Pls download.
>
>
>
> PS: I was connected to the internet and also tried it without internet
> connection.
>
>
>
> On Sat, May 30, 2020, 10:17 PM Samuel Nogueira 
> wrote:
>
> Can you send  me more details about the error? A screenshot should be
> enough
>
> *De: *sunday honesty 
> *Enviado:*sábado, 30 de maio de 2020 15:18
> *Para: *django-users@googlegroups.com
> *Assunto: *Re: Command open postgresql in from cmd in windows
>
>
>
> @Samuel,
>
> I did that and psql now opened and prompted me to enter password for my
> user name(system). I entered the password I created while installing
> postgresql and got a fatal error even when I was connected to the
> internet...
>
>
>
> PS: the username it gave me during installation is postgres but prompted
> me to enter password for my computer username
>
>
>
> On Sat, May 30, 2020, 6:39 PM Samuel Nogueira 
> wrote:
>
> Set path For PostgreSQL in Windows:
>
>
>
>1. Searching for env will show Edit environment variables for your
>account
>2. Select Environment Variables
>
>
>1. From the System Variables box click new(to add new path)
>
>
>
> Include the bin directory of your PostgreSQL installation. then add new
> path there
>
> [for example]
>
> C:\Program Files\PostgreSQL\12\bin
>
> After that click OK and then try to type psql in your command shell
>
>
>
> I adapted this from a comment in stackoverflow in the link bellow, if it
> doesnt work I suggest you to go there.
>
>
> https://stackoverflow.com/questions/11460823/setting-windows-path-for-postgres-tools
>
>
>
> *De: *sunday honesty 
> *Enviado:*sábado, 30 de maio de 2020 14:20
> *Para: *Django users 
> *Assunto: *Command open postgresql in from cmd in windows
>
>
>
> I have been in a message before I could successfully install postgresql on
> my windows; it seems everyone is using Linux or Mac.
>
>
>
> Pls can someone help me now...
>
> I want to open postgres she'll from my command prompt so I can continue
> what am learning... The Tutorial am following is using Linux and the
> command to "psql" to open shell is not working on my windows.
>
>
>
> Anybody please.
>
>
>
> --
>
> 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/e2396f7b-9e27-442d-a2aa-302a089bead8%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/029CFE67-6146-41CD-A684-E616D519A356%40hxcore.ol
> 
> .
>
> --
> 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/CALcuGNuGh1hKneW5cfB6rRwiKspy_U%2BpKNYpXf1-t1wKuWnHmg%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/82EDD67E-5365-4148-BCE2-F2442C82E8BB%40hxcore.ol
> 
> .
>
> --
> 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/CALcuGNsYJgUJQ%2BSywNePjqCH3PM9hpcH97cHDgxj%2BD12ufbdDA%40mail.gmail.com
> 

RES: Command open postgresql in from cmd in windows

2020-05-30 Thread Samuel Nogueira
Sorry but i think your screenshot wasn’t attached to your last email, please end it againDe: sunday honestyEnviado:sábado, 30 de maio de 2020 18:28Para: django-users@googlegroups.comAssunto: Re: Command open postgresql in from cmd in windows Here is the screenshot... Pls download. PS: I was connected to the internet and also tried it without internet connection. On Sat, May 30, 2020, 10:17 PM Samuel Nogueira  wrote:Can you send  me more details about the error? A screenshot should be enoughDe: sunday honestyEnviado:sábado, 30 de maio de 2020 15:18Para: django-users@googlegroups.comAssunto: Re: Command open postgresql in from cmd in windows @Samuel,I did that and psql now opened and prompted me to enter password for my user name(system). I entered the password I created while installing postgresql and got a fatal error even when I was connected to the internet... PS: the username it gave me during installation is postgres but prompted me to enter password for my computer username On Sat, May 30, 2020, 6:39 PM Samuel Nogueira  wrote:Set path For PostgreSQL in Windows: Searching for env will show Edit environment variables for your accountSelect Environment Variables>From the System Variables box click new(to add new path) Include the bin directory of your PostgreSQL installation. then add new path there[for example]C:\Program Files\PostgreSQL\12\binAfter that click OK and then try to type psql in your command shell I adapted this from a comment in stackoverflow in the link bellow, if it doesnt work I suggest you to go there.https://stackoverflow.com/questions/11460823/setting-windows-path-for-postgres-tools De: sunday honestyEnviado:sábado, 30 de maio de 2020 14:20Para: Django usersAssunto: Command open postgresql in from cmd in windows I have been in a message before I could successfully install postgresql on my windows; it seems everyone is using Linux or Mac. Pls can someone help me now...I want to open postgres she'll from my command prompt so I can continue what am learning... The Tutorial am following is using Linux and the command to "psql" to open shell is not working on my windows. Anybody please. -- 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/e2396f7b-9e27-442d-a2aa-302a089bead8%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/029CFE67-6146-41CD-A684-E616D519A356%40hxcore.ol.-- 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/CALcuGNuGh1hKneW5cfB6rRwiKspy_U%2BpKNYpXf1-t1wKuWnHmg%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/82EDD67E-5365-4148-BCE2-F2442C82E8BB%40hxcore.ol.-- 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/CALcuGNsYJgUJQ%2BSywNePjqCH3PM9hpcH97cHDgxj%2BD12ufbdDA%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/ED2B55E2-4BF0-4992-A6C5-233D3243F14F%40hxcore.ol.


Re: Command open postgresql in from cmd in windows

2020-05-30 Thread sunday honesty
Here is the screenshot... Pls download.

PS: I was connected to the internet and also tried it without internet
connection.

On Sat, May 30, 2020, 10:17 PM Samuel Nogueira  wrote:

> Can you send  me more details about the error? A screenshot should be
> enough
>
> *De: *sunday honesty 
> *Enviado:*sábado, 30 de maio de 2020 15:18
> *Para: *django-users@googlegroups.com
> *Assunto: *Re: Command open postgresql in from cmd in windows
>
>
>
> @Samuel,
>
> I did that and psql now opened and prompted me to enter password for my
> user name(system). I entered the password I created while installing
> postgresql and got a fatal error even when I was connected to the
> internet...
>
>
>
> PS: the username it gave me during installation is postgres but prompted
> me to enter password for my computer username
>
>
>
> On Sat, May 30, 2020, 6:39 PM Samuel Nogueira 
> wrote:
>
> Set path For PostgreSQL in Windows:
>
>
>
>1. Searching for env will show Edit environment variables for your
>account
>2. Select Environment Variables
>
>
>1. From the System Variables box click new(to add new path)
>
>
>
> Include the bin directory of your PostgreSQL installation. then add new
> path there
>
> [for example]
>
> C:\Program Files\PostgreSQL\12\bin
>
> After that click OK and then try to type psql in your command shell
>
>
>
> I adapted this from a comment in stackoverflow in the link bellow, if it
> doesnt work I suggest you to go there.
>
>
> https://stackoverflow.com/questions/11460823/setting-windows-path-for-postgres-tools
>
>
>
> *De: *sunday honesty 
> *Enviado:*sábado, 30 de maio de 2020 14:20
> *Para: *Django users 
> *Assunto: *Command open postgresql in from cmd in windows
>
>
>
> I have been in a message before I could successfully install postgresql on
> my windows; it seems everyone is using Linux or Mac.
>
>
>
> Pls can someone help me now...
>
> I want to open postgres she'll from my command prompt so I can continue
> what am learning... The Tutorial am following is using Linux and the
> command to "psql" to open shell is not working on my windows.
>
>
>
> Anybody please.
>
>
>
> --
>
> 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/e2396f7b-9e27-442d-a2aa-302a089bead8%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/029CFE67-6146-41CD-A684-E616D519A356%40hxcore.ol
> 
> .
>
> --
> 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/CALcuGNuGh1hKneW5cfB6rRwiKspy_U%2BpKNYpXf1-t1wKuWnHmg%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/82EDD67E-5365-4148-BCE2-F2442C82E8BB%40hxcore.ol
> 
> .
>

-- 
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/CALcuGNsYJgUJQ%2BSywNePjqCH3PM9hpcH97cHDgxj%2BD12ufbdDA%40mail.gmail.com.


RES: Command open postgresql in from cmd in windows

2020-05-30 Thread Samuel Nogueira
Can you send  me more details about the error? A screenshot should be enoughDe: sunday honestyEnviado:sábado, 30 de maio de 2020 15:18Para: django-users@googlegroups.comAssunto: Re: Command open postgresql in from cmd in windows @Samuel,I did that and psql now opened and prompted me to enter password for my user name(system). I entered the password I created while installing postgresql and got a fatal error even when I was connected to the internet... PS: the username it gave me during installation is postgres but prompted me to enter password for my computer username On Sat, May 30, 2020, 6:39 PM Samuel Nogueira  wrote:Set path For PostgreSQL in Windows: Searching for env will show Edit environment variables for your accountSelect Environment VariablesFrom the System Variables box click new(to add new path) Include the bin directory of your PostgreSQL installation. then add new path there[for example]C:\Program Files\PostgreSQL\12\binAfter that click OK and then try to type psql in your command shell I adapted this from a comment in stackoverflow in the link bellow, if it doesnt work I suggest you to go there.https://stackoverflow.com/questions/11460823/setting-windows-path-for-postgres-tools De: sunday honestyEnviado:sábado, 30 de maio de 2020 14:20Para: Django usersAssunto: Command open postgresql in from cmd in windows I have been in a message before I could successfully install postgresql on my windows; it seems everyone is using Linux or Mac. Pls can someone help me now...I want to open postgres she'll from my command prompt so I can continue what am learning... The Tutorial am following is using Linux and the command to "psql" to open shell is not working on my windows. Anybody please. -- 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/e2396f7b-9e27-442d-a2aa-302a089bead8%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/029CFE67-6146-41CD-A684-E616D519A356%40hxcore.ol.-- 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/CALcuGNuGh1hKneW5cfB6rRwiKspy_U%2BpKNYpXf1-t1wKuWnHmg%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/82EDD67E-5365-4148-BCE2-F2442C82E8BB%40hxcore.ol.


Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-30 Thread Iain Stewart
Hi Matt.

Typing in to your pycharm console:

py manage.py migrate --fake [your_app_Name] zero

where your_app_name is PyShop or whatever it is called, that should delete
the previous migrations/ reset the tracking I think.

Iain

On Sat, 30 May 2020 at 18:49, Matt D  wrote:

>
>> ^ Is this where you deleted the migrations?
>
> I keep receiving this error when I enter py manage.py migrate products:
>
> --
> 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/a2ad2f14-0144-4ce8-9100-c107b8b36d22%40googlegroups.com
> 
> .
>


-- 
Iain Stewart
2b Priestfield Road
EDINBURGH EH16 5HH SCOTLAND
iain.a.stew...@gmail.com

telephone: 0044 131 662 9123
mobile: 0044 7728 752824

-- 
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/CAAAU1KR61zKA4mTeYNYhoFtX3u%2BWH6zcrEoFDznk3p1sXxXN1A%40mail.gmail.com.


Re: Command open postgresql in from cmd in windows

2020-05-30 Thread sunday honesty
@Samuel,
I did that and psql now opened and prompted me to enter password for my
user name(system). I entered the password I created while installing
postgresql and got a fatal error even when I was connected to the
internet...

PS: the username it gave me during installation is postgres but prompted me
to enter password for my computer username

On Sat, May 30, 2020, 6:39 PM Samuel Nogueira  wrote:

> Set path For PostgreSQL in Windows:
>
>
>
>1. Searching for env will show Edit environment variables for your
>account
>2. Select Environment Variables
>
>
>1. From the System Variables box click new(to add new path)
>
>
>
> Include the bin directory of your PostgreSQL installation. then add new
> path there
>
> [for example]
>
> C:\Program Files\PostgreSQL\12\bin
>
> After that click OK and then try to type psql in your command shell
>
>
>
> I adapted this from a comment in stackoverflow in the link bellow, if it
> doesnt work I suggest you to go there.
>
>
> https://stackoverflow.com/questions/11460823/setting-windows-path-for-postgres-tools
>
>
>
> *De: *sunday honesty 
> *Enviado:*sábado, 30 de maio de 2020 14:20
> *Para: *Django users 
> *Assunto: *Command open postgresql in from cmd in windows
>
>
>
> I have been in a message before I could successfully install postgresql on
> my windows; it seems everyone is using Linux or Mac.
>
>
>
> Pls can someone help me now...
>
> I want to open postgres she'll from my command prompt so I can continue
> what am learning... The Tutorial am following is using Linux and the
> command to "psql" to open shell is not working on my windows.
>
>
>
> Anybody please.
>
>
>
> --
>
> 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/e2396f7b-9e27-442d-a2aa-302a089bead8%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/029CFE67-6146-41CD-A684-E616D519A356%40hxcore.ol
> 
> .
>

-- 
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/CALcuGNuGh1hKneW5cfB6rRwiKspy_U%2BpKNYpXf1-t1wKuWnHmg%40mail.gmail.com.


RES: How to connect Django Logn Sigup API with Flutter

2020-05-30 Thread Samuel Nogueira
Are you using only django? Usually if you want to connect an app with your django backend you might need to use the django rest framework to get the connection De: Anonymous PatelEnviado:terça-feira, 26 de maio de 2020 04:23Para: django-users@googlegroups.comAssunto: How to connect Django Logn Sigup API with Flutter Help me pleaseI have created login , sign-up API , and even ready with Flutter deaigns,I don't know how to make it functional.If anyone can help me to connect Django API with flutter app.Raj Patel-- 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/CAF_9CiuDa5u1aUGgkb%2BMwMmBfNoFOp_p4bdA%2B38Bo9JVrrbRaw%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/531EB69A-382D-49DF-87D5-60ED766F1B12%40hxcore.ol.


Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-30 Thread Matt D

>
>
> ^ Is this where you deleted the migrations?

I keep receiving this error when I enter py manage.py migrate products:

-- 
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/a2ad2f14-0144-4ce8-9100-c107b8b36d22%40googlegroups.com.


Django

2020-05-30 Thread Ogunsanya Opeyemi
Hi please how do I make a function in JavaScript in django not to function 
after reloading a page. Thank you

-- 
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/1dc29c19-c3fa-4722-9347-5ef385ae94df%40googlegroups.com.


Re: Customizing Django built-in views such as LoginView

2020-05-30 Thread 'László Hegedűs' via Django users
I was a Django fan since I am freelancer, and introduced to Flask.
The best is in Django is 2 thing:
First, easy to use.
Second: consitent. So I think each of the solution is good if not have side 
effect to the other.

On Friday, May 29, 2020 at 2:31:17 PM UTC+2, Uri wrote:
>
> Django users,
>
> Which way is preferred to customize Django built-in views such as 
> LoginView:
>
> - Define a line in urls.py:
>
> path(route='login/', view=views.django_auth_views.LoginView.as_view(
> template_name='accounts/login.html', authentication_form=forms.LoginForm, 
> extra_context=None, redirect_authenticated_user=True), name='login'),
>
> Where, views.py contains:
>
> from django.contrib.auth import views as django_auth_views
>
>
> *Or:*
>
> In views.py, define a new class:
>
> class LoginView(django_auth_views.LoginView):
> template_name = 'accounts/login.html'
> authentication_form = LoginForm
> extra_context = None
> redirect_authenticated_user = True
>
> And then, define in urls.py:
>
> path(route='login/', view=views.LoginView.as_view(), name='login'),
>
>
> Will both ways work the same, and is one of them preferred from a software 
> engineering / programming perspective?
>
> Thanks,
> Uri.
> אורי
> u...@speedy.net 
>

-- 
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/d0d6f677-4317-462e-bd6a-e48a06757077%40googlegroups.com.


Re: Command open postgresql in from cmd in windows

2020-05-30 Thread Jorge Gimeno
Postgres on Windows may have a different story and user interface.  You may
need to use something like pAdmin to work with it.

-Jorge

On Sat, May 30, 2020 at 10:20 AM sunday honesty 
wrote:

> I have been in a message before I could successfully install postgresql on
> my windows; it seems everyone is using Linux or Mac.
>
> Pls can someone help me now...
> I want to open postgres she'll from my command prompt so I can continue
> what am learning... The Tutorial am following is using Linux and the
> command to "psql" to open shell is not working on my windows.
>
> Anybody please.
>
> --
> 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/e2396f7b-9e27-442d-a2aa-302a089bead8%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/CANfN%3DK_booKRib%3DOGvfJQZzvejxGEYBgzsOyuSscbQdN9D1fiQ%40mail.gmail.com.


RES: Command open postgresql in from cmd in windows

2020-05-30 Thread Samuel Nogueira
Set path For PostgreSQL in Windows: Searching for env will show Edit environment variables for your accountSelect Environment VariablesFrom the System Variables box click new(to add new path) Include the bin directory of your PostgreSQL installation. then add new path there[for example]C:\Program Files\PostgreSQL\12\binAfter that click OK and then try to type psql in your command shell I adapted this from a comment in stackoverflow in the link bellow, if it doesnt work I suggest you to go there.https://stackoverflow.com/questions/11460823/setting-windows-path-for-postgres-tools De: sunday honestyEnviado:sábado, 30 de maio de 2020 14:20Para: Django usersAssunto: Command open postgresql in from cmd in windows I have been in a message before I could successfully install postgresql on my windows; it seems everyone is using Linux or Mac. Pls can someone help me now...I want to open postgres she'll from my command prompt so I can continue what am learning... The Tutorial am following is using Linux and the command to "psql" to open shell is not working on my windows. Anybody please. -- 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/e2396f7b-9e27-442d-a2aa-302a089bead8%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/029CFE67-6146-41CD-A684-E616D519A356%40hxcore.ol.


Command open postgresql in from cmd in windows

2020-05-30 Thread sunday honesty
I have been in a message before I could successfully install postgresql on my 
windows; it seems everyone is using Linux or Mac.

Pls can someone help me now...
I want to open postgres she'll from my command prompt so I can continue what am 
learning... The Tutorial am following is using Linux and the command to "psql" 
to open shell is not working on my windows.

Anybody please.

-- 
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/e2396f7b-9e27-442d-a2aa-302a089bead8%40googlegroups.com.


Re: Django Pagination

2020-05-30 Thread Chetan Ganji
Hi akshat,
What is the difficulty?
Where have you defined the variable   is_paginated? Is it present in the
context?

On Sat, May 30, 2020, 8:53 PM maninder singh Kumar <
maninder.s.ku...@gmail.com> wrote:

> Views.py looks fine !
>
> regards
> willy
>
>
> On Sat, May 30, 2020 at 7:22 PM Akshat Zala  wrote:
>
>> Hello,
>>
>> I am finding it difficult to paginate through all the posts
>>
>> My views.py :
>>
>> @login_required
>> def home_view(request):
>> """Display all the post of friends and own posts on the dashboard"""
>> posts = Post.objects.all().order_by('-date_posted')
>> media: MEDIA_URL
>> # 'post':Post.objects.filter(Q(author=request.user) |
>> Q(author__from_user=request.user) |
>> Q(author__to_user=request.user)).order_by('-date_posted'),
>> paginator = Paginator(posts, 2)
>> page_number = request.GET.get('page')
>> page_obj = paginator.get_page(page_number)
>> return render(request, 'post/home.html',{'page_obj': page_obj})
>>
>>
>> and in template post/home.html:
>>
>> {% if is_paginated %}
>> {% if page_obj.has_previous %}
>> First
>> arrow_left
>> 
>> {% endif %}
>> {% for num in page_obj.paginator.page_range %}
>> {% if page_obj.number == num %}
>> {{ num }}
>> {% elif num > page_obj.number|add:'-4' and num < page_obj.number|add:'4'
>> %}
>> {{ num }}
>> {% endif %}
>> {% endfor %}
>> {% if page_obj.has_next %}
>> arrow_right
>> Last
>> {% endif %}
>>
>>
>> Thanks
>>
>> Akshat Zala
>>
>> --
>> 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/87c3f0db-3088-448c-b3c7-14450e8c2f5d%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/CABOHK3QumzEA417%3DMV3dTwRszxmULfHp9y-tADSD56N_sTNQ5g%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/CAMKMUjveFbK%2BJ3ocK-cTzo%3Dbzt8b%2BSz-dF9C64X4Law-WjkhVA%40mail.gmail.com.


Re: Possible Bug? AttributeError: 'HttpResponse' object has no attribute '_resource_closers'

2020-05-30 Thread Tim Allen
Thanks for the reply, my friend. Unfortunately, no new middleware has been 
added. Some folks have said clearing the Django cache(s) worked, but it 
hasn't for me.

I've long been a mod_wsgi user, but I think it is time to move on to 
gunicorn, so I've started moving in that direction rather than sinking a 
lot more time here.

On Saturday, May 16, 2020 at 5:02:32 PM UTC-4, jlgimeno71 wrote:
>
>
>
> On Sat, May 16, 2020 at 12:06 PM Tim Allen  > wrote:
>
>> I posted this to Stack Overflow first, thinking it might be a problem 
>> with `mod_wsgi`, but people using Gunicorn have seen the issue too. Here's 
>> a link to the question on Stack Overflow:
>>
>>
>> https://stackoverflow.com/questions/61295971/django-3-0-5-with-mod-wsgi-attributeerror-httpresponse-object-has-no-attribu
>>
>> Unfortunately, purging my cache hasn't fixed the problem like it did for 
>> a commenter on the question, so I'm asking here for amplification. Here's 
>> the text of the post:
>>
>> I'm getting an error when I deploy Django 3.0.5 under mod_wsgi:  
>> AttributeError: 
>> 'HttpResponse' object has no attribute '_resource_closers'. I'm running:
>>
>>- Python: 3.6.8
>>- Django: 3.0.5
>>- Apache: 2.4.6
>>- mod_wsgi: 4.6.2
>>
>> Here's the basics of the view causing the error; nothing too exotic (I've 
>> simplified the code around meetings_struct):
>>
>>
>> class MeetingsAPIView(MeetingsBaseView):
>> def get(self, request, *args, **kwargs):
>> meetings = self.get_meetings()
>> meetings_struct = []
>>
>> for meeting in meetings:
>> meetings_struct.append({
>> "id": meeting.id,
>> "name": meeting.title,
>> "slug": meeting.slug,
>> })
>>
>> return HttpResponse(meetings_struct, content_type="application/json")
>>
>>
>> If I activate the venv and use runserver manually on the server on port 
>> 80, the same view does not give an error. When the same code and venv are 
>> running under Apache, here's the error from Apache's logs:
>>
>>
>> [Sat Apr 18 16:11:30.683980 2020] [wsgi:error] [pid 4154] [remote 
>> 100.19.146.139:54397] mod_wsgi (pid=4154): Exception occurred processing 
>> WSGI script '/var/django/sites/mysite-prod/config/wsgi.py'.[Sat Apr 18 
>> 16:11:30.684834 2020] [wsgi:error] [pid 4154] [remote 100.19.146.139:54397] 
>> Traceback (most recent call last):[Sat Apr 18 16:11:30.684891 2020] 
>> [wsgi:error] [pid 4154] [remote 100.19.146.139:54397]   File 
>> "/var/django/sites/mysite-prod/venv/lib64/python3.6/site-packages/django/core/handlers/wsgi.py",
>>  line 133, in __call__[Sat Apr 18 16:11:30.684903 2020] [wsgi:error] [pid 
>> 4154] [remote 100.19.146.139:54397] response = 
>> self.get_response(request)[Sat Apr 18 16:11:30.684925 2020] [wsgi:error] 
>> [pid 4154] [remote 100.19.146.139:54397]   File 
>> "/var/django/sites/mysite-prod/venv/lib64/python3.6/site-packages/django/core/handlers/base.py",
>>  line 76, in get_response[Sat Apr 18 16:11:30.684933 2020] [wsgi:error] [pid 
>> 4154] [remote 100.19.146.139:54397] 
>> response._resource_closers.append(request.close)[Sat Apr 18 16:11:30.684964 
>> 2020] [wsgi:error] [pid 4154] [remote 100.19.146.139:54397] AttributeError: 
>> 'HttpResponse' object has no attribute '_resource_closers'
>>
>>
>> I've rolled back to a previous version that works, running Django 2.2; 
>> the rest of the stack is the same. This one has me puzzled, as using the 
>> same deployed code with the same venv that Apache is configured to use 
>> works fine under runserver, but errors with mod_wsgi. I've tried 
>> stopping and starting Apache, running the publish process again for a fresh 
>> venv and code base, and even rebooting the server. The same error 
>> occurs, but only under Apache / mod_wsgi.
>>
>>
>> Any ideas? I'm puzzled!
>>
>> -- 
>> 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/0381e998-321e-489f-abe1-853b6997930f%40googlegroups.com
>>  
>> 
>> .
>>
>
> Tim,
>
> Shot in the dark:  Did you add any middleware by chance?
>
> -Jorge
>

-- 
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/f80c3888-eaac-48da-adaf-1862e1d4be5f%40googlegroups.com.


Re: Django Pagination

2020-05-30 Thread maninder singh Kumar
Views.py looks fine !

regards
willy


On Sat, May 30, 2020 at 7:22 PM Akshat Zala  wrote:

> Hello,
>
> I am finding it difficult to paginate through all the posts
>
> My views.py :
>
> @login_required
> def home_view(request):
> """Display all the post of friends and own posts on the dashboard"""
> posts = Post.objects.all().order_by('-date_posted')
> media: MEDIA_URL
> # 'post':Post.objects.filter(Q(author=request.user) |
> Q(author__from_user=request.user) |
> Q(author__to_user=request.user)).order_by('-date_posted'),
> paginator = Paginator(posts, 2)
> page_number = request.GET.get('page')
> page_obj = paginator.get_page(page_number)
> return render(request, 'post/home.html',{'page_obj': page_obj})
>
>
> and in template post/home.html:
>
> {% if is_paginated %}
> {% if page_obj.has_previous %}
> First
> arrow_left
> 
> {% endif %}
> {% for num in page_obj.paginator.page_range %}
> {% if page_obj.number == num %}
> {{ num }}
> {% elif num > page_obj.number|add:'-4' and num < page_obj.number|add:'4'
> %}
> {{ num }}
> {% endif %}
> {% endfor %}
> {% if page_obj.has_next %}
> arrow_right
> Last
> {% endif %}
>
>
> Thanks
>
> Akshat Zala
>
> --
> 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/87c3f0db-3088-448c-b3c7-14450e8c2f5d%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/CABOHK3QumzEA417%3DMV3dTwRszxmULfHp9y-tADSD56N_sTNQ5g%40mail.gmail.com.


Re: Parallel or split payment options using paypal

2020-05-30 Thread John McClain
Due to Covid am not getting any response from PayPal. I have sent many
messages

On Fri 29 May 2020 at 13:46, Akshat Zala  wrote:

> Hi John
>
> I agree with Kasper.
>
> Regards,
>
> Akshat
>
> On Thursday, 28 May 2020 01:31:03 UTC+5:30, Kasper Laudrup wrote:
>>
>> Hi John,
>>
>> On 27/05/2020 19.06, John McClain wrote:
>> > Hello All,
>> >
>> > Can anyone provide a method to split payments via paypal. I basically
>> > want to earn a commission on the sale and pass the balance to the
>> seller
>> > through my marketplace.
>> >
>>
>> Maybe this would be a better place to ask:
>>
>> https://www.paypal.com/us/smarthelp/home
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
> --
> 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/c3b6f605-5a23-4e6a-96ae-02d5a67971cb%40googlegroups.com
> 
> .
>
-- 
John McClain

Cell: 085-1977-823
Skype: jmcclain0129
Email: jmcclain0...@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/CAN-hv_rbOOZTPRCkLvKBjEypY4BdTBacvremA8sATdZNAp6C9w%40mail.gmail.com.


Re: Django json parser

2020-05-30 Thread HJ
you have to do a Queryset 
 inside your 
view function , something like :

@login_required
def Home(request):
 return render(request,'home.html',{})

@login_required
def JsonFunction(request):
 dataset = YourModel.objects.all() 
 data = list(dataset)
 return JsonResponse(data, safe=False)

that's only an example you need to set what you want to show 

Le samedi 30 mai 2020 14:12:07 UTC+1, bharat pamnani a écrit :
>
> I am a beginner in django and i need to build an app which enter some user 
> data and their activity period by creating model i can do that to store in 
> sql database.
> The problem is i need to display that data in json format any help will be 
> really 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/bce2ba78-b1a0-4ae6-8cd0-11290c7fadd7%40googlegroups.com.


Re: Django Pagination

2020-05-30 Thread Akshat Zala



On Saturday, 30 May 2020 19:20:47 UTC+5:30, Akshat Zala wrote:
>
> Hello,
>
> I am finding it difficult to paginate through all the posts
>
> My views.py :
>
> @login_required
> def home_view(request):
> """Display all the post of friends and own posts on the dashboard"""
> posts = Post.objects.all().order_by('-date_posted')
> media: MEDIA_URL
> # 'post':Post.objects.filter(Q(author=request.user) | 
> Q(author__from_user=request.user) | 
> Q(author__to_user=request.user)).order_by('-date_posted'),
> paginator = Paginator(posts, 2) 
> page_number = request.GET.get('page')
> page_obj = paginator.get_page(page_number)
> return render(request, 'post/home.html',{'page_obj': page_obj})
>
>
> and in template post/home.html:
>
> {% if is_paginated %}
> {% if page_obj.has_previous %}
> First
> arrow_left
> 
> {% endif %}
> {% for num in page_obj.paginator.page_range %}
> {% if page_obj.number == num %}
> {{ num }}
> {% elif num > page_obj.number|add:'-4' and num < page_obj.number|add:'4' 
> %}
> {{ num }}
> {% endif %}
> {% endfor %}
> {% if page_obj.has_next %}
> arrow_right
> Last
> {% endif %}
> {% endif %}
>
> Thanks
>
> Akshat Zala
>
>

-- 
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/97ffaebc-500d-4ae7-a483-bf3f785dee28%40googlegroups.com.


Django Pagination

2020-05-30 Thread Akshat Zala
Hello,

I am finding it difficult to paginate through all the posts

My views.py :

@login_required
def home_view(request):
"""Display all the post of friends and own posts on the dashboard"""
posts = Post.objects.all().order_by('-date_posted')
media: MEDIA_URL
# 'post':Post.objects.filter(Q(author=request.user) | 
Q(author__from_user=request.user) | 
Q(author__to_user=request.user)).order_by('-date_posted'),
paginator = Paginator(posts, 2) 
page_number = request.GET.get('page')
page_obj = paginator.get_page(page_number)
return render(request, 'post/home.html',{'page_obj': page_obj})


and in template post/home.html:

{% if is_paginated %}
{% if page_obj.has_previous %}
First
arrow_left
{% endif %}
{% for num in page_obj.paginator.page_range %}
{% if page_obj.number == num %}
{{ num }}
{% elif num > page_obj.number|add:'-4' and num < page_obj.number|add:'4' %}
{{ num }}
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
arrow_right
Last
{% endif %}


Thanks

Akshat Zala

-- 
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/87c3f0db-3088-448c-b3c7-14450e8c2f5d%40googlegroups.com.


Django json parser

2020-05-30 Thread bharat pamnani
I am a beginner in django and i need to build an app which enter some user 
data and their activity period by creating model i can do that to store in 
sql database.
The problem is i need to display that data in json format any help will be 
really 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/25a47281-771a-42b2-b24a-83480f8c949a%40googlegroups.com.


Good usage of native JSON functions and operators in ORM queries

2020-05-30 Thread Shaheed Haque
Hi,

I have a model MyModel which has a JSONField() called 'snapshot'. In Python
terms, each snapshot looks like this:

==
snapshot = {
'pay_definition' : {
'1234': {..., 'name': 'foo', ...},
'99': {..., 'name': 'bar', ...},
}
==

I'd like to find all unique values of 'name' in all instances of MyModel. I
have this working using native JSON functions like this:

   class PayDefs(Func):
function='to_jsonb'
template="%(function)s(row_to_json(jsonb_each((%(expressions)s
->'pay_definition')))->'value'->'name')"

   MyModel.objects.annotate(xxx=PayDefs(F('snapshot'))).order_by().distinct(
'xxx').values_list('xxx', flat=True)

My question is if this the best way to solve this problem? The way my
current logic works, reading from insider out is, I think:

   1. Pass in the 'snapshot'.
   2. Since 'snapshot' is a JSON field, "->'pay_definition'" traverses this
   key.
   3. To skip the unknown numeric keys, "jsonb_each()" turns each key,
   value pair into an inner row like ['1234', {...}].
   4. To get to the value column of the inner row "row_to_json()->'value'".
   5. To get the name field's value "->'name'".
   6. A final call to "to_jsonb" in the PayDefs class.

For example, since all I care about is the string value of 'name', is there
a way to get rid of the PayDefs class, and its invocation of to_jsonb?
Likewise, is there a better way to do the inner parts? To provide context
on what "better" might be:

   - Snapshot JSONs might easily be 20MB in size.
   - Each 'pay_definition' is probablyonly about 1kB in size, and there
   might be 50 of them in a snapshot.
   - There might be 1000 MyModel instances in a given query.
   - I'm using PostgreSQL 12

so my concern is not have the database server or Django perform extraneous
work converting between strings and JSON for example.

Thanks, Shaheed

-- 
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/CAHAc2jc24H-CKWH-3x2cEkRKMGnAz8s_HZt8%3Dd5LUrqKb%3D0r4A%40mail.gmail.com.


Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-30 Thread Iain Stewart
Hi Matt,

I followed Nomeh's advice (the last email response to my question) which
was to do this within the Pycharm console

delete the migrations again, then run this to reset the tracking:

so:

... py manage.py migrate --fake [app_Name] zero

then:
... py makemigrations [app_Name]
... py migrate [app_Name]

That worked for me.

Hope this helps!

Iain

On Sat, 30 May 2020 at 00:16, Matt D  wrote:

> Hello Iain,
>>
>  I am also working on Mosh's python tutorial and I'm having the same
> problems that you expressed in this chat. Did you delete the migrations
> through pycharm or through your computer to make it work?
> 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/5cf0bf92-5773-43a3-a273-4ccfdb61734c%40googlegroups.com
> 
> .
>


-- 
Iain Stewart
2b Priestfield Road
EDINBURGH EH16 5HH SCOTLAND
iain.a.stew...@gmail.com

telephone: 0044 131 662 9123
mobile: 0044 7728 752824

-- 
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/CAAAU1KRgLG0ejUyE4P3CXg88ZWmCSRO%3DcD5aBbbKa%2BqbjqtjGA%40mail.gmail.com.