Re: translat using oscar framework

2022-01-05 Thread Julio Cojom
Hi,

You need to understand what are you doing,

Oscar documentation put it really simple.

First create a directory inside your project called i18n and locale

Then create a symbolic link to Oscar package so manage.py makemessages can
find translatable strings.

For the last step, you need to locate where Django Oscar is inside your
hard drive.

One simple way to find python directory is opening a PowerShell or cmd and
opening the python console.

import os
import sys
os.path.dirname(sys.executable)

That gives you the python executable files path.

After navigate to it, go to Lib->site-packages

There you will find all the libraries installed, including django-oscar

Once you have all the data, open a PowerShell or cmd and make the symbolic
link, in windows you can use a shortcut just using right click -> create a
shortcut, then renaming the shortcut and placing it where documentation
mention.

Last, run manage.py makemessages with the flags you need.

Remember, you're dealing with python not with Django as programming
language.

If you don't have idea of what I'm writing, start with a simpler project.

Regards

Julio Cojom


El mié., 5 de enero de 2022 3:14 p. m., frank lucky <
friendzone2...@gmail.com> escribió:

> hi thanks for you time i  use this
>
> mklink /d %PATH_TO_OSCAR/oscar
> but i get this error (oscar) PS C:\Users\faramarz\Desktop\uniqemug-os>
> mklink /d %PATH_TO_OSCAR/oscar
> mklink : The term 'mklink' is not recognized as the name of a cmdlet,
> function, script file, or operable program. Check the spelling of
> the name, or if a path was included, verify that the path is correct and
> try again.
> At line:1 char:1
> + mklink /d %PATH_TO_OSCAR/oscar
> + ~~
> + CategoryInfo  : ObjectNotFound: (mklink:String) [],
> CommandNotFoundException
> + FullyQualifiedErrorId : CommandNotFoundException
>
> On Tuesday, January 4, 2022 at 8:24:30 PM UTC+3:30 Kasper Laudrup wrote:
>
>> On 04/01/2022 09.50, frank lucky wrote:
>> >
>> > mkdir locale i18n
>> > ln -s $PATH_TO_OSCAR i18n/oscar
>> > ./manage.py makemessages --symlinks --locale=de
>> >
>> > how i do it in windows  i make  local and i18n forlder in root of
>> > peoject but
>> > secound line not working
>> >
>>
>> First of all, it is much easier for someone to help you if you describe
>> the errors you are getting instead of simply writing "not working" and
>> expect people to guess what that might mean.
>>
>> It is quite easy to see the issues with that line. In Windows
>> environment variables, at least in cmd.exe, are accessed with % instead
>> of $ so you need to change that to %PATH_TO_OSCAR. Of course, that
>> assumes that you actually have that variable in your environment somehow.
>>
>> Also, Windows hasn't support symbolic links historically but since
>> Windows 2000 or so it should be possible to use the "mklink" command
>> instead of the "ln" Unix command:
>>
>>
>> https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink
>>
>> Not sure it will work though and in general I would really recommend
>> using pretty much anything other than Windows. It will save you from
>> tons and tons of frustrations.
>>
>> Kind regards.
>>
>> Kasper Laudrup
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4a80758e-d6e9-4c4a-a4fc-043e31cb2c6cn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHRQUHnmbB-c_EDMdmobKi1c8syXhAb0i0%3DE1iu_fgffprRXyA%40mail.gmail.com.


Re: translat using oscar framework

2022-01-05 Thread frank lucky
hi thanks for you time i  use this 

mklink /d %PATH_TO_OSCAR/oscar
but i get this error (oscar) PS C:\Users\faramarz\Desktop\uniqemug-os> 
mklink /d %PATH_TO_OSCAR/oscar
mklink : The term 'mklink' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of 
the name, or if a path was included, verify that the path is correct and 
try again.
At line:1 char:1
+ mklink /d %PATH_TO_OSCAR/oscar
+ ~~
+ CategoryInfo  : ObjectNotFound: (mklink:String) [], 
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

On Tuesday, January 4, 2022 at 8:24:30 PM UTC+3:30 Kasper Laudrup wrote:

> On 04/01/2022 09.50, frank lucky wrote:
> > 
> > mkdir locale i18n
> > ln -s $PATH_TO_OSCAR i18n/oscar
> > ./manage.py makemessages --symlinks --locale=de
> > 
> > how i do it in windows  i make  local and i18n forlder in root of 
> > peoject but
> > secound line not working
> > 
>
> First of all, it is much easier for someone to help you if you describe 
> the errors you are getting instead of simply writing "not working" and 
> expect people to guess what that might mean.
>
> It is quite easy to see the issues with that line. In Windows 
> environment variables, at least in cmd.exe, are accessed with % instead 
> of $ so you need to change that to %PATH_TO_OSCAR. Of course, that 
> assumes that you actually have that variable in your environment somehow.
>
> Also, Windows hasn't support symbolic links historically but since 
> Windows 2000 or so it should be possible to use the "mklink" command 
> instead of the "ln" Unix command:
>
>
> https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink
>
> Not sure it will work though and in general I would really recommend 
> using pretty much anything other than Windows. It will save you from 
> tons and tons of frustrations.
>
> Kind regards.
>
> Kasper Laudrup
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4a80758e-d6e9-4c4a-a4fc-043e31cb2c6cn%40googlegroups.com.


Re: sending mails

2022-01-05 Thread Kasper Laudrup

On 05/01/2022 14.16, Rey Ondiyo wrote:

Hello
i'm sending mails, I use a mail configured via cpanel, in my django 
application but i have this mistake


ConnectionRefusedError at / register
[WinError 10061] No connection could be made because the target computer 
expressly refused it




I have no problem connecting to mail.toto.net on port 465 so I suggest 
you start by disabling any software firewalls or whatever similar crap 
you might have installed.


No idea what it means to have your mail configured via cpanel though.

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ecb71666-fb69-832b-91cc-c6c5feaa56d9%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: send an invite to the user

2022-01-05 Thread Kasper Laudrup

On 05/01/2022 07.18, Kakasaheb Jumbad wrote:

how to invite the user to accept and reject the invition via email



The same way as you'd get the user to reject and accept the invitation, 
only the other way around. Quite simple actually.


Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/21f2055d-a85a-6a46-77f2-e3352b847712%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: HTTPS on development enviroment

2022-01-05 Thread Roger Gammans
On Wed, 2022-01-05 at 06:36 -0800, Gwanghyeon Gim wrote:
> Can this help? https://stackoverflow.com/a/28933593/1179076
> Some browsers might keep you from even entering due to strict
> security, so try different browers if that's the case i.e firefox.
> 
> On Saturday, 1 January 2022 at 09:12:10 UTC+9 nassibs...@gmail.com
> wrote:
> > I have started using Django and I wanted to integrate social
> > authentication with Google so i had to create self certificates
> > using django_extensions so i test the the authentication with https
> > but when i open localhost it keeps loading without showing the
> > results
> 
> 

You might find mkcert ( https://github.com/FiloSottile/mkcert ), and
easier and potentially safer way to create and managetemporary
developer certs. 
obDNA: Certainly better than all that tedious mucking around with
openssl.-- Roger Gammans 
Gamma Science (Reg Nr: 07356014)


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e9c08a05ac6f58e87d44876d55d62ef6a63db6ba.camel%40gammascience.co.uk.


Re: HTTPS on development enviroment

2022-01-05 Thread Gwanghyeon Gim
Can this help? https://stackoverflow.com/a/28933593/1179076

Some browsers might keep you from even entering due to strict security, so 
try different browers if that's the case i.e firefox.

On Saturday, 1 January 2022 at 09:12:10 UTC+9 nassibs...@gmail.com wrote:

> I have started using Django and I wanted to integrate social 
> authentication with Google so i had to create self certificates using 
> django_extensions so i test the the authentication with https but when i 
> open localhost it keeps loading without showing the results
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dc86564a-30cb-4cbe-92fb-57309fa34d26n%40googlegroups.com.


Re: Employee matching query does not exist

2022-01-05 Thread Gwanghyeon Gim
Two possible scenarios.

1. self.request.POST doesn't have any key named 'employee_id', so 
self.request.POST.get('employee_id') returns None
2. self.request.POST.get('employee_id') has value like 'Sam', but Employee 
model doesn't have any object whose name equals to 
self.request.POST.get('employee_id').

On Wednesday, 5 January 2022 at 22:53:30 UTC+9 reyo...@gmail.com wrote:

> Django don't saw a employe who have this ID
>  so you can use filter if there's not matching in your database he return 
> [ ]. 
>
> obj.employee= 
> Employee.objects.filter(name=self.request.POST.get('employee_id'))
>
> Le mardi 4 janvier 2022 à 15:44:55 UTC+1, jitendra...@gmail.com a écrit :
>
>> name column row's data not matching from database
>>
>> Show that you are getting error .
>>
>>
>> So we use the Expection then you can easily handle the error ..
>>
>> On Tue, 4 Jan 2022, 8:05 pm yassin kamanyile,  wrote:
>>
>>> please team ..i  got an error from that line below
>>>
>>> obj.employee = Employee.objects.get(name=self.request.POST.get(
>>> 'employee_id'))
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/0d469b11-33f5-49bb-a984-76f53a2e08c8n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a458eed7-ace9-4ff7-9d41-dbf679389144n%40googlegroups.com.


Re: Employee matching query does not exist

2022-01-05 Thread Julio Cojom
Hi,

Try the following.

employee =self.request.POST.get('employee_id')
print(employee)
obj.employee= Employee.objects.filter(name=employee)

It will crash again, but you can see in the console if it's printing the id
correctly.

I've assume this is a function, not a class view by the way that you are
handling the query set. And I believe with the poor information that you
give us, that the 'employee_id' isn't the right keyword to get the value
desired.

Usually you can use the name in your models to refer to the field that you
want the data. If you want the primary key, you should use pk of an
existing record in the database.

Also you can print self.request.POST to see all the data that I has, that
is a dictionary so you can see they keyword you need and the data in brings.

Regards.

Julio Cojom.






El mié., 5 de enero de 2022 7:53 a. m., Rey Ondiyo 
escribió:

> Django don't saw a employe who have this ID
>  so you can use filter if there's not matching in your database he return
> [ ].
>
> obj.employee=
> Employee.objects.filter(name=self.request.POST.get('employee_id'))
>
> Le mardi 4 janvier 2022 à 15:44:55 UTC+1, jitendra...@gmail.com a écrit :
>
>> name column row's data not matching from database
>>
>> Show that you are getting error .
>>
>>
>> So we use the Expection then you can easily handle the error ..
>>
>> On Tue, 4 Jan 2022, 8:05 pm yassin kamanyile,  wrote:
>>
>>> please team ..i  got an error from that line below
>>>
>>> obj.employee = Employee.objects.get(name=self.request.POST.get(
>>> 'employee_id'))
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/0d469b11-33f5-49bb-a984-76f53a2e08c8n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7e08fe8e-bd4e-4779-be29-79d5453ea116n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHRQUH%3D_46u4BugGaX4qaLTOCjsfQA830a6wES8tWFOrALMv_Q%40mail.gmail.com.


Re: send an invite to the user

2022-01-05 Thread Kris Stern
Hi Kakasaheb,

I think for a reference for what is possible with a generic invitation app,
though by no means am I endorsing this particular package in particular,
please see https://github.com/bee-keeper/django-invitations. I think this
gives you an idea about what could be achievable using existing code or to
adapt something similar for your own design or purposes. You should
customize the emails and messages that come with the package at least for
example.

Hope this helps!

Cheers,
Kris

On Wed, Jan 5, 2022 at 9:53 PM Kakasaheb Jumbad <
jumbadkakasaheb...@gmail.com> wrote:

> how to invite the user to accept and reject the invition via email
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ab10f90e-c406-400e-a7a5-89530ab67c51n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPi5uQpUxaWUJwMunpHQM46i6%2BvTd5%2B4feHBxSJBRcpp%3Dzpjew%40mail.gmail.com.


sending mails

2022-01-05 Thread Rey Ondiyo
Hello
i'm sending mails, I use a mail configured via cpanel, in my django 
application but i have this mistake 

ConnectionRefusedError at / register
[WinError 10061] No connection could be made because the target computer 
expressly refused it

My settings.py files

EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'mail.toto.net'
EMAIL_HOST_USER = 'i...@toto.net'
EMAIL_HOST_PASSWORD = '***'
EMAIL_PORT = 465

My views.py files is like this :

message=str(randint(00, 99))


emailSend = EmailMessage('CODE DE VALIDATION', message, to=[email])
emailSend.send()
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/074e0309-2690-42af-a721-816c04e4d1d1n%40googlegroups.com.


send an invite to the user

2022-01-05 Thread Kakasaheb Jumbad
how to invite the user to accept and reject the invition via email 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ab10f90e-c406-400e-a7a5-89530ab67c51n%40googlegroups.com.


Re: Employee matching query does not exist

2022-01-05 Thread Rey Ondiyo
Django don't saw a employe who have this ID
 so you can use filter if there's not matching in your database he return [ 
]. 

obj.employee= 
Employee.objects.filter(name=self.request.POST.get('employee_id'))

Le mardi 4 janvier 2022 à 15:44:55 UTC+1, jitendra...@gmail.com a écrit :

> name column row's data not matching from database
>
> Show that you are getting error .
>
>
> So we use the Expection then you can easily handle the error ..
>
> On Tue, 4 Jan 2022, 8:05 pm yassin kamanyile,  wrote:
>
>> please team ..i  got an error from that line below
>>
>> obj.employee = Employee.objects.get(name=self.request.POST.get(
>> 'employee_id'))
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0d469b11-33f5-49bb-a984-76f53a2e08c8n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e08fe8e-bd4e-4779-be29-79d5453ea116n%40googlegroups.com.