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

2022-03-16 Thread Sebastian Jung
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-16 Thread DJANGO DEVELOPER
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 
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.


export to csv

2022-03-16 Thread divya murugulla
Hi All,

Can anyone help table data to be exported to excel code examples

-- 
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/0eb9aac4-1ab6-44ed-bab6-35a990030529n%40googlegroups.com.


Re: export to csv

2022-03-16 Thread Kasper Laudrup

On 16/03/2022 17.20, divya murugulla wrote:

Can anyone help table data to be exported to excel code examples



https://labpys.com/export-data-from-database-into-excel-using-django/

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/adfd3c4b-e4b9-b90c-8b16-a0cc51ce8eae%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


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

2022-03-16 Thread Django2021

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+unsubscr...@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.


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

2022-03-16 Thread Antonis Christofides

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+unsubscr...@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/66c9d4a1-b0c6-41fe-e09a-2bd6faa3a9ed%40antonischristofides.com.


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

2022-03-16 Thread Kasper Laudrup

On 16/03/2022 21.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.



https://www.w3.org/TR/css3-mediaqueries/

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/952102bf-55e9-1678-37f4-9eecdb14e389%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


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

2022-03-16 Thread Django2021
> 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 <+30%20697%20992%204665> (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.


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

2022-03-16 Thread Django2021
If only https://www.w3.org/TR/css3-mediaqueries/  had some practical 
examples in Python or Django, it could be useful.
On Wednesday, March 16, 2022 at 9:34:19 PM UTC+1 Kasper Laudrup wrote:

> On 16/03/2022 21.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.
> >
>
> https://www.w3.org/TR/css3-mediaqueries/
>
> 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/ce7d8581-56f3-4fef-b864-139c62db0f06n%40googlegroups.com.


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

2022-03-16 Thread Salima Begum
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 
> 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%3DZTCYy%2BY1NoRSh9t0S0UcLkwcSb_31SYqzOg95SU%2Bq6Q%40mail.gmail.com.


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

2022-03-16 Thread Avinash Alanjakar
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 
>> 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%3DZTCYy%2BY1NoRSh9t0S0UcLkwcSb_31SYqzOg95SU%2Bq6Q%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, se

Help : Embedding pdf in Django detailview

2022-03-16 Thread Dexterr Jay
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.