Re: MySQL accepts 0 for a primary key but Django does not

2019-01-01 Thread mazz ahmed
Hello, hope everyone doing well. I am working on tornado framework. I want to use admin panel for that app but I am getting a single solution using Django alongside of tornado for admin panel. I want to use some package in the tornado which gives me admin panel. If anyone knows let me know Please.

Re: MySQL accepts 0 for a primary key but Django does not

2019-01-01 Thread Derek
Hi Simo My custom app has no particular structure - its really just a collection of files and utilities that are commonly used across multiple apps. It gets imported, along with all the others, in the settings file. When I follow your suggestion of just referring to "custom", I get this erro

Re: MySQL accepts 0 for a primary key but Django does not

2018-12-30 Thread Simon Charette
Hello Derek, Not sure of your custom module structure but you'll want to point ENGINE to 'custom' and not 'custom.base' just like you were pointing to 'django.db.backends.mysql' and not 'django.db.backends.mysql.base'. Cheers, Simon Le dimanche 30 décembre 2018 04:01:59 UTC-5, Derek a écrit :

Re: MySQL accepts 0 for a primary key but Django does not

2018-12-30 Thread Derek
Hi Simon Much appreciated. However, I am obviously doing something wrong. If I save that code into a file called "base.py" stored in my 'custom' app, and then change my settings file to have: DATABASES = { 'default': { 'ENGINE': 'custom.base', # WAS: 'django.db.backends.mysql',

Re: MySQL accepts 0 for a primary key but Django does not

2018-12-28 Thread Simon Charette
Hello Derek, There's no setting but this is controlled by the allows_auto_pk_0 feature flag [0]. Database feature are set to the default database configurations so Django can minimized the number of introspection queries required to work appropriately each time a connection is opened. In order

MySQL accepts 0 for a primary key but Django does not

2018-12-28 Thread Derek
I am working with some legacy data and need to preserve the existing record ID's which, in some tables, include the value of 0 for their auto-increment field. I have updated the configuration file for MySQL such that the sql_mode is set to include 'NO_AUTO_VALUE_ON_ZERO'. I can check that this wo