mysql 8 file creation issue

2022-03-17 Thread Aadil Rashid


When I run this query on mysql 5.7:
SELECT CURDATE() INTO OUTFILE '/var/lib/mysql-files/test.csv'; 

It creates test.csv with the following permissions:
-rw-rw-rw- 1 mysql mysql 11 Mar 18 04:27 test.csv 

But when I create the same file in mysql 8.0 it creates file with the 
following permissions:
-rw-r- 1 mysql mysql 11 Mar 18 09:54 test.csv 

How would I allow mysql 8 to create file with the same permissions it 
created with mysql 5.7 ? The reason being I need to read and write to that 
generated file later in my application.

-- 
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/5292768f-f3f4-4973-aea2-ecceb1cda299n%40googlegroups.com.


Re: Got an error creating the test database: database "" already exists

2022-03-17 Thread Salima Begum
Hi,
I am using django version 3.2.9 and Yes above you mentioned like that only
i am running migrations.
1. python manage.py makemigrations
2. python manage.py migrate
No, I am not using django build in user model. I am using my custom one.


a

On Thu, Mar 17, 2022 at 7:37 PM DJANGO DEVELOPER 
wrote:

> what version of Django are you using? and how did you make migrations?
> Should be like this:
> 1 - python manage.py makemigrations
> 2 - python manage.py migrate
> are you using custom user model? or django's built in User model?
>
> On Thu, Mar 17, 2022 at 3:42 PM Prashanth Patelc <
> prashanthpat...@gmail.com> wrote:
>
>> Check your settings.py once
>> Add auth_user='app.UserModel'
>>
>> Or
>> 1) delete database and migrations
>> 2) create new db
>> 3) python manage.py makemigration
>> 4) python manage.py migrate
>>
>>
>> On Thu, Mar 17, 2022, 9:35 AM Avinash Alanjakar <
>> avinashalanj...@gmail.com> wrote:
>>
>>>
>>> Their are lots of pre-bulit apps in django so you need to migrate them
>>> first.
>>> In your case you are using the authentication with migrating their
>>> tables with database.
>>>
>>> Try to run command in this sequence. This might be solve your problem.
>>>
>>>
>>> python manage.py migrate
>>>
>>> python manage.py makemigrations
>>>
>>> python manage.py migrate
>>>
>>>
>>> Thanks,
>>> Avinash
>>>
>>> On Thu, 17 Mar, 2022, 8:53 am Salima Begum, <
>>> salim...@rohteksolutions.com> wrote:
>>>
 Yes I run migrations still I am seeing the new issue below
 ```
 django.db.utils.ProgrammingError: relation "auth_user" does not exist
 ```
 Thank you
 ~Salima

 On Wed, Mar 16, 2022 at 9:23 PM DJANGO DEVELOPER <
 abubakarbr...@gmail.com> wrote:

> you need to run migrations first and then run the tests. if the issue
> still persists. let me know
>
> On Wed, Mar 16, 2022 at 2:15 PM Sebastian Jung <
> sebastian.ju...@gmail.com> wrote:
>
>> Hey salima,
>>
>> This error is strange. Django try to use a Relation in postgresql
>> which doesn't exist.
>>
>> I have only tip that you cam reset database. I would delete database
>> in postgresql and create it new with psql tool. After this you must reset
>> all migrations:
>>
>>
>> https://simpleisbetterthancomplex.com/tutorial/2016/07/26/how-to-reset-migrations.html
>>
>> And after this when you migrate it, then structure is created in new
>> database.
>>
>> I am sorry i have no idea how yoz can fix relation exception manual.
>>
>> Regards
>>
>>
>> Salima Begum  schrieb am Mi., 16. März
>> 2022, 06:51:
>>
>>> Hi all,
>>> After writing test cases I run test cases I am getting an error below
>>> ```
>>> Python manage.py behave
>>> ```
>>> After running the above command I am getting this error.
>>> ```
>>> Creating test database for alias 'default'...
>>> Got an error creating the test database: database "test_newDataBase"
>>> already exists
>>>
>>> Type 'yes' if you would like to try deleting the test database
>>> 'test_newDataBase', or 'no' to cancel: yes
>>> Destroying old test database for alias 'default'...
>>> Traceback (most recent call last):
>>>   File "C:\Users\USER
>>> 1\PycharmProjects\behaveproject\venv\lib\site-packages\django\db\backends\utils.py",
>>> line 86, in _execute
>>> return self.cursor.execute(sql, params)
>>> psycopg2.errors.UndefinedTable: relation "trades_trade_table" does
>>> not exist
>>> .
>>> .
>>> django.db.utils.ProgrammingError: relation "trades_vk_trade_table"
>>> does not exist
>>> ```
>>> Please help me to resolve this issue.
>>>
>>> Thank you
>>> ~Salima
>>>
>>> --
>>> 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/CAMSz6b%3DTEv%3DH25L7giQV6w%3DYw6%3D6GJrvh5zPezqQWMger3VNzQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAKGT9mx2sRizWo8Qd%3Dn6yYFKUB1KvjKH%2Bi92Hj_fdoStRYc%3DWg%40mail.gmail.com
>> 

Re: Got an error creating the test database: database "" already exists

2022-03-17 Thread DJANGO DEVELOPER
what version of Django are you using? and how did you make migrations?
Should be like this:
1 - python manage.py makemigrations
2 - python manage.py migrate
are you using custom user model? or django's built in User model?

On Thu, Mar 17, 2022 at 3:42 PM Prashanth Patelc 
wrote:

> Check your settings.py once
> Add auth_user='app.UserModel'
>
> Or
> 1) delete database and migrations
> 2) create new db
> 3) python manage.py makemigration
> 4) python manage.py migrate
>
>
> On Thu, Mar 17, 2022, 9:35 AM Avinash Alanjakar 
> wrote:
>
>>
>> Their are lots of pre-bulit apps in django so you need to migrate them
>> first.
>> In your case you are using the authentication with migrating their tables
>> with database.
>>
>> Try to run command in this sequence. This might be solve your problem.
>>
>>
>> python manage.py migrate
>>
>> python manage.py makemigrations
>>
>> python manage.py migrate
>>
>>
>> Thanks,
>> Avinash
>>
>> On Thu, 17 Mar, 2022, 8:53 am Salima Begum, 
>> wrote:
>>
>>> Yes I run migrations still I am seeing the new issue below
>>> ```
>>> django.db.utils.ProgrammingError: relation "auth_user" does not exist
>>> ```
>>> Thank you
>>> ~Salima
>>>
>>> On Wed, Mar 16, 2022 at 9:23 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
 you need to run migrations first and then run the tests. if the issue
 still persists. let me know

 On Wed, Mar 16, 2022 at 2:15 PM Sebastian Jung <
 sebastian.ju...@gmail.com> wrote:

> Hey salima,
>
> This error is strange. Django try to use a Relation in postgresql
> which doesn't exist.
>
> I have only tip that you cam reset database. I would delete database
> in postgresql and create it new with psql tool. After this you must reset
> all migrations:
>
>
> https://simpleisbetterthancomplex.com/tutorial/2016/07/26/how-to-reset-migrations.html
>
> And after this when you migrate it, then structure is created in new
> database.
>
> I am sorry i have no idea how yoz can fix relation exception manual.
>
> Regards
>
>
> Salima Begum  schrieb am Mi., 16. März
> 2022, 06:51:
>
>> Hi all,
>> After writing test cases I run test cases I am getting an error below
>> ```
>> Python manage.py behave
>> ```
>> After running the above command I am getting this error.
>> ```
>> Creating test database for alias 'default'...
>> Got an error creating the test database: database "test_newDataBase"
>> already exists
>>
>> Type 'yes' if you would like to try deleting the test database
>> 'test_newDataBase', or 'no' to cancel: yes
>> Destroying old test database for alias 'default'...
>> Traceback (most recent call last):
>>   File "C:\Users\USER
>> 1\PycharmProjects\behaveproject\venv\lib\site-packages\django\db\backends\utils.py",
>> line 86, in _execute
>> return self.cursor.execute(sql, params)
>> psycopg2.errors.UndefinedTable: relation "trades_trade_table" does
>> not exist
>> .
>> .
>> django.db.utils.ProgrammingError: relation "trades_vk_trade_table"
>> does not exist
>> ```
>> Please help me to resolve this issue.
>>
>> Thank you
>> ~Salima
>>
>> --
>> 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/CAMSz6b%3DTEv%3DH25L7giQV6w%3DYw6%3D6GJrvh5zPezqQWMger3VNzQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKGT9mx2sRizWo8Qd%3Dn6yYFKUB1KvjKH%2Bi92Hj_fdoStRYc%3DWg%40mail.gmail.com
> 
> .
>
 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAKPY9pkx0hJ3U_DFCia_UUY-ecieMJ0%2BE3uE75aTziehr1KWSg%40mail.gmail.com
 

Re: What methods are available to determining display type & screen dimensions for dynamic formatting of Django templates.

2022-03-17 Thread Jason
It does seem like you're looking for something related to analytics, ie 
Google Analytics or one of the alternatives.
On Thursday, March 17, 2022 at 5:52:14 AM UTC-4 Django2021 wrote:

> Increasingly we are finding the need to have reactive Django templates, in 
> order to present cross platform Django forms and pages to not only desktop 
> users buy also tablet, and mobile phone users.
>
> We realize Bootstrap offers breakpoints as a means to control columns, 
> still we are looking for more direct ways of getting essential display 
> information including width, height, device type, and OS for taking control 
> of our own breakpoints where further customization is needed.
>
> Is there a best practice, mature or fully cross platform method recognized 
> by Django users for gathering essential display information as required for 
> reactive Django templates?
>
> And if not what are the most promising techniques other than Bootstrap for 
> Django developers in use for building reactive templates?
>
>
>
>
>
>
>

-- 
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/f7866f28-5c99-427b-a1f6-a7802c3953a5n%40googlegroups.com.


Re: Got an error creating the test database: database "" already exists

2022-03-17 Thread Prashanth Patelc
Check your settings.py once
Add auth_user='app.UserModel'

Or
1) delete database and migrations
2) create new db
3) python manage.py makemigration
4) python manage.py migrate


On Thu, Mar 17, 2022, 9:35 AM Avinash Alanjakar 
wrote:

>
> Their are lots of pre-bulit apps in django so you need to migrate them
> first.
> In your case you are using the authentication with migrating their tables
> with database.
>
> Try to run command in this sequence. This might be solve your problem.
>
>
> python manage.py migrate
>
> python manage.py makemigrations
>
> python manage.py migrate
>
>
> Thanks,
> Avinash
>
> On Thu, 17 Mar, 2022, 8:53 am Salima Begum, 
> wrote:
>
>> Yes I run migrations still I am seeing the new issue below
>> ```
>> django.db.utils.ProgrammingError: relation "auth_user" does not exist
>> ```
>> Thank you
>> ~Salima
>>
>> On Wed, Mar 16, 2022 at 9:23 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> you need to run migrations first and then run the tests. if the issue
>>> still persists. let me know
>>>
>>> On Wed, Mar 16, 2022 at 2:15 PM Sebastian Jung <
>>> sebastian.ju...@gmail.com> wrote:
>>>
 Hey salima,

 This error is strange. Django try to use a Relation in postgresql which
 doesn't exist.

 I have only tip that you cam reset database. I would delete database in
 postgresql and create it new with psql tool. After this you must reset all
 migrations:


 https://simpleisbetterthancomplex.com/tutorial/2016/07/26/how-to-reset-migrations.html

 And after this when you migrate it, then structure is created in new
 database.

 I am sorry i have no idea how yoz can fix relation exception manual.

 Regards


 Salima Begum  schrieb am Mi., 16. März
 2022, 06:51:

> Hi all,
> After writing test cases I run test cases I am getting an error below
> ```
> Python manage.py behave
> ```
> After running the above command I am getting this error.
> ```
> Creating test database for alias 'default'...
> Got an error creating the test database: database "test_newDataBase"
> already exists
>
> Type 'yes' if you would like to try deleting the test database
> 'test_newDataBase', or 'no' to cancel: yes
> Destroying old test database for alias 'default'...
> Traceback (most recent call last):
>   File "C:\Users\USER
> 1\PycharmProjects\behaveproject\venv\lib\site-packages\django\db\backends\utils.py",
> line 86, in _execute
> return self.cursor.execute(sql, params)
> psycopg2.errors.UndefinedTable: relation "trades_trade_table" does not
> exist
> .
> .
> django.db.utils.ProgrammingError: relation "trades_vk_trade_table"
> does not exist
> ```
> Please help me to resolve this issue.
>
> Thank you
> ~Salima
>
> --
> 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/CAMSz6b%3DTEv%3DH25L7giQV6w%3DYw6%3D6GJrvh5zPezqQWMger3VNzQ%40mail.gmail.com
> 
> .
>
 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAKGT9mx2sRizWo8Qd%3Dn6yYFKUB1KvjKH%2Bi92Hj_fdoStRYc%3DWg%40mail.gmail.com
 
 .

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

What methods are available to determining display type & screen dimensions for dynamic formatting of Django templates.

2022-03-17 Thread Django2021
Increasingly we are finding the need to have reactive Django templates, in 
order to present cross platform Django forms and pages to not only desktop 
users buy also tablet, and mobile phone users.

We realize Bootstrap offers breakpoints as a means to control columns, 
still we are looking for more direct ways of getting essential display 
information including width, height, device type, and OS for taking control 
of our own breakpoints where further customization is needed.

Is there a best practice, mature or fully cross platform method recognized 
by Django users for gathering essential display information as required for 
reactive Django templates?

And if not what are the most promising techniques other than Bootstrap for 
Django developers in use for building reactive templates?






-- 
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/cd9dd5f6-9b0e-430b-b458-20c969abd3d7n%40googlegroups.com.


Re: How do detect if template is being viewed on mobile device?

2022-03-17 Thread Antonis Christofides

Inside of a Django function or template we need to know if to display
a landscape or portrait of a form - based on knowing if the viewer is
using a mobile or not.
Your requirement to know whether you are using "landscape or portrait" is 
unusual. Normally we are only interested in knowing the width of the screen. If 
the screen is wide enough, we show the wide version, without caring about what 
the height of the screen is (it could be a large screen in portrait, for example).


In any case, I think you can solve it with CSS (even if you really want to take 
the height of the screen into account). This problem has nothing to with Python 
and Django, it's merely a HTML+CSS issue. If you don't want to learn much CSS, 
using a CSS framework like Bootstrap can help.


Regards,

Antonis

Antonis Christofides



On 16/03/2022 22.42, Django2021 wrote:
> There are many ways to approach this problem, so it would be best to explain 
what you are trying to achieve.


Inside of a Django function or template we need to know if to display
a landscape or portrait of a form - based on knowing if the viewer is
using a mobile or not.
On Wednesday, March 16, 2022 at 9:34:09 PM UTC+1 Antonis Christofides wrote:

Hello,

there are many ways to approach this problem, so it would be best to
explain what you are trying to achieve.

Regards,

Antonis

Antonis Christofides
+30-6979924665(mobile)


On 16/03/2022 22.28, Django2021 wrote:


With Django how is it possible to detect
* if template is being viewed on mobile device?
and/or
* if template is being viewed in portrait or landscape mode?

Any suggestions appreciated.


-- 
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/7be1145e-662e-4d57-afa6-b9d178f7fb0fn%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/83a4a51d-6913-47ce-a5da-f49f4b3d72abn%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/0d0aa98d-7142-aceb-5bd8-31e41e705bac%40antonischristofides.com.


Re: Help : Embedding pdf in Django detailview

2022-03-17 Thread RANGA BHARATH JINKA
Hi,

Please try this.

https://stackoverflow.com/questions/11779246/how-to-show-a-pdf-file-in-a-django-view

On Thu, Mar 17, 2022 at 12:12 PM Dexterr Jay  wrote:

> Hello guys, I'm developing a job board, and I want to display uploaded
> files in job detailview without downloading the file.
> When job seakers open a posted job I want the uploaded file from employer
> to be rendered in web browser
>
> --
> 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/CAC32Mkjj-frMgLdc0_MY1_sBrN_MxV0DLPb3gXAY8%3DZ4oL%2BnXQ%40mail.gmail.com
> 
> .
>


-- 
Thanks and Regards

J. Ranga Bharath
cell: 9110334114

-- 
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/CAK5m315HHYbmF-tX67SjZh5SoXvS7dscwJbUfTsddynoJr2zjg%40mail.gmail.com.