Skip to content

Commit

Permalink
Update settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dylantjb committed Dec 2, 2022
1 parent 1e0d203 commit 4cac7eb
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 67 deletions.
2 changes: 1 addition & 1 deletion blogs/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class BookclubConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'bookclub'
name = 'blogs'
48 changes: 48 additions & 0 deletions blogs/migrations/0002_alter_user_bio_alter_user_email_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Generated by Django 4.1.3 on 2022-12-02 14:46

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("blogs", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name="user",
name="bio",
field=models.CharField(blank=True, max_length=520),
),
migrations.AlterField(
model_name="user",
name="email",
field=models.EmailField(max_length=254, unique=True),
),
migrations.AlterField(
model_name="user",
name="first_name",
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name="user",
name="last_name",
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name="user",
name="username",
field=models.CharField(
max_length=30,
unique=True,
validators=[
django.core.validators.RegexValidator(
message="Username must consist of at least 3 alphanumericals.",
regex="^\\w{3,}$",
)
],
),
),
]
4 changes: 2 additions & 2 deletions blogs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

class User(AbstractUser):
username = models.CharField(
max_length = 30
unique = True
max_length = 30,
unique = True,
validators = [RegexValidator(
regex = r'^\w{3,}$',
message = 'Username must consist of at least 3 alphanumericals.'
Expand Down
2 changes: 1 addition & 1 deletion bookclub/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'BookClub.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookclub.settings')

application = get_asgi_application()
45 changes: 0 additions & 45 deletions bookclub/migrations/0001_initial.py

This file was deleted.

Empty file removed bookclub/migrations/__init__.py
Empty file.
34 changes: 18 additions & 16 deletions bookclub/settings.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
"""
Django settings for BookClub project.
Django settings for bookclub project.
Generated by 'django-admin startproject' using Django 4.1.3.
Generated by 'django-admin startproject' using Django 4.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
https://docs.djangoproject.com/en/4.0/ref/settings/
"""

import os
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-86xa8*e6^y2vax^ie5#kgrid+tsio4u9=lt4i4-t0)taf2@9_v'
SECRET_KEY = 'django-insecure-z424)92#n7_f+v5mu#77rep=^jvsm)fz9bn-ga@du#9(73-cap'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand All @@ -37,7 +37,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bookclub',
'blogs',
]

MIDDLEWARE = [
Expand All @@ -50,7 +50,7 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'BookClub.urls'
ROOT_URLCONF = 'bookclub.urls'

TEMPLATES = [
{
Expand All @@ -68,11 +68,11 @@
},
]

WSGI_APPLICATION = 'BookClub.wsgi.application'
WSGI_APPLICATION = 'bookclub.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases

DATABASES = {
'default': {
Expand All @@ -83,7 +83,7 @@


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

AUTH_PASSWORD_VALIDATORS = [
{
Expand All @@ -102,7 +102,7 @@


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

LANGUAGE_CODE = 'en-us'

Expand All @@ -114,12 +114,14 @@


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
# https://docs.djangoproject.com/en/4.0/howto/static-files/

STATIC_URL = 'static/'

STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

Expand Down
2 changes: 1 addition & 1 deletion bookclub/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'BookClub.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookclub.settings')

application = get_wsgi_application()
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'BookClub.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookclub.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand Down

0 comments on commit 4cac7eb

Please sign in to comment.