Re: Django saleor postgresql hstore issue

2019-04-10 Thread Asif Saif Uddin
Fixed using this 
https://stackoverflow.com/questions/10757431/postgres-upgrade-a-user-to-be-a-superuser

On Thursday, April 11, 2019 at 10:05:58 AM UTC+6, Asif Saif Uddin wrote:
>
> facing this error even after creating hstore extension from pg shell and 
> generated empty migrations for hstore:
>
>  line 89, in __exit__
> raise dj_exc_value.with_traceback(traceback) from exc_value
>   File 
> "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 
> 84, in _execute
> return self.cursor.execute(sql, params)
> django.db.utils.ProgrammingError: permission denied to create extension 
> "hstore"
> HINT:  Must be superuser to create this extension.
>
>
> the initial empty migration was modified to the following and regenerated. 
> face error while migrating. created admin super user too. but still not 
> working
>
> # Generated by Django 2.2 on 2019-04-11 03:42
>
> from django.db import migrations
>
> from django.contrib.postgres.operations import HStoreExtension
>
>
> class Migration(migrations.Migration):
> dependencies = [
> ]
>
> operations = [
> HStoreExtension(),
> ]
>
>  db settings; saleor and postgres both user permission granted to saleor 
> db from pg shell.
> DATABASES = {
> 'default': dj_database_url.config(
> default='postgres://saleor:saleor@localhost:5432/saleor',
> conn_max_age=600)}
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ee3ee0b7-0e4d-492a-97ff-66cab875ff2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django + PostgreSQL Installation (pipenv install psycopg2)

2019-04-10 Thread Danny Blaker
https://github.com/psycopg/psycopg2/issues/699

Try updating pip too :)

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d5dc9dad-b20e-4e8e-961b-5e1447d5c84e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django + PostgreSQL Installation (pipenv install psycopg2)

2019-04-10 Thread Danny Blaker
https://www.google.com/url?sa=t=web=j=https://stackoverflow.com/questions/11618898/pg-config-executable-not-found=2ahUKEwitxePlncfhAhVDwIsBHeQbBTEQjjgwAHoECAkQAg=AOvVaw1ujp9GSEZRKKrkOSHWdMiD

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/170737dc-0cbf-4f5c-80e9-aa2c062e216c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django saleor postgresql hstore issue

2019-04-10 Thread Asif Saif Uddin
facing this error even after creating hstore extension from pg shell and 
generated empty migrations for hstore:

 line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
  File 
"/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 
84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: permission denied to create extension 
"hstore"
HINT:  Must be superuser to create this extension.


the initial empty migration was modified to the following and regenerated. 
face error while migrating. created admin super user too. but still not 
working

# Generated by Django 2.2 on 2019-04-11 03:42

from django.db import migrations

from django.contrib.postgres.operations import HStoreExtension


class Migration(migrations.Migration):
dependencies = [
]

operations = [
HStoreExtension(),
]

 db settings; saleor and postgres both user permission granted to saleor db 
from pg shell.
DATABASES = {
'default': dj_database_url.config(
default='postgres://saleor:saleor@localhost:5432/saleor',
conn_max_age=600)}

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/22b3432d-6757-420a-b829-eababac9768d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SSL Certification, an issue with Django Python Daphne Server, Certbot, and Let's Encrypt

2019-04-10 Thread Manas Nikam
Theres an auto renewal command in certbot already. Check it out

On Thu, Apr 11, 2019, 8:22 AM Desmond  wrote:

> Hello All,
>
> This is the first time I've ever posted in the group so forgive me if this
> question is too broad for Django. If so, if you could please direct me to
> another user group, I would be delighted.
>
> I've been working on a project that was previously set up by an old
> contractor. They set up a web server using Daphne on AWS Lightsail running
> on Ubuntu 16.04 (xenial). For SSL certification, they used Let's Encrypt
> and Certbot. I've been wanting to set up auto-renewal for the SSL
> certification but have been running into many road blocks in the meantime.
> The contractor's instructions on renewing the server is as follows:
>
> cd /home/ubuntu
> sudo certbot --authenticator standalone --installer nginx -d example.com 
> --pre-hook "service nginx stop" --post-hook "service nginx start"
> cd /home/server
> sudo cp /etc/letsencrypt/live/example.com/cert.pem .
> sudo cp /etc/letsencrypt/live/example.com/chain.pem .
> sudo cp /etc/letsencrypt/live/example.com/fullchain.pem .
> sudo cp /etc/letsencrypt/live/example.com/privkey.pem .
>
>
> Initially, I thought that I would just make a cron job of this and call it
> a day but when I test it, I get no results. What puzzles me is that he uses
> nginx as an installer which should be used if the previous contractor
> wanted to set up a nginx server. Can anyone help me understand the logic
> here and to then set up auto-renewal?
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cd54d0db-9a53-4f5f-b994-f1021b5dfdc2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF%2BYYc4KQb-52CX39Y7hJMSXKdxfDwkQr6ySzv_NFVzzxu9HHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


SSL Certification, an issue with Django Python Daphne Server, Certbot, and Let's Encrypt

2019-04-10 Thread Desmond
Hello All,

This is the first time I've ever posted in the group so forgive me if this 
question is too broad for Django. If so, if you could please direct me to 
another user group, I would be delighted.

I've been working on a project that was previously set up by an old 
contractor. They set up a web server using Daphne on AWS Lightsail running 
on Ubuntu 16.04 (xenial). For SSL certification, they used Let's Encrypt 
and Certbot. I've been wanting to set up auto-renewal for the SSL 
certification but have been running into many road blocks in the meantime. 
The contractor's instructions on renewing the server is as follows:

cd /home/ubuntu
sudo certbot --authenticator standalone --installer nginx -d example.com 
--pre-hook "service nginx stop" --post-hook "service nginx start"
cd /home/server
sudo cp /etc/letsencrypt/live/example.com/cert.pem .
sudo cp /etc/letsencrypt/live/example.com/chain.pem .
sudo cp /etc/letsencrypt/live/example.com/fullchain.pem .
sudo cp /etc/letsencrypt/live/example.com/privkey.pem .


Initially, I thought that I would just make a cron job of this and call it 
a day but when I test it, I get no results. What puzzles me is that he uses 
nginx as an installer which should be used if the previous contractor 
wanted to set up a nginx server. Can anyone help me understand the logic 
here and to then set up auto-renewal?


-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cd54d0db-9a53-4f5f-b994-f1021b5dfdc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help on adding a search button to an input field

2019-04-10 Thread Nanjuki Saidat
hello@joel, how do i use it as in what to import and so on do you have some
link or example and show me coz i tried inserting some inputs but when i
tried to build the docker didnt meaning i was missing some bootstrap
packages to import. can you please tell me how to do it.Thanks

On Wed, 10 Apr 2019 at 20:58, Joel Mathew  wrote:

> Use bootstrap's input-group-append
> Sincerely yours,
>
>  Joel G Mathew
>
>
>
> On Wed, 10 Apr 2019 at 23:14, Nanjuki Saidat 
> wrote:
>
>> Please any one to help me out.thanks
>>
>> On Wed, 10 Apr 2019 at 20:40, Nanjuki Saidat 
>> wrote:
>>
>>> this one still did the same thing which i didnt mean me i meant an
>>> search button in an input field
>>>
>>> On Wed, 3 Apr 2019 at 22:04, Anirudh Jain 
>>> wrote:
>>>
 You can include the following code in the end

 ButtonHolder(
 Submit('submit', 'Update', css_class='btn btn-theme small')
 )

 Take care of proper indentation.

 On Wed, 3 Apr 2019, 23:48 Nanjuki Saidat, 
 wrote:

> Hi everyone,
> I want to add a search button to an input search field , if there is
> anyone who knows
> how to add a button to the field in crispy form's input field. Please
> help me out
>
>
> https://pagure.io/fedora-commops/fedora-happiness-packets/issue/raw/files/a8846b7d72aced5bdc0a2470dc97a495fb7558d6a0908a04b369260e862d-Screenshot_2019-03-20_Open-source_Happiness_Packets.png
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHrBrjDW%2Bn-oHwdiYRpw%3DdS8HA%2BAH%2Bne3_kjmxz-UHYqPhX9ow%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
 --
 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 post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAC3mK7fBWiFTXEqeDHPfiExZ39DexHK90OBQ6mmsrSpfD2CCVA%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHrBrjAhx4wY-eouLXr3LWYR9hsD_18bULS-p_6qku1cfDPKHA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA%3Diw_-x-jotqifY8DdpA-xHxF9XFMCcbACVOhkEJDd_fmgRzg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 

Re: Update many to many django

2019-04-10 Thread Luis Zárate
Creo que zip está explicado acá


https://www.programiz.com/python-programming/methods/built-in/zip



El miércoles, 10 de abril de 2019, Karen Tatiana Mesa Lopez
 escribió:
> Hola Luis, tengo la ultima pregunta, te agradezco mucho tu ayuda
> voy a realizar un for doble, mi pregunta puntual seria,
> los arreglos del for doble tienen que llevar la misma cantidad de datos
ejemplo
> tema = ['1','2']
> otro  = ['1','2']
> for t ,o  in zip(tema,otro):
> print(t,o)
> ¿o pueden llevar diferentes longitudes?
> De que manera puedo recorrer dos Array al mismo tiempo, con diferentes
longitudes, para guardarlo en un solo save de Django.
> tema = ['1','2']
> otro  = ['1','2','3','4']
> for t ,o  in zip(tema,otro):
> print(t,o)
>
>
> Quedo muy agradecida por dedicar un poco de tu tiempo a mis preguntas.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAFC_1o5RgYd7s-JPYgt1O41t6tugnuY6C795skQKGb3pp%2BE2-Q%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyOT0zLhB0eZCEjhTu-4FzYqi2V_Kr0NXukkksNGyR8t2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Update many to many django

2019-04-10 Thread Karen Tatiana Mesa Lopez
Hola Luis, tengo la ultima pregunta, te agradezco mucho tu ayuda

voy a realizar un for doble, mi pregunta puntual seria,
los arreglos del for doble tienen que llevar la misma cantidad de datos
ejemplo

tema = ['1','2']
otro  = ['1','2']

for t ,o  in zip(tema,otro):
print(t,o)

¿o pueden llevar diferentes longitudes?

De que manera puedo recorrer dos Array al mismo tiempo, con diferentes
longitudes, para guardarlo en un solo save de Django.

tema = ['1','2']
otro  = ['1','2','3','4']

for t ,o  in zip(tema,otro):
print(t,o)



Quedo muy agradecida por dedicar un poco de tu tiempo a mis preguntas.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFC_1o5RgYd7s-JPYgt1O41t6tugnuY6C795skQKGb3pp%2BE2-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help on adding a search button to an input field

2019-04-10 Thread Joel Mathew
Use bootstrap's input-group-append
Sincerely yours,

 Joel G Mathew



On Wed, 10 Apr 2019 at 23:14, Nanjuki Saidat 
wrote:

> Please any one to help me out.thanks
>
> On Wed, 10 Apr 2019 at 20:40, Nanjuki Saidat 
> wrote:
>
>> this one still did the same thing which i didnt mean me i meant an search
>> button in an input field
>>
>> On Wed, 3 Apr 2019 at 22:04, Anirudh Jain 
>> wrote:
>>
>>> You can include the following code in the end
>>>
>>> ButtonHolder(
>>> Submit('submit', 'Update', css_class='btn btn-theme small')
>>> )
>>>
>>> Take care of proper indentation.
>>>
>>> On Wed, 3 Apr 2019, 23:48 Nanjuki Saidat, 
>>> wrote:
>>>
 Hi everyone,
 I want to add a search button to an input search field , if there is
 anyone who knows
 how to add a button to the field in crispy form's input field. Please
 help me out


 https://pagure.io/fedora-commops/fedora-happiness-packets/issue/raw/files/a8846b7d72aced5bdc0a2470dc97a495fb7558d6a0908a04b369260e862d-Screenshot_2019-03-20_Open-source_Happiness_Packets.png

 --
 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 post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAHrBrjDW%2Bn-oHwdiYRpw%3DdS8HA%2BAH%2Bne3_kjmxz-UHYqPhX9ow%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAC3mK7fBWiFTXEqeDHPfiExZ39DexHK90OBQ6mmsrSpfD2CCVA%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHrBrjAhx4wY-eouLXr3LWYR9hsD_18bULS-p_6qku1cfDPKHA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-x-jotqifY8DdpA-xHxF9XFMCcbACVOhkEJDd_fmgRzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help on adding a search button to an input field

2019-04-10 Thread Nanjuki Saidat
Please any one to help me out.thanks

On Wed, 10 Apr 2019 at 20:40, Nanjuki Saidat 
wrote:

> this one still did the same thing which i didnt mean me i meant an search
> button in an input field
>
> On Wed, 3 Apr 2019 at 22:04, Anirudh Jain 
> wrote:
>
>> You can include the following code in the end
>>
>> ButtonHolder(
>> Submit('submit', 'Update', css_class='btn btn-theme small')
>> )
>>
>> Take care of proper indentation.
>>
>> On Wed, 3 Apr 2019, 23:48 Nanjuki Saidat, 
>> wrote:
>>
>>> Hi everyone,
>>> I want to add a search button to an input search field , if there is
>>> anyone who knows
>>> how to add a button to the field in crispy form's input field. Please
>>> help me out
>>>
>>>
>>> https://pagure.io/fedora-commops/fedora-happiness-packets/issue/raw/files/a8846b7d72aced5bdc0a2470dc97a495fb7558d6a0908a04b369260e862d-Screenshot_2019-03-20_Open-source_Happiness_Packets.png
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAHrBrjDW%2Bn-oHwdiYRpw%3DdS8HA%2BAH%2Bne3_kjmxz-UHYqPhX9ow%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAC3mK7fBWiFTXEqeDHPfiExZ39DexHK90OBQ6mmsrSpfD2CCVA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHrBrjAhx4wY-eouLXr3LWYR9hsD_18bULS-p_6qku1cfDPKHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help on adding a search button to an input field

2019-04-10 Thread Nanjuki Saidat
this one still did the same thing which i didnt mean me i meant an search
button in an input field

On Wed, 3 Apr 2019 at 22:04, Anirudh Jain 
wrote:

> You can include the following code in the end
>
> ButtonHolder(
> Submit('submit', 'Update', css_class='btn btn-theme small')
> )
>
> Take care of proper indentation.
>
> On Wed, 3 Apr 2019, 23:48 Nanjuki Saidat,  wrote:
>
>> Hi everyone,
>> I want to add a search button to an input search field , if there is
>> anyone who knows
>> how to add a button to the field in crispy form's input field. Please
>> help me out
>>
>>
>> https://pagure.io/fedora-commops/fedora-happiness-packets/issue/raw/files/a8846b7d72aced5bdc0a2470dc97a495fb7558d6a0908a04b369260e862d-Screenshot_2019-03-20_Open-source_Happiness_Packets.png
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHrBrjDW%2Bn-oHwdiYRpw%3DdS8HA%2BAH%2Bne3_kjmxz-UHYqPhX9ow%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAC3mK7fBWiFTXEqeDHPfiExZ39DexHK90OBQ6mmsrSpfD2CCVA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHrBrjC6N3v3fxFsNoMwJ1E9L5wSRak36g6x7mg7RSc_8jHXRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: error 403 on admin login

2019-04-10 Thread Suresh Kannan
Hi,

These links may help you

https://stackoverflow.com/a/14121175/4037275
https://stackoverflow.com/a/12712507/4037275
https://stackoverflow.com/a/36292539/4037275

On Wed, Apr 10, 2019 at 7:11 AM Akash Kumar  wrote:

> I was following the official polls app tutorial on Django on v2.2.
> i have created the superuser of the first time but whenever I log in it
> shows error 403 forbidden (csrf token missing or incorrect)
> can anyone plz help me.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/012ee0bb-9fe8-4e0c-ab61-da55e79c3152%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANfVfcDEgkx07QqyYWpr08g6xtwMSO1fwJPaHeEynwKX_mEjug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the proper workflow before first migration?

2019-04-10 Thread 'dtdave' via Django users

To me the way I build my models is so that if anyone looked at the code 
they would see exactly what the model represented. I had a great mentor in 
Daniel Greenfield of Two Scoops Fame.
So my models would be users and then a separate model for public posts.
The you have the following in your settings 
AUTH_USER_MODEL = 'users.CustomUser'
and everything would br fine.
You could then use this users modle elsewhere.
Also I have never seen the templates done your way. You can just have a 
single:
'DIRS': [os.path.join(BASE_DIR, 'templates')],
Then you can either have your templates in under the relevant app name e.g
public_posts/templates/public_posts
or in one template folder split into the apps. Different people have there 
own ideal method so it is really up tp you.
Hope this helps

On Wednesday, 10 April 2019 13:45:27 UTC+1, Flip Matter wrote:
>
> Thank you very much for the resources! However it is installed in my 
> settings.py the exact line is...  AUTH_USER_MODEL = 
> 'public_posts.CustomUser' 
> Is there a different way to do it? This is the only way I have seen to set 
> your AUTH_USER_MODEL, or does my custom user model have to be in a 'users' 
> app?
>
>
> On Sat, Apr 6, 2019 at 10:26 AM 'dtdave' via Django users <
> django...@googlegroups.com > wrote:
>
>> The error you are getting  is because the CustomUser is not included in 
>> your settings.py
>> Because I use a separte user model my settings.py has this line in it:
>> AUTH_USER_MODEL = 'users.CustomUser'
>> I would recommend that you have your Custom User as a separate user model.
>> For  good tutorials on user models have a look at these links:
>> https://wsvincent.com/django-tips-custom-user-model/
>> https://wsvincent.com/django-login-with-email-not-username/
>> https://wsvincent.com/django-custom-user-model-tutorial/
>>
>> Django All-Auth is a good app for customising your user models:
>> https://www.intenct.nl/projects/django-allauth/
>> Hope this helps!
>>
>>
>> On Friday, 5 April 2019 15:58:19 UTC+1, silverst...@gmail.com wrote:
>>>
>>> Hello, I've been trying to make a social media site and know nothing 
>>> about django (i've been teaching myself using the documentation and 
>>> tutorials) I've had to redo the site three times and now have to do a 
>>> fourth because (even though I got AUTH_USER_MODEL in, all the forms ect. 
>>> ect. before first migration) for some reason it is saying that "Manager is 
>>> unavailable; auth.User has been swapped for public_posts.CustomUser". I 
>>> have not been able to find a decent description on exactly how work flow 
>>> NEEDS to be done. Obviously create user models and set AUTH_USER_MODEL 
>>> before first migration but what about the Manager? I made my 
>>> CustomUserManager at the same time as everything else.
>>>
>>> I tried to use django-registration, then found out they upgraded to 
>>> django_registration, couldn't find ANY documentation on it until almost a 
>>> week afterwards. So now my code is partially a bunch of tutorials and 
>>> partially old (possibly deprecated) code, is there somewhere that all of 
>>> the new stuff and how to transfer to the new stuff posted? This seems to be 
>>> the hardest part about Django, for me anyway. I've tried get_user_model 
>>> where user comes up to no avail.  I have three apps, admin_posts, 
>>> public_posts and accounts (get ready to smirk cuz this was stupid of me) I 
>>> have all my CustomUser stuff in public_posts and have everything required 
>>> by django_registration in accounts. I'm positive that was a huge fail on my 
>>> part but Where SHOULD all of the user stuff go?? I have no been able to 
>>> find anything about that anywhere everything only says ' 
>>> appname.CustomUser' (example) leading me to believe that it doesn't matter 
>>> where you put them. but since django_registration has its own requirements 
>>> and user dealings, will using django_registration and CustomUsers cancel 
>>> each other out/mess up each others managers?
>>>
>>> Everything I have done has only been in my project(s) and not in the 
>>> root dir. Also, if anyo contributors to django read this, thank you for 
>>> making such a freaking amazing framework, I mean this thing is just a pure 
>>> beauty so thank you!!! Y'all be some geniuses! I hope to be good enough to 
>>> contribute.
>>>
>>> Thank you for making it to the end and thank you for any responses.
>>> P.S I only post as a last resort, I've spent HOURS researching this to 
>>> no avail, not even a tease of an answer...I'm only saying this so you know 
>>> I do indeed do the research required and don't want others to do  my work 
>>> for me but MAN I cannot find anything. Also, if any Django contributors 
>>> read this, Thank you for making such an amazing framework!!
>>>
>> -- 
>> 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 

Re: Set user permission via python

2019-04-10 Thread Matt Collins
I've solved this. First of all, the codename for the permission should be 
called as a codename and second, I had to remove the app name 
(display_data) like this:

permission = Permission.objects.get(codename='settings')


On Tuesday, April 9, 2019 at 9:25:09 PM UTC-6, Matt Collins wrote:
>
> Hi,
>
> I'm trying to set a permission for a user that I'm creating with a python 
> script. I've tested and found that the codename for the permission is 
> "display_data.settings" using the following:
>
> python manage.py shell
> from django.contrib.auth.models import User
> user_name = User.objects.get(username="user_name")
> user_name.get_all_permissions()
> set([u'display_data.settings']) 
>
>
> I'm trying to set this permission for the user with the following:
>
> from django.contrib.auth import get_user_model
> from django.contrib.auth.models import User, Permission
>
> User = get_user_model()
>
> #check to see if user exists, create it if it doesn't
> User.objects.filter(username="user_name").exists() or\
> User.objects.create_user(username='user_name', email='
> usern...@example.com', password='blah')
>  
>
> #add permissions to user
> u = User.objects.get(username="user_name")
> permission = Permission.objects.get(name='display_data.settings')
> u.user_permissions.add(permission)
>
>  
> When I run this, I get the following error:
>
>
> django.contrib.auth.models.DoesNotExist: Permission matching query does 
> not exist.
>
>
> Can anybody tell me what I'm missing? 
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e092d493-6dc5-4374-ad9e-e664e6b9d0b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: upgrading the pip version in dockerized django container

2019-04-10 Thread nm

Try `exec` instead of `run`. `run` runs the command in a new container, so 
each time you perform `docker-compose run web `, a new copy of the 
container is created. See the documentation: 
https://docs.docker.com/compose/reference/run/

On Wednesday, 10 April 2019 11:56:53 UTC+2, Shubham Joshi wrote:
>
> I am trying to upgrade pip version in docker
>
>
> snj@snj-ThinkPad-T440p:~/school$ sudo docker-compose run web pip install 
> --upgrade pip
> Starting school_db_1 ... done
> Collecting pip
>   Downloading 
> https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl
>  
> (1.4MB)
> 100% || 1.4MB 62kB/s
> Installing collected packages: pip
>   Found existing installation: pip 9.0.1
> Uninstalling pip-9.0.1:
>   Successfully uninstalled pip-9.0.1
> Successfully installed pip-19.0.3
> snj@snj-ThinkPad-T440p:~/school$ sudo docker-compose run web pip --version
> Starting school_db_1 ... done
> pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
> snj@snj-ThinkPad-T440p:~/school$
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ba933ef5-7178-4b54-925f-0ee42ad456c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the proper workflow before first migration?

2019-04-10 Thread Flip Matter
Thank you very much for the resources! However it is installed in my
settings.py the exact line is...  AUTH_USER_MODEL =
'public_posts.CustomUser'
Is there a different way to do it? This is the only way I have seen to set
your AUTH_USER_MODEL, or does my custom user model have to be in a 'users'
app?


On Sat, Apr 6, 2019 at 10:26 AM 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> The error you are getting  is because the CustomUser is not included in
> your settings.py
> Because I use a separte user model my settings.py has this line in it:
> AUTH_USER_MODEL = 'users.CustomUser'
> I would recommend that you have your Custom User as a separate user model.
> For  good tutorials on user models have a look at these links:
> https://wsvincent.com/django-tips-custom-user-model/
> https://wsvincent.com/django-login-with-email-not-username/
> https://wsvincent.com/django-custom-user-model-tutorial/
>
> Django All-Auth is a good app for customising your user models:
> https://www.intenct.nl/projects/django-allauth/
> Hope this helps!
>
>
> On Friday, 5 April 2019 15:58:19 UTC+1, silverst...@gmail.com wrote:
>>
>> Hello, I've been trying to make a social media site and know nothing
>> about django (i've been teaching myself using the documentation and
>> tutorials) I've had to redo the site three times and now have to do a
>> fourth because (even though I got AUTH_USER_MODEL in, all the forms ect.
>> ect. before first migration) for some reason it is saying that "Manager is
>> unavailable; auth.User has been swapped for public_posts.CustomUser". I
>> have not been able to find a decent description on exactly how work flow
>> NEEDS to be done. Obviously create user models and set AUTH_USER_MODEL
>> before first migration but what about the Manager? I made my
>> CustomUserManager at the same time as everything else.
>>
>> I tried to use django-registration, then found out they upgraded to
>> django_registration, couldn't find ANY documentation on it until almost a
>> week afterwards. So now my code is partially a bunch of tutorials and
>> partially old (possibly deprecated) code, is there somewhere that all of
>> the new stuff and how to transfer to the new stuff posted? This seems to be
>> the hardest part about Django, for me anyway. I've tried get_user_model
>> where user comes up to no avail.  I have three apps, admin_posts,
>> public_posts and accounts (get ready to smirk cuz this was stupid of me) I
>> have all my CustomUser stuff in public_posts and have everything required
>> by django_registration in accounts. I'm positive that was a huge fail on my
>> part but Where SHOULD all of the user stuff go?? I have no been able to
>> find anything about that anywhere everything only says '
>> appname.CustomUser' (example) leading me to believe that it doesn't matter
>> where you put them. but since django_registration has its own requirements
>> and user dealings, will using django_registration and CustomUsers cancel
>> each other out/mess up each others managers?
>>
>> Everything I have done has only been in my project(s) and not in the root
>> dir. Also, if anyo contributors to django read this, thank you for making
>> such a freaking amazing framework, I mean this thing is just a pure beauty
>> so thank you!!! Y'all be some geniuses! I hope to be good enough to
>> contribute.
>>
>> Thank you for making it to the end and thank you for any responses.
>> P.S I only post as a last resort, I've spent HOURS researching this to no
>> avail, not even a tease of an answer...I'm only saying this so you know I
>> do indeed do the research required and don't want others to do  my work for
>> me but MAN I cannot find anything. Also, if any Django contributors read
>> this, Thank you for making such an amazing framework!!
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5aedce0e-870b-48ea-89cb-98e7b022d66d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 

Django 2.2.0 StatReloader not responding to filechanges

2019-04-10 Thread info
Since the introduction to Watchman, with the failover to StatReloader, the 
file changes aren't picked up.

We're running our Django development environment in Docker/Docker-compose, 
and 2.1.7 everything is still fine. But updating to 2.2.0, the file changes 
aren't picked up (or rarely).

We have installed Watchman in our docker, but then there was a timeout.

Any suggestions on how to fix watchman or make StatReloader work as it was 
in Django 2.1.7?

Logs:

[10/Apr/2019 12:39:13] INFO [django.utils.autoreload:578] Watching for file 
changes with WatchmanReloader
Performing system checks...

System check identified no issues (0 silenced).
April 10, 2019 - 12:39:16
Django version 2.2, using settings 'project.settings'
Starting ASGI/Channels version 2.1.7 development server at http://0:8000/
Quit the server with CONTROL-C.
[10/Apr/2019 12:39:16] INFO [daphne.server:111] HTTP/2 support not enabled 
(install the http2 and tls Twisted extras)
[10/Apr/2019 12:39:16] INFO [daphne.server:119] Configuring endpoint 
tcp:port=8000:interface=0
[10/Apr/2019 12:39:16] INFO [daphne.server:153] Listening on TCP address 
0.0.0.0:8000
[10/Apr/2019 12:39:18] ERROR [django.utils.autoreload:569] Error connecting 
to Watchman: timed out waiting for response, while executing 
('watch-project', '/home/docker/project')
[10/Apr/2019 12:39:18] INFO [django.utils.autoreload:570] Watching for file 
changes with StatReloader


This is our docker file for our web docker:

FROM python:3.7
ENV PYTHONUNBUFFERED 1

RUN apt-get update -y
RUN apt-get install -y \
binutils \
libproj-dev \
gdal-bin \
apt-utils \
  gcc \
  gettext \
  sqlite3 \
  python3-dev \
  software-properties-common \
  sudo \
   --no-install-recommends && rm -rf /var/lib/apt/lists/*

ENV HOME /home/docker
RUN mkdir -p /home/docker/

WORKDIR $HOME
RUN git clone https://github.com/facebook/watchman.git
WORKDIR $HOME/watchman/
RUN git checkout v4.9.0
RUN ./autogen.sh
RUN ./configure
RUN make
RUN sudo make install

# USER docker
WORKDIR $HOME/project

RUN cd $HOME/project/

RUN sudo -H pip install -U pipenv==2018.10.9

COPY Pipfile $HOME/project/Pipfile
COPY Pipfile.lock $HOME/project/Pipfile.lock

RUN pipenv sync --dev



docker-compose.yml

version: '3.3'

services:
  web:
build: .
command: pipenv run python manage.py runserver 0:8000
volumes:
  - .:/home/docker/project
env_file:
  - ".env"
ports:
  - "8002:8000"
depends_on:
  - postgres-db
networks:
  - app-network

  postgres-db:
image: kartoza/postgis
ports:
  - "5433:5432"
env_file:
  - ".env"
healthcheck:
  test: ["CMD-SHELL", "pg_isready -U postgres"]
  interval: 10s
  timeout: 5s
  retries: 5
networks:
  - app-network

networks:
  app-network:
driver: bridge



Pipfile

[[source]]
url = "https://pypi.org/simple;
verify_ssl = true
name = "pypi"

[packages]
channels = "==2.1.7"
channels-redis = "==2.3.3"
daphne = "==2.2.5"
django = "==2.1.7"
django-redis = "==4.10.0"
gunicorn = "==19.9.0"
psycopg2-binary = "==2.8.1"

[requires]
python_version = "3.7"



-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c49ba8ae-9d16-4e00-b686-d9e95c15a126%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django REST in Docker

2019-04-10 Thread Shubham Joshi
Okay, thanks , I will do that

On Tue 9 Apr, 2019, 7:52 PM PASCUAL Eric,  wrote:

> It seems right.
>
> I suppose that requirements.txt contains the rest_framework package too.
>
> You can check the image content by executing the "pip freeze" command on
> it (docker run  pip freeze). This will tell you of all the
> packages you nee are there.
>
> Eric
>
> --
> *From:* django-users@googlegroups.com  on
> behalf of Shubham Joshi 
> *Sent:* Tuesday, April 9, 2019 10:54
> *To:* django-users@googlegroups.com
> *Subject:* Re: Django REST in Docker
>
>
> FROM python:3
> ENV PYTHONUNBUFFERED 1
> RUN mkdir /code
> WORKDIR /code
> COPY requirements.txt /code/
> RUN pip install -r requirements.txt
> COPY . /code/
>
>
> On Tue, Apr 9, 2019 at 1:30 PM PASCUAL Eric  wrote:
>
> Hi,
>
> Working in contenerized context does not change anything from other modes.
>
> You just need to include the appropriate pip install command in the
> Dockerfile, so that all the dependencies are installed in the image. They
> will then available to your app the same way they are on you dev machine.
>
> Could you show the content of your Dockerfile to check if there would not
> be some other problem ?
>
> Eric
>
> --
> *From:* django-users@googlegroups.com  on
> behalf of Shubham Joshi 
> *Sent:* Tuesday, April 9, 2019 07:30
> *To:* Django users
> *Subject:* Django REST in Docker
>
> I had set up django in Docker, now I am trying to install pip packages ,
> like rest_framework and added in installed apps too.
> but it throws ModuleNotFoundError: No module named 'rest_framework' ,
> whats the generic way of installing the pip packages in existing dockerized
> django project
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/656cff9e-50f9-4d5a-bafc-05eaa99778d7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/AM0P193MB030871AA27CDB1B3923B785E8C2D0%40AM0P193MB0308.EURP193.PROD.OUTLOOK.COM
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> *Shubham Joshi*
> Business Developer | Terse Software
> M: 8390246938
>
> E: shub...@tersesoft.com 
> www.tersesoft.com
> [image: linkedin]  [image:
> github] 
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGJdmX63xQ1kS1z_i5MhkXS0hKkno1_fGnfx5344ShpY-aZv3Q%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/AM0P193MB03086659923CA5B0A3C832A98C2D0%40AM0P193MB0308.EURP193.PROD.OUTLOOK.COM
> 
> .
> For more options, visit https://groups.google.com/d/optout.

error 403 on admin login

2019-04-10 Thread Akash Kumar
I was following the official polls app tutorial on Django on v2.2.
i have created the superuser of the first time but whenever I log in it 
shows error 403 forbidden (csrf token missing or incorrect)
can anyone plz help me.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/012ee0bb-9fe8-4e0c-ab61-da55e79c3152%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using exclude with annotated FilteredRelation doesn't work.

2019-04-10 Thread Lucas Miller
Hi, 

when I try to add an exclude filter to an annotated field with a 
FilteredRelation I get a FieldError on the annotated field. 

For exemple if I modify django 
test filtered_relation.tests.FilteredRelationTests.test_with_join from  

def test_with_join(self):
self.assertSequenceEqual(
Author.objects.annotate(
book_alice=FilteredRelation('book', condition=Q(book__title__iexact='poem 
by alice')),
).filter(book_alice__isnull=False),
[self.author1]
)

to 

def test_with_join_exclude(self):
self.assertSequenceEqual(
Author.objects.annotate(
book_alice=FilteredRelation('book', condition=Q(book__title__iexact='poem 
by alice')),
).exclude(book_alice__isnull=False),
[]
)

I get the following error : django.core.exceptions.FieldError: Cannot 
resolve keyword 'book_alice' into field. Choices are: book, content_object, 
content_type, content_type_id, favorite_books, id, name, object_id

I think the issue comme from the function split_exclude(self, filter_expr, 
can_reuse, names_with_path)  because it create a new Query without the 
_filtered_relations datas.

How can I manage to do 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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/68bec592-53b9-4ff3-ac37-6ca3be50b84c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I am having trouble finding any example of setting a task_id with my own task_id

2019-04-10 Thread inet . neeraj


def testview1(request):
for i in xrange(0,1000):
result = add.delay( i, 4,task_id = i)
print result.task_id
#i want to display here i value
return HttpResponse("Done") 

@task()def add(task_id, x, y):
print add.task_id
print str(x+y)
return x + y

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ce651f96-f440-4478-b961-480e4c0b9c9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is django can run in FIPS mode:

2019-04-10 Thread Gowtham Shanmugam
Hi All,
  I am using graphite-web-1.1.4-1 and python-django-1.11.15. I am facing 
some issue while trying to initialize graphite DB using python-Django. In 
FIPs mode I am getting the same issue which is mentioned in 
https://code.djangoproject.com/ticket/28401. This issue is present for a 
long time, is Django can run in FIPS mode, is that issue is solved? 
 
I am using the Django command: ``` django-admin migrate django-admin 
migrate django-admin migrate ```

Error:

   "ValueError: error:060800A3:digital envelope 
routines:EVP_DigestInit_ex:disabled for fips"

Thanks & Regards
Gowtham s

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c3921f92-90a3-4b3e-aaec-4dbddcc708d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


upgrading the pip version in dockerized django container

2019-04-10 Thread Shubham Joshi
I am trying to upgrade pip version in docker


snj@snj-ThinkPad-T440p:~/school$ sudo docker-compose run web pip install 
--upgrade pip
Starting school_db_1 ... done
Collecting pip
  Downloading 
https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl
 
(1.4MB)
100% || 1.4MB 62kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
  Successfully uninstalled pip-9.0.1
Successfully installed pip-19.0.3
snj@snj-ThinkPad-T440p:~/school$ sudo docker-compose run web pip --version
Starting school_db_1 ... done
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
snj@snj-ThinkPad-T440p:~/school$

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bebac4ba-3854-4ade-aa15-6a77817d02d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.2 and custom media in the admin

2019-04-10 Thread Thorsten Sanders

Hello,

thanks did overread that twice then, once when reading changes, once 
when trying to figure out if there was a change due not working.

Then i searched for it and came to:

https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#jquery

Maybe not bad idea to mention it there too.

Regards,
Thorsten

Am 09.04.19 um 23:14 schrieb Simon Charette:

Hello Thorsten, this is a change document in the 2.2 release notes[0].

There's even a resolution example for a django.jQuery dependency like 
you have


> For example, widgets depending on django.jQuery must specify
> js=['admin/js/jquery.init.js', ...] when declaring form media 
assets. [1]


Cheers,
Simon

[0] 
https://docs.djangoproject.com/en/2.2/releases/2.2/#merging-of-form-media-assets
[1] 
https://docs.djangoproject.com/en/2.2/topics/forms/media/#assets-as-a-static-definition


Le mardi 9 avril 2019 11:02:35 UTC-4, Thorsten Sanders a écrit :

Hello,

I insert a custom javascript inside the admin and do use the
"django.jquery" this worked fine until updating to Django 2.2.

With 2.2 the order in which the javascripts are loaded changed and
the jquery.init.js is now loaded after my custom javascript, is
that considered a bug or a change?

Regards,
Thorsten

--
You received this message because you are subscribed to a topic in the 
Google Groups "Django users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/django-users/scJvRttmQZY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
django-users+unsubscr...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/018ab123-2b22-4425-bb6d-efeb1c4f12cf%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c675404c-fff5-1d8c-8927-4fa3cc84df31%40softint.de.
For more options, visit https://groups.google.com/d/optout.


Re: Is there a way to extend Django Admin to normal user/staff? If so, how?

2019-04-10 Thread Derek
Django admin is perfectly usable by anyone that can be trained to 
understand it.

What is the issue you have?

On Tuesday, 9 April 2019 13:29:53 UTC+2, Chaitanya Vankadaru wrote:
>
> I am looking to extend Django Admin to normal user/staff? If so, how?
>
> Please reply with your ideas/solutions.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/07becd49-4246-4eae-ab82-c9c625cd5a3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Feedback regarding Django-Suit for Django Admin Panel Customization - Need to add New Menu for Report Generations

2019-04-10 Thread Derek
You'd need to create your own reporting app, with view and templates for 
creating your reports (plus an entry in urls.py of course)

The Django Suit menu could then be updated to link to your report index 
page:


# -*- coding: utf-8 -*-
"""
Django Suit Configuration Module
"""
from django.apps import AppConfig
from django import get_version
from suit.apps import DjangoSuitConfig
from suit.menu import ParentItem, ChildItem


class SuitConfig(DjangoSuitConfig):
layout = 'horizontal'  # or 'vertical'
name = 'suit'
django_version = get_version()

menu = (
ParentItem('Client', children=[
ChildItem(model='myapp.model1'),
ChildItem(model='myapp.model2),
], icon='fa fa-example-o'),

ParentItem('Reports', children=[
ChildItem(url='/reports/', label="Reports"),
], icon='fa fa-star'),
)


PS The license fee is only required if you are selling your software; not 
open source software available to the public.

On Tuesday, 9 April 2019 13:29:58 UTC+2, Balaji Shetty wrote:
>
> Dear Sir,
>
> I am developing one web based application Django. I could understand 
> Simple Web application as well as entire Django Admin Panel working upto 
> this time. 
>
> My requirement is 
> I want to add new menu in existing Admin Panel. I have been searching a 
> lot from many days but could not get any proper solution. I got some code 
> on github like Django-Admin-Plus and django-Admin-Menu but when i installed 
> on my machine, it could not execute and giving lots of error. Any link or 
> video is available for this.
>
> One solution may be view creation .
>
> One more solution is to purchase Django Suit in around 3 to 4K rupees. 
> Features of Django Suit is
> FEATURES
>
>
>- Modern and professional design
>- Improved list filters
>- Sorting for list and inlines
>- Menu configuration & search
>- Useful CSS/JS addons
>- Based on Twitter Bootstrap
>- Simple installation
>- No 3rd-party requirements
>- 3rd-party app support: django-cms, django-filer and others.
>
> Single 
> $45 
> Single commercial project
> Use Django Suit in one 
> commercial project
>
> So can anybody suggest me the BEST solution.
>
> -- 
> *Mr. Shetty Balaji S.*
>
> *balaji...@gmail.com *
> *9270696267*
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef720d3c-42db-4a76-94ec-ba3d08884290%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.