Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django DEFAULT_AUTO_FIELD warnings #147

Open
alexpreynolds opened this issue Oct 29, 2021 · 0 comments
Open

Django DEFAULT_AUTO_FIELD warnings #147

alexpreynolds opened this issue Oct 29, 2021 · 0 comments

Comments

@alexpreynolds
Copy link
Contributor

I set up a higlass-server instance from the develop branch (28 Oct 2021), using the current higlass-docker Dockerfile as a recipe.

I tested a simple ingest of a custom-sized chromsizes file:

$ make ingest
python /home/higlass/projects/higlass-server/manage.py ingest_tileset --filetype chromsizes-tsv --datatype chromsizes --coordSystem hg38_fixedBin --filename hg38.chromSizes.fixedBin
System check identified some issues:

WARNINGS:
tilesets.Project: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
	HINT: Configure the DEFAULT_AUTO_FIELD setting or the TilesetsConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
tilesets.Tileset: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
	HINT: Configure the DEFAULT_AUTO_FIELD setting or the TilesetsConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
tilesets.ViewConf: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
	HINT: Configure the DEFAULT_AUTO_FIELD setting or the TilesetsConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

I started from an Ubuntu 20.04 LTS AMI:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal

This host is running Django 3.2.8:

$ python -m django --version
3.2.8

Adding the following to /home/higlass/projects/higlass-server/higlass_server/settings.py cleared the warnings on subsequent ingest attempts:

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

I don't know if this is the correct solution or might have unintended consequences, however. This appears to be related to a primary key not being defined for models, and I'm not sure if putting in a default would have side effects.

Among other differences, my old higlass-server instance is running Django 2.1.5 and I don't recall seeing these warnings there. It appears this may be a consequence of running Django 3.2 (or newer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant