Re: No module named django.core.wsgi, Apache+ CentOS

2019-01-16 Thread ANi
Thank you and after facing so much mysterious(at least to me) errors,
I failed to install it through pip(I have no idea why)
so I tried to get it from compiling the source code, and it failed as well.
I started over and install python through the repository rather than source 
code,
and I compile the mod_wsgi myself using the python I've installed, get it 
done in a few minutes.lol
 
Now I am dealing with another mysterious problem. ˊ___>ˋ
seems endless...

ANi於 2019年1月16日星期三 UTC+8下午12時04分23秒寫道:
>
> Hey guys.
> I am trying to deploy my Django project on CentOS 7 with Apache.
> and I got an error of  *ImportError: No module named django.core.wsgi*
> I think it is because the Apache did not use the python version inside the 
> virtualenv
> However I dont know where the problem is.
>
> this is my httpd.conf 
> WSGIProcessGroup project
> WSGIDaemonProcess project python-path=/var/www/html/project:/var/www/html/
> inv/Lib/python3.7/site-packages
> WSGIPythonPath /var/www/html/project:/var/www/html/inv/Lib/python3.7/site-
> packages
>
> Alias /static "/var/www/html/project/static-files"
> 
> Require all granted
> 
>
>
> 
> 
> Require all granted
> 
>
> I install wsgi_mod by *yum install mod_wsgi*
> [mpm_prefork:notice] [pid 25884] AH00163: Apache/2.4.6 (CentOS) OpenSSL/
> 1.0.2k-fips mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.5 configured -- 
> resuming normal operations
>
>
>
> Thank you in advance.
>
>

-- 
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/879ce142-1dc5-4d81-ad64-286684280d49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installed Python 3.7; installed Django 2.1.5. Django folder open, now what?

2019-01-16 Thread Gilbeesh Kosma
You sure you are using python3.7 to run the django local server?. It will
be like "python3.7 manage.py runserver". If your system contains more than
one version of python ,then it is good to run server like this. Also make
confirm that django is installed for python3.7
On Jan 17, 2019 4:06 AM, "LinkSnakeGeralt"  wrote:

> Hi everyone
>
> First timer,
>
> Basically what the post says; I have installed it, tried running it
> through the Terminal of the MacBook Pro I have. But it did not recognise
> any module called Django.
>
> So I went online and did a bit of digging and realised I have the folder
> (as shown from screenshot attached) but not any clear instruction (for me
> anyway) on what to do next?
>
> I am genuinely stuck and would greatly appreciate any help at all to get
> up and running!
>
> Thank you
>
> LSG
>
> --
> 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/8ea19238-907c-48ea-93c0-c2155e5d5b6b%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/CABV4%2BX4OJ%2BBASNkBd8Ybfo9VrBZi6NbZBjCyQ%3DPCw-eTgPg68w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installed Python 3.7; installed Django 2.1.5. Django folder open, now what?

2019-01-16 Thread ANi
What commands have you done so far?

LinkSnakeGeralt於 2019年1月17日星期四 UTC+8上午6時37分03秒寫道:
>
> Hi everyone
>
> First timer,
>
> Basically what the post says; I have installed it, tried running it 
> through the Terminal of the MacBook Pro I have. But it did not recognise 
> any module called Django.
>
> So I went online and did a bit of digging and realised I have the folder 
> (as shown from screenshot attached) but not any clear instruction (for me 
> anyway) on what to do next?
>
> I am genuinely stuck and would greatly appreciate any help at all to get 
> up and running!
>
> Thank you
>
> LSG
>

-- 
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/b1233d76-7040-4779-afc9-3f386ee86965%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installed Python 3.7; installed Django 2.1.5. Django folder open, now what?

2019-01-16 Thread LinkSnakeGeralt
Gracias Daniel,
Unfortunately I do not have the pleasure of understanding Spanish. I have 
kept looking around with other (English) YouTube videos whilst awaiting 
further replies but the videos all seem to be really far ahead and have 
Django already up and running.

Still stuck :S

LSG

On Wednesday, January 16, 2019 at 10:58:28 PM UTC, Daniel Bojorge (Foros) 
wrote:
>
> If you could understand spanish, you could take my course...
>
>
> Dios L@s Bendiga
>
> Saludos,
>
>  
>
> [image: --]
>   
> daniel.bojorge
> [image: http://]about.me/daniel.bojorge
>   
>  *Curso Desarrollo Web con Python usando Django 2.1 Para Principiantes* 
> 
> *Fácil Replicación de Cualquier Base de Datos y/o Sistema Operativo* 
> 
> *Programación en Capas (Web y Escritorio)* 
> Mi Blog 
> Nicaragua
>
> "Si ustedes permanecen unidos a mí, y si permanecen fieles a mis 
> enseñanzas, pidan lo que quieran y se les dará. 
> (Juan 15:7 DHH)
> Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR. 
> (Jeremías 17:7 RV2000)
>
>
>
> El mié., 16 ene. 2019 a las 16:37, LinkSnakeGeralt ( >) escribió:
>
>> Hi everyone
>>
>> First timer,
>>
>> Basically what the post says; I have installed it, tried running it 
>> through the Terminal of the MacBook Pro I have. But it did not recognise 
>> any module called Django.
>>
>> So I went online and did a bit of digging and realised I have the folder 
>> (as shown from screenshot attached) but not any clear instruction (for me 
>> anyway) on what to do next?
>>
>> I am genuinely stuck and would greatly appreciate any help at all to get 
>> up and running!
>>
>> Thank you
>>
>> LSG
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@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/8ea19238-907c-48ea-93c0-c2155e5d5b6b%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/29488afd-4529-405d-b9b6-ebcd0c9a8307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installed Python 3.7; installed Django 2.1.5. Django folder open, now what?

2019-01-16 Thread Ing.Daniel Bojorge
If you could understand spanish, you could take my course...


Dios L@s Bendiga

Saludos,



[image: --]

daniel.bojorge
[image: http://]about.me/daniel.bojorge

 *Curso Desarrollo Web con Python usando Django 2.1 Para Principiantes*

*Fácil Replicación de Cualquier Base de Datos y/o Sistema Operativo*

*Programación en Capas (Web y Escritorio)* 
Mi Blog 
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)



El mié., 16 ene. 2019 a las 16:37, LinkSnakeGeralt (<
maserati7...@hotmail.com>) escribió:

> Hi everyone
>
> First timer,
>
> Basically what the post says; I have installed it, tried running it
> through the Terminal of the MacBook Pro I have. But it did not recognise
> any module called Django.
>
> So I went online and did a bit of digging and realised I have the folder
> (as shown from screenshot attached) but not any clear instruction (for me
> anyway) on what to do next?
>
> I am genuinely stuck and would greatly appreciate any help at all to get
> up and running!
>
> Thank you
>
> LSG
>
> --
> 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/8ea19238-907c-48ea-93c0-c2155e5d5b6b%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/CAMQeQjYk8qxeN2mh1rDbttEJCOL6hfKvOeg0QP9XXxZjP3ZApw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Single Sign On (SSO) across multiple django projects

2019-01-16 Thread Dennis Sepeur
thanks ruben

On Wednesday, January 16, 2019 at 9:48:16 AM UTC-8, Ruben Alves wrote:
>
> I had to do the same in the company I work for recently and after some 
> investigation we decided to use OpenID Connect: 
> http://django-oidc-provider.readthedocs.io
>
>
> Em quarta-feira, 16 de janeiro de 2019 04:14:18 UTC, Dennis Sepeur 
> escreveu:
>>
>> Hi, I've developed an monolithic django project over the last 5 years. My 
>> team and I now want to add a new component to the software.
>> The new component will be mostly independent, but need to share 
>> authentication and authorization at the least. For the end-user both the 
>> existing and the new component shall appear as one software, where a shared 
>> navigation moves the user from one component to another without the 
>> end-user noticing. 
>> I was researching for a while and came across django-oauth-toolkit, 
>> django-simple-sso, django-mama-cas and python-saml. 
>> As I see it,
>> - OAuth2 is the standard nowadays for authorization via API. But doesn't 
>> seem to be the right solution for SSO across multiple django projects (or 
>> apps. We haven't decided yet, if projects or apps)
>> - CAS seems to lose traction in in the market and I do not want to bet on 
>> a dying horse, but it kinda seems like the right solution for my challenge.
>> - SAML seems to lose traction as well and I'm not even sure if it's the 
>> right approach. Also i can only find a "python" package, not a "django" 
>> package.
>> - simple-sso seems to to what I want, but I can't find any relation to 
>> open standards that are being further developed, which would give me the 
>> confidence, that is it secure
>>
>> Do you have an opinion or do you know the preferred/common approach to 
>> have single-sign-on across multiple django projects/apps.
>> Thanks in advance. Any help is appreciated
>>
>> armadarama
>>
>

-- 
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/36981bc6-4124-451d-9b99-a952695f61e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Installed Python 3.7; installed Django 2.1.5. Django folder open, now what?

2019-01-16 Thread LinkSnakeGeralt
Hi everyone

First timer,

Basically what the post says; I have installed it, tried running it through 
the Terminal of the MacBook Pro I have. But it did not recognise any module 
called Django.

So I went online and did a bit of digging and realised I have the folder 
(as shown from screenshot attached) but not any clear instruction (for me 
anyway) on what to do next?

I am genuinely stuck and would greatly appreciate any help at all to get up 
and running!

Thank you

LSG

-- 
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/8ea19238-907c-48ea-93c0-c2155e5d5b6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at / '' is not a registered namespace

2019-01-16 Thread Gilbeesh Kosma
use this: path(' ',include('core.urls'))
On Jan 17, 2019 12:50 AM, "Thiago Brito"  wrote:

> Hi
>
> I'm beginner in django and i got this error.
>
> [image: image.png]
>
> urls.py
> [image: image.png]
>
> my app.urls.py
> [image: image.png]
>
> and my html file
> [image: image.png]
>
> and views
> [image: image.png]
> How can i fix it?
>
> any idea?
>
>
> --
> 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/CALvrLTsP0BEPUUBruHucVLCvzskYn
> -JHqAyfd%3DX%2BtG%3DrOy3jXg%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/CABV4%2BX7Me0FikkYsX_5unruQcKfKOkmsmko6kaLJOK6qSzEtjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


NoReverseMatch at / '' is not a registered namespace

2019-01-16 Thread Thiago Brito
Hi

I'm beginner in django and i got this error.

[image: image.png]

urls.py
[image: image.png]

my app.urls.py
[image: image.png]

and my html file
[image: image.png]

and views
[image: image.png]
How can i fix it?

any idea?

-- 
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/CALvrLTsP0BEPUUBruHucVLCvzskYn-JHqAyfd%3DX%2BtG%3DrOy3jXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Seeking suggestions on how shall i begin to contribute

2019-01-16 Thread Harsh Agarwal
hello , I am new here and i also want to contribute to this project . Can 
anyone please help me on how should i begin to contribute?

-- 
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/3feab860-423d-4d02-8939-9d6dc7bef440%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Overriding Save in Model

2019-01-16 Thread caleoroco
Thanks, I did say i was only two weeks into learning python and Django.

I'm sure in a few months, maybe weeks or even days, i'll look back at my 
code and say wtf


On Wednesday, 16 January 2019 17:21:24 UTC, Matthew Pava wrote:
>
> You’re converting an object (ExtractResult) into a list.  That’s just 
> weird.
>
>  
>
> ext = tldextract.extract(domain)
>
> self.sub_domain = ext.subdomain
>
> self.domain = ext.domain
>
> self.suffix = ext.suffix
>
>  
>
> Saying that, I would rather use the built-in, Pythonic way of parsing URLs.
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *cale...@gmail.com 
> 
> *Sent:* Wednesday, January 16, 2019 11:07 AM
> *To:* Django users
> *Subject:* Re: Overriding Save in Model
>
>  
>
> thanks,  i've got tldextract which is sufficient for splitting the domain 
> up
>
>  
>
> the problem is I cannot save the individual parts and only end up saving 
> the domain name
>
> On Wednesday, 16 January 2019 16:55:42 UTC, Matthew Pava wrote:
>
> Check out urllib.parse.
>
> https://docs.python.org/3/library/urllib.parse.html
>
>  
>
>  
>
> *From:* django...@googlegroups.com [mailto:django...@googlegroups.com] *On 
> Behalf Of *cale...@gmail.com
> *Sent:* Wednesday, January 16, 2019 10:41 AM
> *To:* Django users
> *Subject:* Overriding Save in Model
>
>  
>
> I'm trying to extract an entered domain name and split it up so that i can 
> store unique domains in a specific table
>
> The flow
>
> user will enter website address > model takes website address > splits it 
> into sub_domain, domain and suffix and stores the values in the appropriate 
> split fields
>
>  
>
> so far my extraction works, i can get the values into a list and assign 
> the values to the appropriate variables, using the shell i'm adding new 
> sites but and the domain is going into the domain_name field but i am not 
> getting the data split
>
>  
>
> I'm only two weeks into learning python and Django and i love it but this 
> has stopped me in my tracks for now, any help appreciated
>
>  
>
> *class *Website(models.Model):
> name = models.CharField(max_length=100, default=' ')
> description = models.TextField(max_length=2000, blank=*True*)
> domain_name = models.URLField(unique=*True*)
> sub_domain =models.CharField(max_length=56, blank=*True*, default='')
> suffix = models.CharField(max_length=56, blank=*True*, default='')
> is_secure = models.BooleanField(null=*True*)
> logo = models.CharField(max_length=256, default="placeholder.png")
> type = models.CharField(choices=WEBSITE_TYPES, default='O', max_length=15)
>
> *def __str__*(self):
> *return *self.name
>
>
> *def *validate_and_split_domain(self):
> domain = self.domain_name.lower() # make all lower case because 
> django isn't case sensitive
> values = list(tldextract.extract(domain))
> self.sub_domain, self.domain_name, self.suffix = values[0], 
> values[1], values[2]
>
> *def *save(self, **args*, ***kwargs*):
> Website.validate_and_split_domain()
> super(Website, self).save(**args*, ***kwargs*)
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com.
> To post to this group, send email to djang...@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/94d5ffbb-8975-471a-b9bb-30870e893ee8%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...@googlegroups.com .
> To post to this group, send email to djang...@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/b15fe16b-4eef-4514-a51c-5442a9aca028%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.
T

Re: Single Sign On (SSO) across multiple django projects

2019-01-16 Thread Ruben Alves
I had to do the same in the company I work for recently and after some 
investigation we decided to use OpenID 
Connect: http://django-oidc-provider.readthedocs.io


Em quarta-feira, 16 de janeiro de 2019 04:14:18 UTC, Dennis Sepeur escreveu:
>
> Hi, I've developed an monolithic django project over the last 5 years. My 
> team and I now want to add a new component to the software.
> The new component will be mostly independent, but need to share 
> authentication and authorization at the least. For the end-user both the 
> existing and the new component shall appear as one software, where a shared 
> navigation moves the user from one component to another without the 
> end-user noticing. 
> I was researching for a while and came across django-oauth-toolkit, 
> django-simple-sso, django-mama-cas and python-saml. 
> As I see it,
> - OAuth2 is the standard nowadays for authorization via API. But doesn't 
> seem to be the right solution for SSO across multiple django projects (or 
> apps. We haven't decided yet, if projects or apps)
> - CAS seems to lose traction in in the market and I do not want to bet on 
> a dying horse, but it kinda seems like the right solution for my challenge.
> - SAML seems to lose traction as well and I'm not even sure if it's the 
> right approach. Also i can only find a "python" package, not a "django" 
> package.
> - simple-sso seems to to what I want, but I can't find any relation to 
> open standards that are being further developed, which would give me the 
> confidence, that is it secure
>
> Do you have an opinion or do you know the preferred/common approach to 
> have single-sign-on across multiple django projects/apps.
> Thanks in advance. Any help is appreciated
>
> armadarama
>

-- 
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/70620176-46ef-4d98-9ff7-9877b2d97da4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


modeltranslation

2019-01-16 Thread אורי
Hi,

We are using modeltranslation in Speedy Net. We currently use it in 2
models - User and SiteProfile of Speedy Match. We currently support 2
languages - en (English) and he (Hebrew). I checked the (local) tables and
I found out that every field that we use modeltranslation for, such
as first_name in the model User - has 3 columns in the table
- first_name, first_name_en and first_name_he. It seems to me that the
first one (first_name) is not necessary and I don't understand why we need
this field in the table. If I enter the admin interface for the same user -
in English and Hebrew I see different values in this field. Is it a bug
in modeltranslation or didn't we use it correctly? I don't want each field
to be saved in 3 different columns, only 2 as the number of languages we
have. The first field is not necessary and I'm not sure it is read from the
table at all. Anyway the field (such as first_name) should be equal to the
field in the language we are using now (according to the URL of the
website). Is this the way it's supposed to be?

I checked and found out there is already an issue on the modeltranslation
GitHub website:
https://github.com/deschler/django-modeltranslation/issues/488

I didn't check all the 124 open issues there if other issues are also
related.

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 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/CABD5YeHPuLEy3k%2BAzahidzGioZ7YxCRODVV9bK%2BUnowD8xh%2BSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Overriding Save in Model

2019-01-16 Thread Matthew Pava
You’re converting an object (ExtractResult) into a list.  That’s just weird.

ext = tldextract.extract(domain)
self.sub_domain = ext.subdomain
self.domain = ext.domain
self.suffix = ext.suffix

Saying that, I would rather use the built-in, Pythonic way of parsing URLs.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of caleor...@gmail.com
Sent: Wednesday, January 16, 2019 11:07 AM
To: Django users
Subject: Re: Overriding Save in Model

thanks,  i've got tldextract which is sufficient for splitting the domain up

the problem is I cannot save the individual parts and only end up saving the 
domain name

On Wednesday, 16 January 2019 16:55:42 UTC, Matthew Pava wrote:
Check out urllib.parse.
https://docs.python.org/3/library/urllib.parse.html


From: django...@googlegroups.com 
[mailto:django...@googlegroups.com] On Behalf Of 
cale...@gmail.com
Sent: Wednesday, January 16, 2019 10:41 AM
To: Django users
Subject: Overriding Save in Model

I'm trying to extract an entered domain name and split it up so that i can 
store unique domains in a specific table
The flow
user will enter website address > model takes website address > splits it into 
sub_domain, domain and suffix and stores the values in the appropriate split 
fields

so far my extraction works, i can get the values into a list and assign the 
values to the appropriate variables, using the shell i'm adding new sites but 
and the domain is going into the domain_name field but i am not getting the 
data split

I'm only two weeks into learning python and Django and i love it but this has 
stopped me in my tracks for now, any help appreciated


class Website(models.Model):
name = models.CharField(max_length=100, default=' ')
description = models.TextField(max_length=2000, blank=True)
domain_name = models.URLField(unique=True)
sub_domain =models.CharField(max_length=56, blank=True, default='')
suffix = models.CharField(max_length=56, blank=True, default='')
is_secure = models.BooleanField(null=True)
logo = models.CharField(max_length=256, default="placeholder.png")
type = models.CharField(choices=WEBSITE_TYPES, default='O', max_length=15)

def __str__(self):
return self.name


def validate_and_split_domain(self):
domain = self.domain_name.lower() # make all lower case because django 
isn't case sensitive
values = list(tldextract.extract(domain))
self.sub_domain, self.domain_name, self.suffix = values[0], values[1], 
values[2]

def save(self, *args, **kwargs):
Website.validate_and_split_domain()
super(Website, self).save(*args, **kwargs)
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users...@googlegroups.com.
To post to this group, send email to djang...@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/94d5ffbb-8975-471a-b9bb-30870e893ee8%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/b15fe16b-4eef-4514-a51c-5442a9aca028%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/2c1b91dafe534b1e8ec07b90b4ec92bf%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: Log into existing Django site

2019-01-16 Thread Alex Heyden
The last Mac I owned had 512kB of memory and no hard drive, but it did have
that newfangled 3.5" floppy drive.

The wider internet probably knows. You might try
https://accc.uic.edu/answer/how-do-i-use-ssh-and-sftp-mac-os-x

On Wed, Jan 16, 2019 at 9:41 AM TheShoff  wrote:

> Also, how would I access the server with SSH (I have a MAC and can use
> Terminal)? I have already set up private and public keys and provided the
> public key to the hosting provider, however I used FTP to login into the
> server. Do you know how I would go about logging in with Terminal?
>
> On Tuesday, January 15, 2019 at 7:59:24 PM UTC-7, Alex Heyden wrote:
>>
>> The server that is hosting the site. The one you're trying to FTP onto.
>> Your quality of life will be greatly improved if you can SSH onto the
>> machine rather than using FTP, because the actual server software that
>> hosts Python processes usually needs to be restarted. It's unlikely (but
>> not unheard of) that you have anything like CPanel controlling a Django
>> instance. It's *probably* going to be GUnicorn or uWSGI, but there's a
>> half dozen options on that front too.
>>
>> I know that all sounds really wishy-washy, but I don't want to mislead
>> you accidentally. The overall architecture isn't that different from a PHP
>> app, but you might not recognize the configuration and file server
>> technologies being used. The further along you get, the easier it'll be for
>> people to figure out what's going on and help you at least figure out what
>> files need to be changed.
>>
>> On Tue, Jan 15, 2019 at 6:39 PM TheShoff  wrote:
>>
>>> Thank you for your response! By host machine, do you mean the machine
>>> (computer) the site was created on or the server that is hosting the site?
>>> I have always worked in PHP and HTML and am used to downloading/uploading
>>> files to the server to make changes.
>>>
>>> On Tuesday, January 15, 2019 at 2:30:44 PM UTC-7, Alex Heyden wrote:

 Assuming you're familiar with web technologies in general, you'd make
 these changes on the host machine itself, ideally through the same
 mechanism that handles deployments of source code. Code for application
 logic is often in files called "views.py" or similar, and the HTML will be
 in a folder called "templates" by convention, either near the top of the
 code or contained within the directories (called "applications" in Django)
 that hold server code.

 The FTP client is probably the closest you've gotten so far, but
 "denied access" can mean anything from permissions to authentication
 issues. You might want to start there.

 On Tue, Jan 15, 2019 at 3:04 PM TheShoff  wrote:

> I am trying to add reCaptcha to an existing Django website that was
> created by a company we no longer work with. I have server access to the
> website, but cannot figure out how to edit the files or add the reCaptcha
> form (I tried to manually add the code into the HTML and .py files and
> uploading it on my FTP client and was denied access). Do I need to login 
> to
> the website using Python to add the reCaptcha form? If so, can someone 
> tell
> me how? I am not looking to make any other changes at this time.
>
> ***Please note I am new to Django and trying to figure out how it
> works.***
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@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/da98679f-180b-4433-9c94-faa13e27ec3d%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...@googlegroups.com.
>>> To post to this group, send email to django...@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/ce4b4cc7-0082-4474-a6c3-d393665f6e32%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 unsubscrib

Re: Overriding Save in Model

2019-01-16 Thread caleoroco
thanks,  i've got tldextract which is sufficient for splitting the domain up

the problem is I cannot save the individual parts and only end up saving 
the domain name

On Wednesday, 16 January 2019 16:55:42 UTC, Matthew Pava wrote:
>
> Check out urllib.parse.
>
> https://docs.python.org/3/library/urllib.parse.html
>
>  
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *cale...@gmail.com 
> 
> *Sent:* Wednesday, January 16, 2019 10:41 AM
> *To:* Django users
> *Subject:* Overriding Save in Model
>
>  
>
> I'm trying to extract an entered domain name and split it up so that i can 
> store unique domains in a specific table
>
> The flow
>
> user will enter website address > model takes website address > splits it 
> into sub_domain, domain and suffix and stores the values in the appropriate 
> split fields
>
>  
>
> so far my extraction works, i can get the values into a list and assign 
> the values to the appropriate variables, using the shell i'm adding new 
> sites but and the domain is going into the domain_name field but i am not 
> getting the data split
>
>  
>
> I'm only two weeks into learning python and Django and i love it but this 
> has stopped me in my tracks for now, any help appreciated
>
>  
>
> *class *Website(models.Model):
> name = models.CharField(max_length=100, default=' ')
> description = models.TextField(max_length=2000, blank=*True*)
> domain_name = models.URLField(unique=*True*)
> sub_domain =models.CharField(max_length=56, blank=*True*, default='')
> suffix = models.CharField(max_length=56, blank=*True*, default='')
> is_secure = models.BooleanField(null=*True*)
> logo = models.CharField(max_length=256, default="placeholder.png")
> type = models.CharField(choices=WEBSITE_TYPES, default='O', max_length=15)
>
> *def __str__*(self):
> *return *self.name
>
>
> *def *validate_and_split_domain(self):
> domain = self.domain_name.lower() # make all lower case because 
> django isn't case sensitive
> values = list(tldextract.extract(domain))
> self.sub_domain, self.domain_name, self.suffix = values[0], 
> values[1], values[2]
>
> *def *save(self, **args*, ***kwargs*):
> Website.validate_and_split_domain()
> super(Website, self).save(**args*, ***kwargs*)
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to djang...@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/94d5ffbb-8975-471a-b9bb-30870e893ee8%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/b15fe16b-4eef-4514-a51c-5442a9aca028%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Overriding Save in Model

2019-01-16 Thread Matthew Pava
Check out urllib.parse.
https://docs.python.org/3/library/urllib.parse.html


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of caleor...@gmail.com
Sent: Wednesday, January 16, 2019 10:41 AM
To: Django users
Subject: Overriding Save in Model

I'm trying to extract an entered domain name and split it up so that i can 
store unique domains in a specific table
The flow
user will enter website address > model takes website address > splits it into 
sub_domain, domain and suffix and stores the values in the appropriate split 
fields

so far my extraction works, i can get the values into a list and assign the 
values to the appropriate variables, using the shell i'm adding new sites but 
and the domain is going into the domain_name field but i am not getting the 
data split

I'm only two weeks into learning python and Django and i love it but this has 
stopped me in my tracks for now, any help appreciated


class Website(models.Model):
name = models.CharField(max_length=100, default=' ')
description = models.TextField(max_length=2000, blank=True)
domain_name = models.URLField(unique=True)
sub_domain =models.CharField(max_length=56, blank=True, default='')
suffix = models.CharField(max_length=56, blank=True, default='')
is_secure = models.BooleanField(null=True)
logo = models.CharField(max_length=256, default="placeholder.png")
type = models.CharField(choices=WEBSITE_TYPES, default='O', max_length=15)

def __str__(self):
return self.name


def validate_and_split_domain(self):
domain = self.domain_name.lower() # make all lower case because django 
isn't case sensitive
values = list(tldextract.extract(domain))
self.sub_domain, self.domain_name, self.suffix = values[0], values[1], 
values[2]

def save(self, *args, **kwargs):
Website.validate_and_split_domain()
super(Website, self).save(*args, **kwargs)
--
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/94d5ffbb-8975-471a-b9bb-30870e893ee8%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/9847dabf01254e1191742f46df6a088a%40iss2.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Overriding Save in Model

2019-01-16 Thread caleoroco
I'm trying to extract an entered domain name and split it up so that i can 
store unique domains in a specific table
The flow
user will enter website address > model takes website address > splits it 
into sub_domain, domain and suffix and stores the values in the appropriate 
split fields

so far my extraction works, i can get the values into a list and assign the 
values to the appropriate variables, using the shell i'm adding new sites 
but and the domain is going into the domain_name field but i am not getting 
the data split

I'm only two weeks into learning python and Django and i love it but this 
has stopped me in my tracks for now, any help appreciated

class Website(models.Model):
name = models.CharField(max_length=100, default=' ')
description = models.TextField(max_length=2000, blank=True)
domain_name = models.URLField(unique=True)
sub_domain =models.CharField(max_length=56, blank=True, default='')
suffix = models.CharField(max_length=56, blank=True, default='')
is_secure = models.BooleanField(null=True)
logo = models.CharField(max_length=256, default="placeholder.png")
type = models.CharField(choices=WEBSITE_TYPES, default='O', max_length=15)

def __str__(self):
return self.name


def validate_and_split_domain(self):
domain = self.domain_name.lower() # make all lower case because django 
isn't case sensitive
values = list(tldextract.extract(domain))
self.sub_domain, self.domain_name, self.suffix = values[0], values[1], 
values[2]

def save(self, *args, **kwargs):
Website.validate_and_split_domain()
super(Website, self).save(*args, **kwargs)

-- 
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/94d5ffbb-8975-471a-b9bb-30870e893ee8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best Learning Resources

2019-01-16 Thread caleoroco
Thanks 

On Wednesday, 16 January 2019 13:35:26 UTC, Godson Rapture wrote:
>
> Check out the book "django for beginners "
>
> On Wed, Jan 16, 2019, 2:19 PM > wrote:
>
>> Hi All,
>>
>> I'm just starting out with Django and python and wondering if anyone can 
>> direct me to some goto learning resources. Beginner to Advanced
>>
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/82db4a06-5a19-43c5-9d04-b3007a45173d%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/2b92249d-f849-4ec6-b57a-302849a65dbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Log into existing Django site

2019-01-16 Thread TheShoff
Also, how would I access the server with SSH (I have a MAC and can use 
Terminal)? I have already set up private and public keys and provided the 
public key to the hosting provider, however I used FTP to login into the 
server. Do you know how I would go about logging in with Terminal? 

On Tuesday, January 15, 2019 at 7:59:24 PM UTC-7, Alex Heyden wrote:
>
> The server that is hosting the site. The one you're trying to FTP onto. 
> Your quality of life will be greatly improved if you can SSH onto the 
> machine rather than using FTP, because the actual server software that 
> hosts Python processes usually needs to be restarted. It's unlikely (but 
> not unheard of) that you have anything like CPanel controlling a Django 
> instance. It's *probably* going to be GUnicorn or uWSGI, but there's a 
> half dozen options on that front too.
>
> I know that all sounds really wishy-washy, but I don't want to mislead you 
> accidentally. The overall architecture isn't that different from a PHP app, 
> but you might not recognize the configuration and file server technologies 
> being used. The further along you get, the easier it'll be for people to 
> figure out what's going on and help you at least figure out what files need 
> to be changed.
>
> On Tue, Jan 15, 2019 at 6:39 PM TheShoff  > wrote:
>
>> Thank you for your response! By host machine, do you mean the machine 
>> (computer) the site was created on or the server that is hosting the site? 
>> I have always worked in PHP and HTML and am used to downloading/uploading 
>> files to the server to make changes. 
>>
>> On Tuesday, January 15, 2019 at 2:30:44 PM UTC-7, Alex Heyden wrote:
>>>
>>> Assuming you're familiar with web technologies in general, you'd make 
>>> these changes on the host machine itself, ideally through the same 
>>> mechanism that handles deployments of source code. Code for application 
>>> logic is often in files called "views.py" or similar, and the HTML will be 
>>> in a folder called "templates" by convention, either near the top of the 
>>> code or contained within the directories (called "applications" in Django) 
>>> that hold server code.
>>>
>>> The FTP client is probably the closest you've gotten so far, but "denied 
>>> access" can mean anything from permissions to authentication issues. You 
>>> might want to start there.
>>>
>>> On Tue, Jan 15, 2019 at 3:04 PM TheShoff  wrote:
>>>
 I am trying to add reCaptcha to an existing Django website that was 
 created by a company we no longer work with. I have server access to the 
 website, but cannot figure out how to edit the files or add the reCaptcha 
 form (I tried to manually add the code into the HTML and .py files and 
 uploading it on my FTP client and was denied access). Do I need to login 
 to 
 the website using Python to add the reCaptcha form? If so, can someone 
 tell 
 me how? I am not looking to make any other changes at this time. 

 ***Please note I am new to Django and trying to figure out how it 
 works.***

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To post to this group, send email to django...@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/da98679f-180b-4433-9c94-faa13e27ec3d%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...@googlegroups.com .
>> To post to this group, send email to django...@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/ce4b4cc7-0082-4474-a6c3-d393665f6e32%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.

Re: Log into existing Django site

2019-01-16 Thread TheShoff
That makes sense. Thanks Alex!

On Tuesday, January 15, 2019 at 7:59:24 PM UTC-7, Alex Heyden wrote:
>
> The server that is hosting the site. The one you're trying to FTP onto. 
> Your quality of life will be greatly improved if you can SSH onto the 
> machine rather than using FTP, because the actual server software that 
> hosts Python processes usually needs to be restarted. It's unlikely (but 
> not unheard of) that you have anything like CPanel controlling a Django 
> instance. It's *probably* going to be GUnicorn or uWSGI, but there's a 
> half dozen options on that front too.
>
> I know that all sounds really wishy-washy, but I don't want to mislead you 
> accidentally. The overall architecture isn't that different from a PHP app, 
> but you might not recognize the configuration and file server technologies 
> being used. The further along you get, the easier it'll be for people to 
> figure out what's going on and help you at least figure out what files need 
> to be changed.
>
> On Tue, Jan 15, 2019 at 6:39 PM TheShoff  > wrote:
>
>> Thank you for your response! By host machine, do you mean the machine 
>> (computer) the site was created on or the server that is hosting the site? 
>> I have always worked in PHP and HTML and am used to downloading/uploading 
>> files to the server to make changes. 
>>
>> On Tuesday, January 15, 2019 at 2:30:44 PM UTC-7, Alex Heyden wrote:
>>>
>>> Assuming you're familiar with web technologies in general, you'd make 
>>> these changes on the host machine itself, ideally through the same 
>>> mechanism that handles deployments of source code. Code for application 
>>> logic is often in files called "views.py" or similar, and the HTML will be 
>>> in a folder called "templates" by convention, either near the top of the 
>>> code or contained within the directories (called "applications" in Django) 
>>> that hold server code.
>>>
>>> The FTP client is probably the closest you've gotten so far, but "denied 
>>> access" can mean anything from permissions to authentication issues. You 
>>> might want to start there.
>>>
>>> On Tue, Jan 15, 2019 at 3:04 PM TheShoff  wrote:
>>>
 I am trying to add reCaptcha to an existing Django website that was 
 created by a company we no longer work with. I have server access to the 
 website, but cannot figure out how to edit the files or add the reCaptcha 
 form (I tried to manually add the code into the HTML and .py files and 
 uploading it on my FTP client and was denied access). Do I need to login 
 to 
 the website using Python to add the reCaptcha form? If so, can someone 
 tell 
 me how? I am not looking to make any other changes at this time. 

 ***Please note I am new to Django and trying to figure out how it 
 works.***

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To post to this group, send email to django...@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/da98679f-180b-4433-9c94-faa13e27ec3d%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...@googlegroups.com .
>> To post to this group, send email to django...@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/ce4b4cc7-0082-4474-a6c3-d393665f6e32%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/ab339e56-a21f-43fc-8232-f364f7ccc9cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: python manage.py runserver is throwing error in windows

2019-01-16 Thread Nigel Copley
You'll need to fix the syntax error %s=%s' % (k, v) for k, v wherever it is
in your code

On Wed, 16 Jan 2019, 13:20 Imran,  wrote:

> Hi,
>
> I have installed Django 1.11.7 in my windows 7 machine. I am getting the
> following error when i run python manage.py runserver. Is there a
> workaround to fix it?
>
> Unhandled exception in thread started by  check_errors..wrapper
>  at 0x033EA9C0>
> Traceback (most recent call last):
>   File
> "C:\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line
> 228, in wrapper
> fn(*args, **kwargs)
>   File
> "C:\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py",
> line 117, in inner_run
> autoreload.raise_last_exception()
>   File
> "C:\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py",
> line 251, in raise_last_exception
> six.reraise(*_exception)
>   File "C:\Python\Python37-32\lib\site-packages\django\utils\six.py", line
> 685, in reraise
> raise value.with_traceback(tb)
>   File
> "C:\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line
> 228, in wrapper
> fn(*args, **kwargs)
>   File "C:\Python\Python37-32\lib\site-packages\django\__init__.py", line
> 27, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File "C:\Python\Python37-32\lib\site-packages\django\apps\registry.py",
> line 85, in populate
> app_config = AppConfig.create(entry)
>   File "C:\Python\Python37-32\lib\site-packages\django\apps\config.py",
> line 94, in create
> module = import_module(entry)
>   File "C:\Python\Python37-32\lib\importlib\__init__.py", line 127, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 1006, in _gcd_import
>   File "", line 983, in _find_and_load
>   File "", line 967, in
> _find_and_load_unlocked
>   File "", line 677, in _load_unlocked
>   File "", line 728, in exec_module
>   File "", line 219, in
> _call_with_frames_removed
>   File
> "C:\Python\Python37-32\lib\site-packages\django\contrib\admin\__init__.py",
> line 4, in 
> from django.contrib.admin.filters import (
>   File
> "C:\Python\Python37-32\lib\site-packages\django\contrib\admin\filters.py",
> line 10, in 
> from django.contrib.admin.options import IncorrectLookupParameters
>   File
> "C:\Python\Python37-32\lib\site-packages\django\contrib\admin\options.py",
> line 12, in 
> from django.contrib.admin import helpers, widgets
>   File
> "C:\Python\Python37-32\lib\site-packages\django\contrib\admin\widgets.py",
> line 151
> '%s=%s' % (k, v) for k, v in params.items(),
> ^
> SyntaxError: Generator expression must be parenthesized
>
> --
> 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/bdded2a4-f7fc-4fb3-9b97-4e6acbcee621%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/CAFtSCBiM5QXN7_dxDfQnFfNerW7yzg_7J7axEgO28deBZ0m6Zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How To Set Up Django with Postgres, Nginx, and Gunicorn on DIGITAL OCEAN

2019-01-16 Thread Mohammad Shareef M
thank you

Thanks & Regards,
Mahammad Shareef M
 +919741482617
 +971581756035


On Wed, Jan 16, 2019 at 5:20 PM  wrote:

> this should help
>
> https://simpleisbetterthancomplex.com/tutorial/2016/10/14/how-to-deploy-to-digital-ocean.html
>
> On Wednesday, 16 January 2019 07:53:31 UTC, Shareef 617 wrote:
>>
>> How To Set Up Django with Postgres, Nginx, and Gunicorn on digital ocean
>>
> --
> 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/d6c6883a-7730-4a3a-af84-cd0b9f5c0dcc%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/CAPUAdBE2K7q%3DU3yjdCxNkFJY05kxC4FCdsLyfD8yYyjk5%2BYcMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best Learning Resources

2019-01-16 Thread Godson Rapture
Check out the book "django for beginners "

On Wed, Jan 16, 2019, 2:19 PM  wrote:

> Hi All,
>
> I'm just starting out with Django and python and wondering if anyone can
> direct me to some goto learning resources. Beginner to Advanced
>
> 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 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/82db4a06-5a19-43c5-9d04-b3007a45173d%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/CAEUEpOTbj5hKQmOzDkX6xtQT_xCmiKdAeHvQ%3DG3OqK-%3D_30QOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


python manage.py runserver is throwing error in windows

2019-01-16 Thread Imran
Hi,

I have installed Django 1.11.7 in my windows 7 machine. I am getting the 
following error when i run python manage.py runserver. Is there a 
workaround to fix it?

Unhandled exception in thread started by .wrapper
 at 0x033EA9C0>
Traceback (most recent call last):
  File 
"C:\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 
228, in wrapper
fn(*args, **kwargs)
  File 
"C:\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py",
 
line 117, in inner_run
autoreload.raise_last_exception()
  File 
"C:\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", 
line 251, in raise_last_exception
six.reraise(*_exception)
  File "C:\Python\Python37-32\lib\site-packages\django\utils\six.py", line 
685, in reraise
raise value.with_traceback(tb)
  File 
"C:\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 
228, in wrapper
fn(*args, **kwargs)
  File "C:\Python\Python37-32\lib\site-packages\django\__init__.py", line 
27, in setup
apps.populate(settings.INSTALLED_APPS)
  File "C:\Python\Python37-32\lib\site-packages\django\apps\registry.py", 
line 85, in populate
app_config = AppConfig.create(entry)
  File "C:\Python\Python37-32\lib\site-packages\django\apps\config.py", 
line 94, in create
module = import_module(entry)
  File "C:\Python\Python37-32\lib\importlib\__init__.py", line 127, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"C:\Python\Python37-32\lib\site-packages\django\contrib\admin\__init__.py", 
line 4, in 
from django.contrib.admin.filters import (
  File 
"C:\Python\Python37-32\lib\site-packages\django\contrib\admin\filters.py", 
line 10, in 
from django.contrib.admin.options import IncorrectLookupParameters
  File 
"C:\Python\Python37-32\lib\site-packages\django\contrib\admin\options.py", 
line 12, in 
from django.contrib.admin import helpers, widgets
  File 
"C:\Python\Python37-32\lib\site-packages\django\contrib\admin\widgets.py", 
line 151
'%s=%s' % (k, v) for k, v in params.items(),
^
SyntaxError: Generator expression must be parenthesized

-- 
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/bdded2a4-f7fc-4fb3-9b97-4e6acbcee621%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How To Set Up Django with Postgres, Nginx, and Gunicorn on DIGITAL OCEAN

2019-01-16 Thread caleoroco
this should help
https://simpleisbetterthancomplex.com/tutorial/2016/10/14/how-to-deploy-to-digital-ocean.html

On Wednesday, 16 January 2019 07:53:31 UTC, Shareef 617 wrote:
>
> How To Set Up Django with Postgres, Nginx, and Gunicorn on digital ocean
>

-- 
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/d6c6883a-7730-4a3a-af84-cd0b9f5c0dcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How To Set Up Django with Postgres, Nginx, and Gunicorn on DIGITAL OCEAN

2019-01-16 Thread Nur Mohsin
You can follow this tutorial.
https://simpleisbetterthancomplex.com/tutorial/2016/10/14/how-to-deploy-to-digital-ocean.html

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 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/CAM0c9RofeCypYNA7QA%2BP%2Bj2uTzP6seXA7DH2SVeZBXcjGpzauA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Best Learning Resources

2019-01-16 Thread caleoroco
Hi All,

I'm just starting out with Django and python and wondering if anyone can 
direct me to some goto learning resources. Beginner to Advanced

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 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/82db4a06-5a19-43c5-9d04-b3007a45173d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can a class which inherits from factory.DjangoModelFactory use Django TestCase asserts?

2019-01-16 Thread אורי
Hi Michal,

I test the models and not the factories. The factories in this case are
only used for testing, they are not used in production. And I prefer to
test the factory every time it is invoked even if it means the tests will
take more time to complete.

Anyway, in this case the solution I found is - I created a new class and a
new object - `_test_case_with_mixin` - which is called from the factory to
assert that the model is working correctly (in this case, assigning the
user's first and last name in all languages). And the factory is calling
asserts from this object and not directly with self. The code can be seen
on
https://github.com/speedy-net/speedy-net/blob/staging/speedy/core/accounts/test/base_user_factories.py.
In this case, I checked and commenting `def clean_all_fields` in our User
model causes the tests to fail, which is what I expect. I only wrote this
method a few days ago to fix a bug in the models.

In another factory, I also created another object called `_test_case` to
assert other things where the mixin is not needed:
https://github.com/speedy-net/speedy-net/blob/staging/speedy/match/accounts/test/user_factories.py

Thanks,
אורי (Uri)
u...@speedy.net


On Mon, Jan 14, 2019 at 6:47 PM Michal Petrucha <
michal.petru...@konk.org> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> On Sat, Jan 12, 2019 at 03:59:59PM +0200, אורי wrote:
> > Hi,
> >
> > I have a problem with tests. We defined a class called DefaultUserFactory
> > which inherits from factory.DjangoModelFactory, and I want to use asserts
> > in this class such as assertEqual. What is the best approach to do it? I
> > tried to inherit both from factory.DjangoModelFactory and from Django
> class
> > TestCase but it doesn't work. I thought about passing a parameter from
> the
> > calling function and then call assertEqual of the calling function's
> self.
> > But it seems too complicated. Is there a better approach?
> >
> > You can see our code on GitHub:
> >
> > master:
> >
> https://github.com/speedy-net/speedy-net/blob/master/speedy/core/accounts/tests/test_factories.py
> >
> > staging (under development):
> >
> https://github.com/speedy-net/speedy-net/blob/staging/speedy/core/accounts/tests/test_factories.py
>
> Hi,
>
> The factory class is not really the place to put your test assertions.
> That would be the responsibility of the code of your actual test
> cases. Factories are just one of the tools that you happen to mostly
> use in tests, but you can totally use them to generate a sample
> database outside of an automated test environment.
>
> Running this kind of test code in your factory would also have the
> drawback that you'd run the same asserts over and over and over again
> every single time you invoke the factory – which might be thousands of
> times during one run of your test suite.
>
> As I understand it, you want to test your factories, which is a good
> idea. What I suggest you do is to just write a separate test module
> for your factories.
>
> Good luck,
>
> Michal
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
>
> iQIcBAEBCgAGBQJcPL0tAAoJEHA7T/IPM/klKeUQAMYUPpVVXAazNEt6Ga2He5V3
> ZmmCDyYqQIJvrDAEwX7S1HbOq2K+EjvKeL2/dAf0Si7SQJPsjHcElUOIuSs+ch+/
> 46C5KM+3LLf3v2H6u1793TQy+oImoaygv8Mp3OZ8j7bfUH2dsBiLhECmfwQz48Ra
> Uw/p7FoKKsT5saVK/bA4uoI2mIrnBKCj2KiZyYbkRs928tP9tAYIsHAotSXHDZVo
> at8yyJ+J1nFFAzhZPJWN72zK0Pw5RdPF2L3wOrRhVgHLDfYsaZI9O4+6HYBjKkPn
> 6YWTVG1xq5p+dfofvtdzzFOiDn2rBRWgLlx3zl9cVE6xY7HjaieCI1a9IaePFXy8
> MRIytt1Cc41tyT1lCl2yFBc+NT0+DFZMizNUkTgdzwM2uL2BlIh3+GsEY82ZzX/H
> iwZ8DSOVuE2Iqpo132LrqcllHqNehxSYya7WBeBYHJiuDq2b2OaJp6ko5eb13ukn
> LaVZGVwl+dmSx9HhVDqYHWHxK7AuEiE0CI+Y7Oy7RQhSH97L2MEw1qQlt6UxZtiz
> 83U0+RbNjDqXN0oMhswHtbnvnqnvKMg5zHVjzoLdAxrT+IIWUAnP6IqIM9v4UkgX
> 1aPof7eI6nm//ZA+fjmjCRorF3rHi98ZeK0a9Xccakl09zNKX7Vc/nlIbQqlKV8e
> YawH4kZesUSUWBkIuIV/
> =0T5r
> -END PGP SIGNATURE-
>
> --
> 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/20190114164741.GV8269%40konk.org
> .
> 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/CABD5YeHWu3pdT0Y9y%2B4OGWGuW2VaefhFv3maXUq8R4J5K5EH3w%40mail.gmail.com.
For more option

Re: Problem with testing on Travis CI

2019-01-16 Thread אורי
Thank you Michal, I was not aware of this issue. I fixed it and committed
again -
https://github.com/speedy-net/speedy-net/commit/6570e00edb9d58c8d855f8b7ea6a8129c774eb33.
Thanks for your help!

Thanks,
אורי (Uri)
u...@speedy.net


On Wed, Jan 16, 2019 at 11:39 AM Michal Petrucha <
michal.petru...@konk.org> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> On Wed, Jan 16, 2019 at 09:11:47AM +0200, אורי wrote:
> > Hi,
> >
> > I recently have problems with testing my project on Travis CI. Tests
> > started to fail 2 days ago. The error message is
> > `psycopg2.OperationalError: FATAL:  database "speedy" does not exist`
> and I
> > don't know why. It seems to me that the first test which fail for this
> > reason is https://travis-ci.org/speedy-net/speedy-net/builds/479248003
> and
> > the commit is
> >
> https://github.com/speedy-net/speedy-net/commit/04c4c891f64c4eee3accc393e59b5d18f0c8bbcc
> ,
> > but I don't know what in this commit causes the tests to fail. When I run
> > the tests locally they run without problems. Do you know why our tests
> fail
> > on Travis CI?
>
> Hi Uri,
>
> The problem is the following line:
>
> https://github.com/speedy-net/speedy-net/commit/04c4c891f64c4eee3accc393e59b5d18f0c8bbcc#diff-c1494957b796412b658b8c2c97136711R6
> That line tries to execute a database query during import, which will
> not work – you don't want to make import-time queries, because those
> will be routed to the production database even when you're running
> tests, and they will also make it impossible for you to run migrations
> in a fresh, empty database.
>
> Good luck,
>
> Michal
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
>
> iQIcBAEBCgAGBQJcPvvRAAoJEHA7T/IPM/kl4gsP/j2Pyl8YQsUi94saQFnIaEIH
> sxQ28wm4a5vlfAyKxDDNZqcBBwVq0YPkpflEe5DnmFjQdcsanjZgxt+ejwwONmFF
> +kP7gjD1mPmGG4V2XT5MllzI0VR5clZiP7leXgnQq+Xgtb0+xdfQHjZMm8JszhVe
> oWbCgRlBNOXDPhnSS5mu5rh//zbBGaOQHjN6vcmmT+M7OQcjDD4nmsEnz3fY3b5J
> mh3Y/X8h0dzCao0cAul7m8Pynu/xDl5THQS9dI4YIEOrzdQBkjNZMonNr0rK7e5o
> 49MbfHOGRmDNdF53w2AfKe+9FN/I+C9WXR6XQNE2858aveGM0o+hw+P+1RhNUPBF
> /oov5rDu0vmyLDd2ip3lHZ0ki12mkMKYMZQ6Yfit4X1nLaob/6oQ4KkMCzawrIWS
> CekjFC2HQY6SJJRpS0VGjft5qlRvEgO9isn+THoNDIEZDJj1XT07RJldA+6/g1Jy
> POeneUyxa7j1F3gcW86lazCfavLO7LhPnAcWKjntc9j5Xq5/l0TyJcORV6yJFMSu
> Wgh3YrqjIZcOMkX+YiJ0pr5iqkZ3M/hieLALuaM13iYbx1NtL+k34rx76ROz8sw4
> BpAO/oUMJnDS+2yT/G2FmTdhJisznTjsqgwfyDSAdlMSpADjxNj62ykojgCTjhpB
> J6DfyIn1PH3LaTeWK4bi
> =zAwN
> -END PGP SIGNATURE-
>
> --
> 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/20190116093929.GZ8269%40konk.org
> .
> 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/CABD5YeGsY6Fk0DooCVYXbbg9knL4wn7Y2Y%3D2y_Gitm5-sFrbVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: tasks queues - why a broker and not the DB?

2019-01-16 Thread Olivier Dalang
So, unless the project has a really enormous amount of tasks, there's no
other reason than not overload the db ? I'm a bit surprised as I feel like
for most projects, reading/writing the tasks queue represents a very small
load compared to regular db access.

In the meantime, I found about django-q that seems to have a django orm
backend too.

I'll give it a shot.

Thanks for your replies !!


On Wed, Jan 16, 2019 at 3:15 AM Ira Abbott  wrote:

> I went with celery/rabbitmq behind a load balancer running on the same
> image as my server.  I haven’t done any corner case testing, but so far it
> seems to scale up and down well after some tweaking on thresholds.  Doing
> this, rules out some of the smallest instances, as more memory is needed
> for each worker queue.
>
> Sent from my iPhone
>
> On Jan 15, 2019, at 8:29 PM, Jason  wrote:
>
> primarily because writes to db are expensive, and reads are less so but do
> add load to an existing db.
>
> besides, why not use the best tool for the job?  redis is much better at
> read/write IO than dbs and functions perfectly well as a key-value store.
> Rabbit is the gold standard for high availbility queue.
>
> not saying you shouldn't use the db, but but when there are better options
> that don't add extra load to an existing db infra that's already under
> somewhat serious load
>
> for example, my company regularly does full reindexes of all their content
> in a solr search engine.  that can encompass somewhere in the neighborhood
> of about 250k tasks and take 2.5-3 days to execute.  Do you _really_ want
> to dump 250k records in your db in one go?  And another place I was at
> indexed somewhere around 25M mirrored web pages, one page per task.  I
> would definitely not wanted to have dumped all that in a db
>
> --
> 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/df99c32a-139a-4bbb-bc8f-2156474a7e3d%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/BB76932C-547E-4F2A-8C8B-840E4D35D27A%40gmail.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/CAExk7p1A5DiBq7NT-uf6LpRjCemsS1z4--u728egEg8zwM0kfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: No module named django.core.wsgi, Apache+ CentOS

2019-01-16 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Tue, Jan 15, 2019 at 08:04:23PM -0800, ANi wrote:
> Hey guys.

Maybe consider asking not just the guys next time. ;)

> I am trying to deploy my Django project on CentOS 7 with Apache.
> and I got an error of  *ImportError: No module named django.core.wsgi*
> I think it is because the Apache did not use the python version inside the 
> virtualenv
> However I dont know where the problem is.
> 
> this is my httpd.conf 
> WSGIProcessGroup project
> WSGIDaemonProcess project python-path=/var/www/html/project:/var/www/html/
> inv/Lib/python3.7/site-packages
> WSGIPythonPath /var/www/html/project:/var/www/html/inv/Lib/python3.7/site-
> packages
> 
> Alias /static "/var/www/html/project/static-files"
> 
> Require all granted
> 
> 
> 
> 
> 
> Require all granted
> 
> 
> I install wsgi_mod by *yum install mod_wsgi*
> [mpm_prefork:notice] [pid 25884] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.
> 2k-fips mod_fcgid/2.3.9 mod_wsgi/3.4 Python/2.7.5 configured -- resuming 
> normal operations

As the log line above indicates, the mod_wsgi you're using is built
against Python 2.7.5, but you're configuring it to point to a Python
3.7 environment; that will not work.

A quick search of the internets indicates that CentOS 7 does not
provide a mod_wsgi package built against any other version of Python
than 2.7, which means you'll need to build it yourself.

One way would be to use pip to install mod_wsgi in your application's
virtualenv (you'll need to ensure that you have all the necessary
header files for apache and Python installed), and then execute::

mod_wsgi-express module-config

which will show you the lines you need to insert into your apache
config in order to use that build of mod_wsgi. More details are
explained at
https://pypi.org/project/mod_wsgi/#connecting-into-apache-installation.

Good luck,

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJcPv4XAAoJEHA7T/IPM/klJ9MQAMYJ60aXMk2c1ZsqIP0yuRfS
GEOKVGM53pPTKWBt74fVkMSRCg8A6pC/Vmwka9f/wBCbG6/5QeFzYu0usuiTTGM0
m3KjjddEr0f7zr4KABkzsT9Q7F1gRymRqG3tqec40dLTPfLbiyITy5MUBGi0g8VS
cqSHfXhqQLHls3EjqH5gDgQy9i7J3GvJmjO5be9HEqnukO3o2NIff6mCnTmx1+TX
irvnXJ3th29j8Z7iHHl11JzWQgNQf4xKPZkpIb8x9DcZ66Its7fnx//bAkWcngAw
BpglB3GkAuyLi8XgTDlSEkwbNqJS00bjwZ/RWzfHwnXyu684quZMqDdLk7pJdn0I
uJH0d47zb3NHlOy1ODBrkds6QJMxW84x5jMpZnmeCs0O+h4A+zm42TFvTGKf7DlG
Tu8p5ZjMLD1oB1MEypdXJuURO2fUKigHHMjstBl7oJ04zoaZ8UWgJnMAxrjRCIJH
G0u4Un/O5cMTAKEzakaHvn0FJ5okwXhF+Pdn8g5oIPedBZNhiG4jg7cu4VjOz3/s
B/FADAh/ZHPkLe9aMe/I4L+oMxr4daCDw09TiT4eMFH8qYkIv+VBqRx9Gb7d0Fu5
Gp74k7cclszfSSfXZzIM+AAsDhTg+njzOgMO6tazYW/APBABOWQygvgtEGPvgOJo
Ln0azAuyh+PShZW5JXeg
=X2I7
-END PGP SIGNATURE-

-- 
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/20190116094912.GA8269%40konk.org.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with testing on Travis CI

2019-01-16 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Wed, Jan 16, 2019 at 09:11:47AM +0200, אורי wrote:
> Hi,
> 
> I recently have problems with testing my project on Travis CI. Tests
> started to fail 2 days ago. The error message is
> `psycopg2.OperationalError: FATAL:  database "speedy" does not exist` and I
> don't know why. It seems to me that the first test which fail for this
> reason is https://travis-ci.org/speedy-net/speedy-net/builds/479248003 and
> the commit is
> https://github.com/speedy-net/speedy-net/commit/04c4c891f64c4eee3accc393e59b5d18f0c8bbcc,
> but I don't know what in this commit causes the tests to fail. When I run
> the tests locally they run without problems. Do you know why our tests fail
> on Travis CI?

Hi Uri,

The problem is the following line:
https://github.com/speedy-net/speedy-net/commit/04c4c891f64c4eee3accc393e59b5d18f0c8bbcc#diff-c1494957b796412b658b8c2c97136711R6
That line tries to execute a database query during import, which will
not work – you don't want to make import-time queries, because those
will be routed to the production database even when you're running
tests, and they will also make it impossible for you to run migrations
in a fresh, empty database.

Good luck,

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJcPvvRAAoJEHA7T/IPM/kl4gsP/j2Pyl8YQsUi94saQFnIaEIH
sxQ28wm4a5vlfAyKxDDNZqcBBwVq0YPkpflEe5DnmFjQdcsanjZgxt+ejwwONmFF
+kP7gjD1mPmGG4V2XT5MllzI0VR5clZiP7leXgnQq+Xgtb0+xdfQHjZMm8JszhVe
oWbCgRlBNOXDPhnSS5mu5rh//zbBGaOQHjN6vcmmT+M7OQcjDD4nmsEnz3fY3b5J
mh3Y/X8h0dzCao0cAul7m8Pynu/xDl5THQS9dI4YIEOrzdQBkjNZMonNr0rK7e5o
49MbfHOGRmDNdF53w2AfKe+9FN/I+C9WXR6XQNE2858aveGM0o+hw+P+1RhNUPBF
/oov5rDu0vmyLDd2ip3lHZ0ki12mkMKYMZQ6Yfit4X1nLaob/6oQ4KkMCzawrIWS
CekjFC2HQY6SJJRpS0VGjft5qlRvEgO9isn+THoNDIEZDJj1XT07RJldA+6/g1Jy
POeneUyxa7j1F3gcW86lazCfavLO7LhPnAcWKjntc9j5Xq5/l0TyJcORV6yJFMSu
Wgh3YrqjIZcOMkX+YiJ0pr5iqkZ3M/hieLALuaM13iYbx1NtL+k34rx76ROz8sw4
BpAO/oUMJnDS+2yT/G2FmTdhJisznTjsqgwfyDSAdlMSpADjxNj62ykojgCTjhpB
J6DfyIn1PH3LaTeWK4bi
=zAwN
-END PGP SIGNATURE-

-- 
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/20190116093929.GZ8269%40konk.org.
For more options, visit https://groups.google.com/d/optout.


Fwd: channnels -- communication with redis

2019-01-16 Thread Yuval Bachrach
Trying one more time: I don't see my response at my inbox so others may not
have it as well...

(Tried to respond right after getting your response, however, I have my
message in "sent items" but nothing more... I wonder if there is a filter I
managed to hit having my response blocked... Si I will re-write:)

Thank you!

I have installed docker on my PC and I run it locally.
At setting.py I have:

CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
# "hosts": [('172.17.0.1', 6379)],
"hosts": [('127.0.0.1', 6379)],
},
},
}



   - I am running a windows os,
   - With docker installation I got a "Docker Quickstart Terminal". This
   terminal looks like a unix shell (So I am using unix commands inside this
   shell)
  - This configuration is the exact configuration that is described at
  the channels tutorial
  -  I run the docker commands in this shell (as you have seen)
  - As for "python manage.py shell" and running the set of commands
  causing the failure I have described: It happens both when I am
running the
  python shell at this Docker terminal or a normal windows CMD
   - I am running "Microsoft Windows 10 home" 64 bits. The fact that it is
   the "home" version can be part of the problem I have, however, while 64 bit
   support is required (docker), there is no limitation as for "home".
  -
 - I also think that it is likely that I have  a communication
 problem between the redis server running inside the docker
container and
 the client outside but I can't tell fore sure ( "It looks
network/local
 environment related rather than something redis/docker specific")
- As mentioned before, I see the problem also when running the
python shell from " Docker Quickstart Terminal"
- I have suspended   windows defender firewall" and executed
the commands inside the python shell again: I still have the problem
- when trying to use runserver (instead of shell) and trying to
access the site via chrome I get an error message " Chat
socket closed
unexpectedly" – I assume it is a symptom of the same problem. (I
also get a warning “chrome.loadTimes() is deprecated, instead use
standardized API: nextHopProtocol in Navigation)”
- How can I check this communication? I would use telnet but I
am not sure how to use telenet to test the viability of
redis and the
connectivity to it





-- Forwarded message -
From: Roger Gammans 
Date: Tue, Jan 15, 2019 at 7:32 PM
Subject: Re: channnels -- communication with redis
To: 



Hi Yuval

Are you using docker machine ? If so the redis server is on the docker
machine's IP not on the localhost so you would need to update the docker
host in the CHANNEL_LAYERS portion of settings.py.

You show a unix-like shell like for controlling docker; but the connect
failed error looks very windowssy; so I'm not sure that the docker engine
(daemon) and the python is running on the TCP stack (or kernel/VM) which
you would need for the local host connection to work. Also it might be
sensible to ensure the connection is being block by a local firewall if you
have one.

It looks network/local environment related rather than something
redis/docker specific. The error show the TCP connection (which you can
test with telnet if you have it install) not be made between python and the
redis deamon the most likely reason for that is a local firewall or a more
complex environment.


-- 

Roger Gammans 
Gamma Science


On Tue, 2019-01-15 at 18:49 +0200, Yuval Bachrach wrote:

I did not configure anything, which is probably the problem..
I am following the tutorial. I just did what the tutorial instructed to do:
So I have installed docker as instructed but haven't configured anything.
The tutorial calls installing docker and does not state any action to take
after installing)
as I am not familiar with docker, could not tell if there is a need to
configure anything to make django channels work.  I still need to do
whatever is required to make the tutorial work.Do I need to learn basics of
docker first, or are there some simple things I can do to enable the
environment and keep going with the channels tutorial?

On Tue, Jan 15, 2019 at 6:38 PM PASCUAL Eric  wrote:

Hi,


How is configured your Docker stack exactly ? You should have several
containers in it, at least one for the Redis server, another one for the
Django app.


Do you use docker-compose to run the stack ? If yes, could you provide the
YAML descriptor of the stack ?


Best


Eric


--
*From:* django-users@googlegroups.com  on
behalf of Yuval Bachrach 
*Sent:* Tuesday, January 15, 2019 5:31:18 PM
*To:* django-users@googlegroups.com
*Subject:* channnels -- communication with redis


I fail to have django channels

Issue with sharing messages in this forum

2019-01-16 Thread Yuval Bachrach
I I have submitted a question and got a response that included some
questions. I have tried to answer it (a reply with gmail to "
django-users@googlegroups.com": I have the message at sent item but it does
not show up at the forum.

I thought there might be an automated filter that I managed to hit so I
have rephrased the response but with no luck



This is the 2nd time it happens to me (This time the title is "channnels --
communication with redis" ).



What can cause it and how can I avoid it?



(I really appreciate the help of the group members but without being able
to respond, I am unable to get it)

-- 

Yuval B

-- 
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/CAD16PYSAKdY7psYyTBV1k27Z_tovKbdEMwZvaP4F2xmOG_J1OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: channnels -- communication with redis

2019-01-16 Thread Yuval Bachrach
(Tried to respond right after getting your response, however, I have my
message in "sent items" but nothing more... I wonder if there is a filter I
managed to hit having my response blocked... Si I will re-write:)

Thank you!

I have installed docker on my PC and I run it locally.
At setting.py I have:

CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
# "hosts": [('172.17.0.1', 6379)],
"hosts": [('127.0.0.1', 6379)],
},
},
}



   - I am running a windows os,
   - With docker installation I got a "Docker Quickstart Terminal". This
   terminal looks like a unix shell (So I am using unix commands inside this
   shell)
  - This configuration is the exact configuration that is described at
  the channels tutorial
  -  I run the docker commands in this shell (as you have seen)
  - As for "python manage.py shell" and running the set of commands
  causing the failure I have described: It happens both when I am
running the
  python shell at this Docker terminal or a normal windows CMD
   - I am running "Microsoft Windows 10 home" 64 bits. The fact that it is
   the "home" version can be part of the problem I have, however, while 64 bit
   support is required (docker), there is no limitation as for "home".
  -
 - I also think that it is likely that I have  a communication
 problem between the redis server running inside the docker
container and
 the client outside but I can't tell fore sure ( "It looks
network/local
 environment related rather than something redis/docker specific")
- As mentioned before, I see the problem also when running the
python shell from " Docker Quickstart Terminal"
- I have suspended   windows defender firewall" and executed
the commands inside the python shell again: I still have
the problem
- when trying to use runserver (instead of shell) and trying to
access the site via chrome I get an error message " Chat
socket closed
unexpectedly" – I assume it is a symptom of the same problem. (I
also get a warning “chrome.loadTimes() is deprecated, instead use
standardized API: nextHopProtocol in Navigation)”
- How can I check this communication? I would use telnet but I
am not sure how to use telenet to test the viability of
redis and the
connectivity to it






On Tue, Jan 15, 2019 at 7:32 PM Roger Gammans 
wrote:

>
> Hi Yuval
>
> Are you using docker machine ? If so the redis server is on the docker
> machine's IP not on the localhost so you would need to update the docker
> host in the CHANNEL_LAYERS portion of settings.py.
>
> You show a unix-like shell like for controlling docker; but the connect
> failed error looks very windowssy; so I'm not sure that the docker engine
> (daemon) and the python is running on the TCP stack (or kernel/VM) which
> you would need for the local host connection to work. Also it might be
> sensible to ensure the connection is being block by a local firewall if you
> have one.
>
> It looks network/local environment related rather than something
> redis/docker specific. The error show the TCP connection (which you can
> test with telnet if you have it install) not be made between python and the
> redis deamon the most likely reason for that is a local firewall or a more
> complex environment.
>
>
> --
>
> Roger Gammans 
> Gamma Science
>
>
> On Tue, 2019-01-15 at 18:49 +0200, Yuval Bachrach wrote:
>
> I did not configure anything, which is probably the problem..
> I am following the tutorial. I just did what the tutorial instructed to
> do: So I have installed docker as instructed but haven't configured
> anything. The tutorial calls installing docker and does not state any
> action to take after installing)
> as I am not familiar with docker, could not tell if there is a need to
> configure anything to make django channels work.  I still need to do
> whatever is required to make the tutorial work.Do I need to learn basics of
> docker first, or are there some simple things I can do to enable the
> environment and keep going with the channels tutorial?
>
> On Tue, Jan 15, 2019 at 6:38 PM PASCUAL Eric  wrote:
>
> Hi,
>
>
> How is configured your Docker stack exactly ? You should have several
> containers in it, at least one for the Redis server, another one for the
> Django app.
>
>
> Do you use docker-compose to run the stack ? If yes, could you provide the
> YAML descriptor of the stack ?
>
>
> Best
>
>
> Eric
>
>
> --
> *From:* django-users@googlegroups.com  on
> behalf of Yuval Bachrach 
> *Sent:* Tuesday, January 15, 2019 5:31:18 PM
> *To:* django-users@googlegroups.com
> *Subject:* channnels -- communication with redis
>
>
> I fail to have django channels communication with redis running at docker
> container: I am running the channe

Projects in django

2019-01-16 Thread Nitin Kumar
Hi,

I have an year of experience working in python and django.
I am looking for some projects in django for remote work.

Regards,
Nitin Kumar

-- 
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/CAKzNicG09bedgKaTxbuNKDUOkOn5MTueye4NsaQVFLEPCu7jUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.