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: New user

2021-11-02 Thread Gwanghyeon Gim
Hi, 

here are my recommendations for beginner.

Youtube: Corey M Schafer
Book: Django for Beginners by W. S. Vincent

Good luck.

On Tuesday, 2 November 2021 at 06:25:18 UTC+9 lanza...@gmail.com wrote:

> Hi, I want to learn Django, so if someone now the best way I appreciate.
>

-- 
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/b8ad4713-2e77-41ef-a6ce-fdfb0f2b8fa1n%40googlegroups.com.


Got an error creating the test databse - with mysql and docker-compose

2021-05-01 Thread Gwanghyeon Gim
Hi django developers!

I have an issue with creating test database. I use mysql for db and docker 
compose.

I have no problem running docker containers with docker-compose, but when I 
run test it spits this error message.

Note that the name of django service is web, and mysql service is db.

$ docker-compose run --rm web sh -c "python manage.py test"
Creating sociallogin_web_run ... done
Creating test database for alias 'default'...
Got an error creating the test database: (1044, "Access denied for user 
'myuser'@'%' to database 'test_mydb'")

my docker-compose file:
version: "3.9"

services:

db:
image: mysql:8
env_file:
- .env
command: 
- --default-authentication-plugin=mysql_native_password
restart: always
# ports:
# - "3306:3306"
# volumes:
# - data:/var/lib/mysql

web:
build: .
command: >
sh -c "python manage.py wait_for_db &&
python manage.py makemigrations && 
python manage.py migrate && 
python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- "8000:8000"
depends_on: 
- db
env_file:
- .env

# volumes:
# data:

my .env file looks like this:
MYSQL_ROOT_PASSWORD=rootpass
MYSQL_USER=exampleuser
MYSQL_PASSWORD=examplepass
MYSQL_DATABASE=exampledb
MYSQL_PORT=3306
SECRET_KEY=exmaple_random_characters


my settings for DATABASES

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('MYSQL_DATABASE'),
'USER': os.environ.get('MYSQL_USER'),
'PASSWORD': os.environ.get('MYSQL_PASSWORD'),
'PORT': os.environ.get('MYSQL_PORT'),
'HOST': 'db',
}
}

I looked at SO 
,
 
and I even tried this . It 
didn't help me. 

Anyone who's been stuck at similiar problem? 

Thanks guys 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3f7e3dc9-2c16-489e-9559-5899dc60dde1n%40googlegroups.com.