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

Demo project work with current version of Django #44

Merged
merged 1 commit into from
Aug 9, 2021
Merged

Demo project work with current version of Django #44

merged 1 commit into from
Aug 9, 2021

Conversation

mangelozzi
Copy link
Contributor

Demo project seems outdated and does not work with the current version of Django. Made the following changes to settings.py to get it to work:

  • MIDDLEWARE_CLASSES has been renamed to just MIDDLEWARE
  • Removed django.contrib.auth.middleware.SessionAuthenticationMiddleware from middleware as its been deprecated (baked in now)
  • Add DEFAULT_AUTO_FIELD = 'django.db.models.SmallAutoField' to remove these warnings when project starts up:
testapp.Player: (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 AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
testapp.Team: (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 AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

Demo project seems outdated and does not work with the current version of Django. Made the following changes to `settings.py` to get it to work:

- `MIDDLEWARE_CLASSES` has been renamed to just `MIDDLEWARE`
- Removed `django.contrib.auth.middleware.SessionAuthenticationMiddleware` from middleware as its been deprecated (baked in now)
- Add `DEFAULT_AUTO_FIELD = 'django.db.models.SmallAutoField'` to remove these warnings when project starts up:
```
testapp.Player: (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 AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
testapp.Team: (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 AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
```
@jonashaag
Copy link
Owner

Thanks!

@jonashaag jonashaag merged commit b13f1a8 into jonashaag:master Aug 9, 2021
@mangelozzi mangelozzi deleted the patch-1 branch August 10, 2021 00:52
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

Successfully merging this pull request may close these issues.

None yet

2 participants