Re: django.db.utils.ProgrammingError: relation "django_content_type" already exists

2019-12-07 Thread Ram
Hi,

As a next step I tried the following but the result is is same. Please let
me know if you have any clue on this?

1. Deleted/Dropped 'django_content_type' table from database
2. I upgraded Django to version 3.0 from 2.2.7 in my virtual environment
and ran the following commands

1. $ python manage.py migrate --fake
2. $ python manage.py migrate --fake--initial
3. $ python manage.py migrate

But I still see same error
django.db.utils.ProgrammingError: relation "django_content_type" does not
exist
LINE 1: ..."."app_label", "django_content_type"."model" FROM "django_co...

On Wed, Dec 4, 2019 at 3:41 PM Ram  wrote:

> Hello Naveen,
>
> I already tried that before posting my last update but the result is the
> same though. Here I'm pasting the result. This is a total blocker to me. I
> appreciate if someone can unblock me.
>
> $ python manage.py migrate --fake-initial
>> Operations to perform:
>>   Apply all migrations: admin, auth, contenttypes, pages, sessions
>> Running migrations:
>>   Applying contenttypes.0002_remove_content_type_name...Traceback (most
>> recent call last):
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/backends/utils.py",
>> line 84, in _execute
>> return self.cursor.execute(sql, params)
>> psycopg2.errors.UndefinedColumn: column "name" of relation
>> "django_content_type" does not exist
>>
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 21, in 
>> main()
>>   File "manage.py", line 17, in main
>> execute_from_command_line(sys.argv)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/core/management/__init__.py",
>> line 381, in execute_from_command_line
>> utility.execute()
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/core/management/__init__.py",
>> line 375, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/core/management/base.py",
>> line 323, in run_from_argv
>> self.execute(*args, **cmd_options)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/core/management/base.py",
>> line 364, in execute
>> output = self.handle(*args, **options)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/core/management/base.py",
>> line 83, in wrapped
>> res = handle_func(*args, **kwargs)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
>> line 234, in handle
>> fake_initial=fake_initial,
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/migrations/executor.py",
>> line 117, in migrate
>> state = self._migrate_all_forwards(state, plan, full_plan, fake=fake,
>> fake_initial=fake_initial)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/migrations/executor.py",
>> line 147, in _migrate_all_forwards
>> state = self.apply_migration(state, migration, fake=fake,
>> fake_initial=fake_initial)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/migrations/executor.py",
>> line 245, in apply_migration
>> state = migration.apply(state, schema_editor)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/migrations/migration.py",
>> line 124, in apply
>> operation.database_forwards(self.app_label, schema_editor, old_state,
>> project_state)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/migrations/operations/fields.py",
>> line 249, in database_forwards
>> schema_editor.alter_field(from_model, from_field, to_field)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/backends/base/schema.py",
>> line 535, in alter_field
>> old_db_params, new_db_params, strict)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/backends/postgresql/schema.py",
>> line 124, in _alter_field
>> new_db_params, strict,
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/backends/base/schema.py",
>> line 685, in _alter_field
>> params,
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/backends/base/schema.py",
>> line 137, in execute
>> cursor.execute(sql, params)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/backends/utils.py",
>> line 99, in execute
>> return super().execute(sql, params)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/backends/utils.py",
>> line 67, in execute
>> return self._execute_with_wrappers(sql, params, many=False,
>> executor=self._execute)
>>   File
>> "/home/shami/vkproject/vkenv/lib/python3.6/site-packages/django/db/backends/utils.py",
>> line 76, in _execute_with_wrappers
>> return executor(sql, 

Re: Ayuda como pasar un sql al ORM Django

2019-12-07 Thread Joalbert Palacios
Hola, por fa revisa lo referente a queryset.

Cuando creas un modelo puedes hacer los queries sin necesidad de usar SQL.

Si necesitas más detalles por fa envíame la estructura de las tablas y te
ayudo con un ejemplo ilustrativo, pero te comento que la documentación de
Django está bastante buena en lo referente a modelos.

Espero sea de ayuda.

Un saludo,
Joalbert

On Sat, Dec 7, 2019, 6:58 PM DEYMER DE JESUS HOYOS PEREZ <
ddhoy...@misena.edu.co> wrote:

> Me gustaría saber como puedo pasar esta consulta de postgresql usando el
> orm de django
>
> SELECT  peluqueria_persona."Nombre", "GananciaEmpleado" From venta_venta
> INNER JOIN cita_cita ON  cita_cita.id = "Cita_id"
> INNER JOIN peluqueria_empleado  ON cita_cita.id = "Empleado_id"
> INNER JOIN peluqueria_persona  ON "Contacto_id" = peluqueria_persona.id ;
>
> gracias..
>
>
>
> *Declinación de Responsabilidades:* Los servicios de MISENA son
> soportados tecnológicamente por © Google y ofrecidos por el Servicio
> Nacional de Aprendizaje – SENA de manera gratuita a los aprendices e
> instructores de programas de formación titulada, las opiniones que contenga
> este mensaje son exclusivas de su autor y no representan la opinión del
> Servicio Nacional de Aprendizaje o de sus autoridades. El receptor deberá
> verificar posibles virus informáticos que tenga el correo o cualquier
> anexo, razón por la cual el SENA no es responsable de los daños causados
> por cualquier virus transmitido en este correo electrónico.
>
> Los contenidos, textos, imágenes, archivos enviados en este mensaje son
> responsabilidad exclusiva del remitente y no reflejan ni comprometen de
> ninguna manera a la institución. No se autoriza el uso de esta herramienta
> para el intercambio de correos masivos, cadenas o spam, ni de mensajes
> ofensivos, de carácter político, sexual o religioso, con fines de lucro,
> con propósitos delictivos o cualquier otro mensaje que se considere
> indebido o que vaya en contra de la Ley.
>
> --
> 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/2d6faf86-b14b-44fd-8cdd-b7191d1e0b5a%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/CAEtK16FuL0LZ40hv40KYpJgTscL2xPWZxDMBtHV_af3hT3fGqw%40mail.gmail.com.


Ayuda como pasar un sql al ORM Django

2019-12-07 Thread DEYMER DE JESUS HOYOS PEREZ
Me gustaría saber como puedo pasar esta consulta de postgresql usando el 
orm de django 

SELECT  peluqueria_persona."Nombre", "GananciaEmpleado" From venta_venta  
INNER JOIN cita_cita ON  cita_cita.id = "Cita_id" 
INNER JOIN peluqueria_empleado  ON cita_cita.id = "Empleado_id"  
INNER JOIN peluqueria_persona  ON "Contacto_id" = peluqueria_persona.id ;

gracias..

-- 




*
*

*
*

*Declinación de Responsabilidades:* Los servicios de MISENA 
son soportados tecnológicamente por © Google y ofrecidos por el Servicio 
Nacional de Aprendizaje – SENA de manera gratuita a los aprendices e 
instructores de programas de formación titulada, las opiniones que contenga 
este mensaje son exclusivas de su autor y no representan la opinión del 
Servicio Nacional de Aprendizaje o de sus autoridades. El receptor deberá 
verificar posibles virus informáticos que tenga el correo o cualquier 
anexo, razón por la cual el SENA no es responsable de los daños causados 
por cualquier virus transmitido en este correo electrónico.

Los 
contenidos, textos, imágenes, archivos enviados en este mensaje son 
responsabilidad exclusiva del remitente y no reflejan ni comprometen de 
ninguna manera a la institución. No se autoriza el uso de esta herramienta 
para el intercambio de correos masivos, cadenas o spam, ni de mensajes 
ofensivos, de carácter político, sexual o religioso, con fines de lucro, 
con propósitos delictivos o cualquier otro mensaje que se considere 
indebido o que vaya en contra de la Ley.

-- 
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/2d6faf86-b14b-44fd-8cdd-b7191d1e0b5a%40googlegroups.com.


Postgres database users and roles for DJango App

2019-12-07 Thread Ram
Hi,

I'm looking for steps for configuring Postgres database user and roles for
DJango production app.

One additional question that I've is every document that I referred so far
describes about 'PUBLIC' schema only. I'm not sure whether this is
production App setting?

I appreciate if someone can provide me right direction in this area?

Thanks,
~Ram

-- 
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/CA%2BOi5F2SFtx3U%2BPH5V1RvZ8Z0OQdNWvUfkpShbE1%2B8CB87%3DPcg%40mail.gmail.com.


Re: ''workon' is not recognized as an internal or external command, operable program or batch file'

2019-12-07 Thread Integr@te System
Hi,

I have homeless, without meal, non friend, unfamily.
Do you want asking me from hiring!?

Just jokes j.
Regards.

On Sun, Dec 8, 2019, 00:47 Dvs Khamele  wrote:

> Hi do you hire contract based python/django freelancer?
>  I can help you in this
> Best Regards,
> Divyesh Khamele
>
> On Sat, 7 Dec 2019 at 20:18, Khaleel Ahmed H. M. Shariff <
> khaleelahme...@gmail.com> wrote:
>
>> Hi Hima,
>> May Peace, Blessings & Mercy of Almighty God be on you!
>> workon is a module. do a *pip install workon*
>>
>> If you still get the same message. You could execute *python -m workon
>> test*
>>
>>
>> Hope this helps
>> Best of Luck.
>>
>>
>> God Bless You!
>> God Bless India!!
>> --
>>
>> Love & Regards
>> Dr. Khaleel Ahmed H. M.
>>
>> Managing Director, Tanzanite Realty India Private Limited
>>
>> ---
>>
>> Human Life is Precious
>> Koran Surah Ma'idah Chapter 5 Verse 32:
>> If anyone killed a person, not in retaliation of murder, or (and) to
>> spread mischief in the land - it would be as if he killed all mankind, & if
>> anyone saved a life, it would be as if he saved the life of all mankind.
>>
>>
>> On Sat, Dec 7, 2019 at 6:58 PM Hima Bindu chowdary 
>> wrote:
>>
>>> I am trying to get into virtual environment in vscode but get the below
>>> error ..
>>>
>>> C:\Users\User\projects\telusko>workon test
>>> 'workon' is not recognized as an internal or external command,
>>> operable program or batch file.
>>>
>>> did some research..implemented some things suggested
>>> 1.The python extension 'pylint' in vscode was installed.
>>> 2.The python interpreter is chosen.
>>> Do we need to make changes to path? please suggest..
>>>
>>> --
>>> 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/9ab0fe68-7e7f-4a99-b66c-09e06f7f13e4%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/CAMjBbiA-qW%2BvHMapMk%3Ds2A_hUDgSzX7ngukng3fT%3Dw1VvWiHsA%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/CAH9mneXYJGaJJLP3r2RGL2ki8y_9i%3DzVws6AC%3DqbYd9%2BH%3DyOqw%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/CAP5HUWpXxLvvqrNhgk9v6OSiepYaRgKJwC_wOCUShW8kwi_ouQ%40mail.gmail.com.


Re: Sending XML data from Django to another server (SAP)

2019-12-07 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
 I can help you in this and related tasks
Best Regards,
Divyesh Khamele

On Sat, 7 Dec 2019 at 19:51, Pema Galey  wrote:

> Hi All,
> Someone recommend in sending the *data from Django server to SAP server
> which interprets in XML format.*
>
>
> Thank you
>
> --
> 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/8e4e2355-bb3b-4695-9770-a18c20249fd0%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/CAH9mneVb0Hve4q9QoxxuvA8fmOZcy%2B35JrL7fg6fSOmx-WnzxA%40mail.gmail.com.


Re: ''workon' is not recognized as an internal or external command, operable program or batch file'

2019-12-07 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
 I can help you in this
Best Regards,
Divyesh Khamele

On Sat, 7 Dec 2019 at 20:18, Khaleel Ahmed H. M. Shariff <
khaleelahme...@gmail.com> wrote:

> Hi Hima,
> May Peace, Blessings & Mercy of Almighty God be on you!
> workon is a module. do a *pip install workon*
>
> If you still get the same message. You could execute *python -m workon
> test*
>
>
> Hope this helps
> Best of Luck.
>
>
> God Bless You!
> God Bless India!!
> --
>
> Love & Regards
> Dr. Khaleel Ahmed H. M.
>
> Managing Director, Tanzanite Realty India Private Limited
>
> ---
>
> Human Life is Precious
> Koran Surah Ma'idah Chapter 5 Verse 32:
> If anyone killed a person, not in retaliation of murder, or (and) to
> spread mischief in the land - it would be as if he killed all mankind, & if
> anyone saved a life, it would be as if he saved the life of all mankind.
>
>
> On Sat, Dec 7, 2019 at 6:58 PM Hima Bindu chowdary 
> wrote:
>
>> I am trying to get into virtual environment in vscode but get the below
>> error ..
>>
>> C:\Users\User\projects\telusko>workon test
>> 'workon' is not recognized as an internal or external command,
>> operable program or batch file.
>>
>> did some research..implemented some things suggested
>> 1.The python extension 'pylint' in vscode was installed.
>> 2.The python interpreter is chosen.
>> Do we need to make changes to path? please suggest..
>>
>> --
>> 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/9ab0fe68-7e7f-4a99-b66c-09e06f7f13e4%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/CAMjBbiA-qW%2BvHMapMk%3Ds2A_hUDgSzX7ngukng3fT%3Dw1VvWiHsA%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/CAH9mneXYJGaJJLP3r2RGL2ki8y_9i%3DzVws6AC%3DqbYd9%2BH%3DyOqw%40mail.gmail.com.


Re: Where to set the DATABASE_URL environment variable on Heroku

2019-12-07 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
 I can help you in this
Best Regards,
Divyesh Khamele

On Sat, 7 Dec 2019 at 21:53, Tim Johnson  wrote:

>
> On 12/6/19 9:09 PM, Jorge Gimeno wrote:
>
>
> On Fri, Dec 6, 2019 at 5:40 PM Tim Johnson  wrote:
>
>> Despite the voluminous Heroku documentation I am unable to establish
>> where to initialize the DATABASE_URL that would establish credentials
>> for my deployed database.
>>
>> Heroku's documentation uses the following example
>>
>> DATABASE_URL=$(heroku config:get HEROKU_POSTGRESQL_TIMS_URL -a timsapp)
>>
>> But I am not clear where this initialization code should live
>>
>> would it be in the procfile? If so, what process should I use. Release?
>> Worker?
>>
>> OR
>>
>> Would it be in an .env file?
>> ... snip ...
>>
> I believe DATABASE_URL is set on Heroku itself as a configuration
> variable.  If you provision the database in Heroku, it will be set for
> you.  See here:
> https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-heroku-postgres
>
> Thank you Jorge, I have read that section too:
>
> The following is highlighted as a warning on that:
>
> """
>
> The value of your app’s DATABASE_URL config var might change at any time.
>
> You should not rely on this value either inside or outside your Heroku app.
>
> """
>
> that is precisely why I have asked this question.
>
> more discussion of this issue is found at
> https://devcenter.heroku.com/articles/connecting-to-heroku-postgres-databases-from-outside-of-heroku
>
> and a search for "DATABASE_URL=$("  will give an example of how to set
> DATABASE_URL from the Heroku command line.
>
> That approach begs for a script but I am unsure of what script file to
> use. .env or Procfile or some other.
>
> Thanks again Jorge
>
> --
> Timtj49.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/14cf27a4-eb56-5925-fcf8-50ca3344f9e8%40akwebsoft.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/CAH9mneXrpBWTKUQpNNvQNrRkuh0q9tKbLC18kvVCEUFpXzcuCw%40mail.gmail.com.


Re: Django DEBUG magic, and a bizarre bug under django-extra-views

2019-12-07 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
 I can help you in this
Best Regards,
Divyesh Khamele

On Sat, 7 Dec 2019 at 04:38, Alaina Rowe  wrote:

> I have not been able to reproduce the bug I am about to describe when
> DEBUG is True, whether in production on Apache or locally on the Django dev
> server. So my first question is: What is all the magic that Django DEBUG
> does behind the scenes? The documentation doesn't have very much
> information about this.
>
> Now for the bug. I understand that the following description is too
> bare-bones for anyone to reproduce, but I have IP to protect, and I don't
> have much hope of the error being reproduced anyway.
>
> Suppose I have a Django project with at least two apps, app alice with
> model A and app bob with model B.
>
> I am using UpdateWithInlinesView from django-extra-views. The error occurs
> when this view constructs a formset from instances of model A. In my email
> about the 500, I get a message like this:
>
> FieldError at /some/url/
> Cannot resolve keyword 'field_of_A' into field. Choices are: field_of_B_1,
> field_of_B_2, field_of_B_3
>
> I've gotten this type of error before. It normally happens when you tell a
> form "I'm using model C" and "I'm using a field called debbie" and model C
> doesn't have a field called debbie. That part makes sense. But this error
> makes it look like it's checking against the field names of model B when it
> should be checking model A. I have been racking my brain trying to figure
> out how in the world the construction of a form from one model would
> consult a different model from a different app.
>
> Furthermore, this doesn't happen most of the time, it goes away on server
> restart, and it doesn't happen under DEBUG = True. So I'm wondering if it's
> an app registry issue, some sort of race condition that gets the registry
> out of whack. If so, then I might get somewhere by either understanding the
> app registry better or understanding what DEBUG does.
>
> Any thoughts?
>
> --
> 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/8d9d6399-e8ee-488f-8f81-b1a6fcd2c9ec%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/CAH9mneUeaLfrj2HEwr4XBj%2Bei6KaEhrtiMezx9NFi1PW6TqCag%40mail.gmail.com.


Re: Django DEBUG magic, and a bizarre bug under django-extra-views

2019-12-07 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
 I can help you in this
Best Regards,
Divyesh Khamele

On Sat, 7 Dec 2019 at 23:13, Integr@te System 
wrote:

> Hi issuer,
>
> Plz look at model built by UpdateWithInlinesView
> to see if you mistake from limit of string return from get_absolute_url()
>
> https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#createwithinlinesview-and-updatewithinlinesview
>
> https://docs.djangoproject.com/en/2.2/ref/models/instances/
>
> must contain ASCII RFC2396 section 2
>
> On Sat, Dec 7, 2019, 20:27 Daniel Chimeno  wrote:
>
>> +1 to more document about DEBUG magic.
>>
>>
>> El sábado, 7 de diciembre de 2019, 0:08:41 (UTC+1), Alaina Rowe escribió:
>>>
>>> I have not been able to reproduce the bug I am about to describe when
>>> DEBUG is True, whether in production on Apache or locally on the Django dev
>>> server. So my first question is: What is all the magic that Django DEBUG
>>> does behind the scenes? The documentation doesn't have very much
>>> information about this.
>>>
>>> Now for the bug. I understand that the following description is too
>>> bare-bones for anyone to reproduce, but I have IP to protect, and I don't
>>> have much hope of the error being reproduced anyway.
>>>
>>> Suppose I have a Django project with at least two apps, app alice with
>>> model A and app bob with model B.
>>>
>>> I am using UpdateWithInlinesView from django-extra-views. The error
>>> occurs when this view constructs a formset from instances of model A. In my
>>> email about the 500, I get a message like this:
>>>
>>> FieldError at /some/url/
>>> Cannot resolve keyword 'field_of_A' into field. Choices are:
>>> field_of_B_1, field_of_B_2, field_of_B_3
>>>
>>> I've gotten this type of error before. It normally happens when you tell
>>> a form "I'm using model C" and "I'm using a field called debbie" and model
>>> C doesn't have a field called debbie. That part makes sense. But this error
>>> makes it look like it's checking against the field names of model B when it
>>> should be checking model A. I have been racking my brain trying to figure
>>> out how in the world the construction of a form from one model would
>>> consult a different model from a different app.
>>>
>>> Furthermore, this doesn't happen most of the time, it goes away on
>>> server restart, and it doesn't happen under DEBUG = True. So I'm wondering
>>> if it's an app registry issue, some sort of race condition that gets the
>>> registry out of whack. If so, then I might get somewhere by either
>>> understanding the app registry better or understanding what DEBUG does.
>>>
>>> Any thoughts?
>>>
>> --
>> 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/fb61e2e6-001b-407c-b966-a3c1dc203a59%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/CAP5HUWpryMyyy5xji4NtgYUAZg0NYu1mpRt_LAqfdhtCy8xO8w%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/CAH9mneUDBPr7TpvD0KVJf3mUa0hQCPnEwM%3DtUKQEp941KC_-8Q%40mail.gmail.com.


Re: Django DEBUG magic, and a bizarre bug under django-extra-views

2019-12-07 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer?
 I can help you in this
Best Regards,
Divyesh Khamele

On Sat, 7 Dec 2019 at 23:15, Dvs Khamele  wrote:

> Hi do you hire contract based python/django freelancer?
>  I can help you in this
> Best Regards,
> Divyesh Khamele
>
> On Sat, 7 Dec 2019 at 23:13, Integr@te System 
> wrote:
>
>> Hi issuer,
>>
>> Plz look at model built by UpdateWithInlinesView
>> to see if you mistake from limit of string return from get_absolute_url()
>>
>> https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#createwithinlinesview-and-updatewithinlinesview
>>
>> https://docs.djangoproject.com/en/2.2/ref/models/instances/
>>
>> must contain ASCII RFC2396 section 2
>>
>> On Sat, Dec 7, 2019, 20:27 Daniel Chimeno  wrote:
>>
>>> +1 to more document about DEBUG magic.
>>>
>>>
>>> El sábado, 7 de diciembre de 2019, 0:08:41 (UTC+1), Alaina Rowe escribió:

 I have not been able to reproduce the bug I am about to describe when
 DEBUG is True, whether in production on Apache or locally on the Django dev
 server. So my first question is: What is all the magic that Django DEBUG
 does behind the scenes? The documentation doesn't have very much
 information about this.

 Now for the bug. I understand that the following description is too
 bare-bones for anyone to reproduce, but I have IP to protect, and I don't
 have much hope of the error being reproduced anyway.

 Suppose I have a Django project with at least two apps, app alice with
 model A and app bob with model B.

 I am using UpdateWithInlinesView from django-extra-views. The error
 occurs when this view constructs a formset from instances of model A. In my
 email about the 500, I get a message like this:

 FieldError at /some/url/
 Cannot resolve keyword 'field_of_A' into field. Choices are:
 field_of_B_1, field_of_B_2, field_of_B_3

 I've gotten this type of error before. It normally happens when you
 tell a form "I'm using model C" and "I'm using a field called debbie" and
 model C doesn't have a field called debbie. That part makes sense. But this
 error makes it look like it's checking against the field names of model B
 when it should be checking model A. I have been racking my brain trying to
 figure out how in the world the construction of a form from one model would
 consult a different model from a different app.

 Furthermore, this doesn't happen most of the time, it goes away on
 server restart, and it doesn't happen under DEBUG = True. So I'm wondering
 if it's an app registry issue, some sort of race condition that gets the
 registry out of whack. If so, then I might get somewhere by either
 understanding the app registry better or understanding what DEBUG does.

 Any thoughts?

>>> --
>>> 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/fb61e2e6-001b-407c-b966-a3c1dc203a59%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/CAP5HUWpryMyyy5xji4NtgYUAZg0NYu1mpRt_LAqfdhtCy8xO8w%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/CAH9mneVfr_FHQbC77ceftsdvDiZm3UKJOvAjr8E0GSKpyULjkg%40mail.gmail.com.


Re: Django DEBUG magic, and a bizarre bug under django-extra-views

2019-12-07 Thread Integr@te System
Hi issuer,

Plz look at model built by UpdateWithInlinesView
to see if you mistake from limit of string return from get_absolute_url()
https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#createwithinlinesview-and-updatewithinlinesview

https://docs.djangoproject.com/en/2.2/ref/models/instances/

must contain ASCII RFC2396 section 2

On Sat, Dec 7, 2019, 20:27 Daniel Chimeno  wrote:

> +1 to more document about DEBUG magic.
>
>
> El sábado, 7 de diciembre de 2019, 0:08:41 (UTC+1), Alaina Rowe escribió:
>>
>> I have not been able to reproduce the bug I am about to describe when
>> DEBUG is True, whether in production on Apache or locally on the Django dev
>> server. So my first question is: What is all the magic that Django DEBUG
>> does behind the scenes? The documentation doesn't have very much
>> information about this.
>>
>> Now for the bug. I understand that the following description is too
>> bare-bones for anyone to reproduce, but I have IP to protect, and I don't
>> have much hope of the error being reproduced anyway.
>>
>> Suppose I have a Django project with at least two apps, app alice with
>> model A and app bob with model B.
>>
>> I am using UpdateWithInlinesView from django-extra-views. The error
>> occurs when this view constructs a formset from instances of model A. In my
>> email about the 500, I get a message like this:
>>
>> FieldError at /some/url/
>> Cannot resolve keyword 'field_of_A' into field. Choices are:
>> field_of_B_1, field_of_B_2, field_of_B_3
>>
>> I've gotten this type of error before. It normally happens when you tell
>> a form "I'm using model C" and "I'm using a field called debbie" and model
>> C doesn't have a field called debbie. That part makes sense. But this error
>> makes it look like it's checking against the field names of model B when it
>> should be checking model A. I have been racking my brain trying to figure
>> out how in the world the construction of a form from one model would
>> consult a different model from a different app.
>>
>> Furthermore, this doesn't happen most of the time, it goes away on server
>> restart, and it doesn't happen under DEBUG = True. So I'm wondering if it's
>> an app registry issue, some sort of race condition that gets the registry
>> out of whack. If so, then I might get somewhere by either understanding the
>> app registry better or understanding what DEBUG does.
>>
>> Any thoughts?
>>
> --
> 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/fb61e2e6-001b-407c-b966-a3c1dc203a59%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/CAP5HUWpryMyyy5xji4NtgYUAZg0NYu1mpRt_LAqfdhtCy8xO8w%40mail.gmail.com.


Re: Where to set the DATABASE_URL environment variable on Heroku

2019-12-07 Thread Tim Johnson


On 12/6/19 9:09 PM, Jorge Gimeno wrote:


On Fri, Dec 6, 2019 at 5:40 PM Tim Johnson > wrote:


Despite the voluminous Heroku documentation I am unable to establish
where to initialize the DATABASE_URL that would establish credentials
for my deployed database.

Heroku's documentation uses the following example

DATABASE_URL=$(heroku config:get HEROKU_POSTGRESQL_TIMS_URL -a
timsapp)

But I am not clear where this initialization code should live

would it be in the procfile? If so, what process should I use.
Release?
Worker?

OR

Would it be in an .env file?
... snip ...

I believe DATABASE_URL is set on Heroku itself as a configuration 
variable.  If you provision the database in Heroku, it will be set for 
you.  See here: 
https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-heroku-postgres


Thank you Jorge, I have read that section too:

The following is highlighted as a warning on that:

"""

The value of your app’s |DATABASE_URL| config var might change at any time.

You should not rely on this value either inside or outside your Heroku app.

"""

that is precisely why I have asked this question.

more discussion of this issue is found at 
https://devcenter.heroku.com/articles/connecting-to-heroku-postgres-databases-from-outside-of-heroku


and a search for "DATABASE_URL=$("  will give an example of how to set 
DATABASE_URL from the Heroku command line.


That approach begs for a script but I am unsure of what script file to 
use. .env or Procfile or some other.


Thanks again Jorge

--
Tim
tj49.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/14cf27a4-eb56-5925-fcf8-50ca3344f9e8%40akwebsoft.com.


Re: ''workon' is not recognized as an internal or external command, operable program or batch file'

2019-12-07 Thread Khaleel Ahmed H. M. Shariff
Hi Hima,
May Peace, Blessings & Mercy of Almighty God be on you!
workon is a module. do a *pip install workon*

If you still get the same message. You could execute *python -m workon test*


Hope this helps
Best of Luck.


God Bless You!
God Bless India!!
--

Love & Regards
Dr. Khaleel Ahmed H. M.

Managing Director, Tanzanite Realty India Private Limited

---

Human Life is Precious
Koran Surah Ma'idah Chapter 5 Verse 32:
If anyone killed a person, not in retaliation of murder, or (and) to spread
mischief in the land - it would be as if he killed all mankind, & if anyone
saved a life, it would be as if he saved the life of all mankind.


On Sat, Dec 7, 2019 at 6:58 PM Hima Bindu chowdary 
wrote:

> I am trying to get into virtual environment in vscode but get the below
> error ..
>
> C:\Users\User\projects\telusko>workon test
> 'workon' is not recognized as an internal or external command,
> operable program or batch file.
>
> did some research..implemented some things suggested
> 1.The python extension 'pylint' in vscode was installed.
> 2.The python interpreter is chosen.
> Do we need to make changes to path? please suggest..
>
> --
> 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/9ab0fe68-7e7f-4a99-b66c-09e06f7f13e4%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/CAMjBbiA-qW%2BvHMapMk%3Ds2A_hUDgSzX7ngukng3fT%3Dw1VvWiHsA%40mail.gmail.com.


Sending XML data from Django to another server (SAP)

2019-12-07 Thread Pema Galey
Hi All,
Someone recommend in sending the *data from Django server to SAP server 
which interprets in XML format.*


Thank you

-- 
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/8e4e2355-bb3b-4695-9770-a18c20249fd0%40googlegroups.com.


Query for Data Tables Report Generation and Graph

2019-12-07 Thread Balaji Shetty
Hi

I have used django_data_table2
django-tables2 - An app for creating HTML tables

My Query is can I generate Graph as well as export data in pdf format.



On Thursday, December 5, 2019, Matheus Almeida <
matheus.alme...@spotsales.com.br> wrote:

>
>
> Em quinta-feira, 20 de abril de 2017 23:18:03 UTC-3, Robin Lery escreveu:
>>
>> I have a very simple model and its related serializer and views:
>>
>> class Page(models.Model):
>> user = models.ForeignKey(User)
>> title = models.CharField(max_length=255)
>> pub_date = models.DateTimeField(default=timezone.now)
>>
>> class PageSerializer(serializers.ModelSerializer):
>> class Meta:
>> model = Page
>> fields = ('user', 'title', 'pub_date')
>>
>> class PageViewSet(viewsets.ModelViewSet):
>> queryset = Page.objects.all()
>> serializer_class = PageSerializer
>> Now I can post like this:
>>
>> {
>> "user": 1,
>> "title": "Lorem ipsum"
>> }
>> This works fine. But I would like to post multiple objects like this:
>>
>> [
>> {
>> "user": 1,
>> "title": "Lorem ipsum one"
>> },
>> {
>> "user": 1,
>> "title": "Lorem ipsum two"
>> }
>> ]
>> But this gives me an error:
>>
>> "non_field_errors": [
>>
>> "Invalid data. Expected a dictionary, but got list."
>> ]
>> So to accept multple objects I modified the view as per the doc:
>>
>> class PageViewSet(viewsets.ModelViewSet):
>> queryset = Page.objects.all()
>> serializer_class = PageSerializer(queryset, many=True)
>>
>> But I am getting an error:
>>
>> TypeError at /api/blog/pages/
>>
>> 'ListSerializer' object is not callable
>> What am I missing here?
>>
>
> You can do this overriding get_serializer method:
>
> def get_serializer(self, *args, **kwargs):
> if "data" in kwargs:
> data = kwargs["data"]
>
> # check if many is required
> if isinstance(data, list):
> kwargs["many"] = True
>
> return super(YourModel, self).get_serializer(*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 view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/a1811b72-a91d-4ab8-9b26-4c293c4e7ddd%40googlegroups.com
> 
> .
>


-- 
Mr Shetty Balaji
Asst. Prof.
IT Department
SGGS I
Nanded. My. India

-- 
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/CAECSbOtALAP-6dBQWnUqDUuEjYaNZzUJdyFDfd5QDD0_fUJDhQ%40mail.gmail.com.


''workon' is not recognized as an internal or external command, operable program or batch file'

2019-12-07 Thread Hima Bindu chowdary
I am trying to get into virtual environment in vscode but get the below 
error .. 

C:\Users\User\projects\telusko>workon test
'workon' is not recognized as an internal or external command,
operable program or batch file.

did some research..implemented some things suggested 
1.The python extension 'pylint' in vscode was installed.
2.The python interpreter is chosen.
Do we need to make changes to path? please suggest..

-- 
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/9ab0fe68-7e7f-4a99-b66c-09e06f7f13e4%40googlegroups.com.


Re: Django DEBUG magic, and a bizarre bug under django-extra-views

2019-12-07 Thread Daniel Chimeno
+1 to more document about DEBUG magic.


El sábado, 7 de diciembre de 2019, 0:08:41 (UTC+1), Alaina Rowe escribió:
>
> I have not been able to reproduce the bug I am about to describe when 
> DEBUG is True, whether in production on Apache or locally on the Django dev 
> server. So my first question is: What is all the magic that Django DEBUG 
> does behind the scenes? The documentation doesn't have very much 
> information about this.
>
> Now for the bug. I understand that the following description is too 
> bare-bones for anyone to reproduce, but I have IP to protect, and I don't 
> have much hope of the error being reproduced anyway.
>
> Suppose I have a Django project with at least two apps, app alice with 
> model A and app bob with model B.
>
> I am using UpdateWithInlinesView from django-extra-views. The error occurs 
> when this view constructs a formset from instances of model A. In my email 
> about the 500, I get a message like this:
>
> FieldError at /some/url/
> Cannot resolve keyword 'field_of_A' into field. Choices are: field_of_B_1, 
> field_of_B_2, field_of_B_3
>
> I've gotten this type of error before. It normally happens when you tell a 
> form "I'm using model C" and "I'm using a field called debbie" and model C 
> doesn't have a field called debbie. That part makes sense. But this error 
> makes it look like it's checking against the field names of model B when it 
> should be checking model A. I have been racking my brain trying to figure 
> out how in the world the construction of a form from one model would 
> consult a different model from a different app.
>
> Furthermore, this doesn't happen most of the time, it goes away on server 
> restart, and it doesn't happen under DEBUG = True. So I'm wondering if it's 
> an app registry issue, some sort of race condition that gets the registry 
> out of whack. If so, then I might get somewhere by either understanding the 
> app registry better or understanding what DEBUG does.
>
> Any thoughts?
>

-- 
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/fb61e2e6-001b-407c-b966-a3c1dc203a59%40googlegroups.com.