Skip to content

Commit

Permalink
Merge pull request #35 from schemen/django3
Browse files Browse the repository at this point in the history
Django3
  • Loading branch information
schemen committed Aug 31, 2021
2 parents 79eed1a + af4c2c3 commit 90a8b1c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 17 deletions.
19 changes: 7 additions & 12 deletions dndtools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
https://docs.djangoproject.com/en/2.0/ref/settings/
"""

import os

# import secret settings
from .settings_secret import *


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

Expand All @@ -32,7 +29,7 @@
else:
DEBUG = True

ALLOWED_HOSTS = ['*']
ALLOWED_HOSTS = ['*']

# Email

Expand All @@ -52,12 +49,11 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.sites',
'paperminis.apps.PaperminisConfig',
'widget_tweaks',
]


MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
Expand All @@ -73,8 +69,8 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'templates/paperminis'), os.path.join(BASE_DIR, 'templates/registration')]
,
'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'templates/paperminis'),
os.path.join(BASE_DIR, 'templates/registration')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
Expand All @@ -89,7 +85,6 @@

WSGI_APPLICATION = 'dndtools.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
if os.getenv('PRODUCTION', False) == "True":
Expand All @@ -111,7 +106,6 @@
}
}


# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators

Expand All @@ -130,7 +124,6 @@
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/

Expand All @@ -144,7 +137,6 @@

USE_TZ = True


LOGGING = {
'version': 1,
'disable_existing_loggers': False,
Expand Down Expand Up @@ -178,3 +170,6 @@

# Due to BestiaryLink we need to set this value higher
DATA_UPLOAD_MAX_NUMBER_FIELDS = 2500

# Set the AUTO_FIELD globally for Django 3.2
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
43 changes: 43 additions & 0 deletions paperminis/migrations/0019_auto_20210831_0857.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 3.2.6 on 2021-08-31 08:57

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('paperminis', '0018_auto_20210318_2032'),
]

operations = [
migrations.AlterField(
model_name='bestiary',
name='id',
field=models.BigAutoField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='creature',
name='id',
field=models.BigAutoField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='creaturequantity',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='printsettings',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='user',
name='first_name',
field=models.CharField(blank=True, max_length=150, verbose_name='first name'),
),
migrations.AlterField(
model_name='user',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
]
4 changes: 2 additions & 2 deletions paperminis/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class Creature(models.Model):
)

# fields
id = models.AutoField(primary_key=True)
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=100)
img_url = models.TextField(max_length=500)
size = models.CharField(max_length=1, choices=CREATURE_SIZE_CHOICES, default=MEDIUM)
Expand Down Expand Up @@ -182,7 +182,7 @@ class Bestiary(models.Model):
"""Bestiary Model"""

# fields
id = models.AutoField(primary_key=True)
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=150)
owner = models.ForeignKey(User, on_delete=models.CASCADE)
from_ddb = models.BooleanField(default=False)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django==2.2.24
Django==3.2.6
django-constrainedfilefield==4.0.0
django-widget-tweaks==1.4.8
fake-useragent==0.1.11
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base_generic.html" %}

{% block content %}
{% load staticfiles %}
{% load static %}
<div class="row">
<div class="col-md-6">
<div class="card">
Expand Down
2 changes: 1 addition & 1 deletion templates/patreon.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block content %}

{% load staticfiles %}
{% load static %}
<div class="row">
<div class="col-md-6">
<div class="card">
Expand Down

0 comments on commit 90a8b1c

Please sign in to comment.