Skip to content

Commit

Permalink
fix: update project template settings according to Mezzanine
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-hulski committed Apr 8, 2022
1 parent f83f332 commit 9ade021
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# This file is exec'd from settings.py, so it has access to and can
# modify all the variables in settings.py.

# If this file is changed in development, the development server will
# have to be manually restarted because changes will not be noticed
# immediately.

DEBUG = True

# Make these unique, and don't share it with anybody.
Expand Down
20 changes: 9 additions & 11 deletions cartridge/project_template/project_name/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@

# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
Expand Down Expand Up @@ -198,6 +198,8 @@
# a mode you'd pass directly to os.chmod.
FILE_UPLOAD_PERMISSIONS = 0o644

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"


#############
# DATABASES #
Expand Down Expand Up @@ -248,11 +250,11 @@
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = STATIC_URL + "media/"
MEDIA_URL = "/media/"

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = os.path.join(PROJECT_ROOT, *MEDIA_URL.strip("/").split("/"))
MEDIA_ROOT = os.path.join(PROJECT_ROOT, MEDIA_URL.strip("/"))

# Package/module name to import the root urlpatterns from for the project.
ROOT_URLCONF = "%s.urls" % PROJECT_APP
Expand Down Expand Up @@ -292,11 +294,11 @@
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.messages",
"django.contrib.redirects",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.sitemaps",
"django.contrib.messages",
"django.contrib.staticfiles",
"mezzanine.boot",
"mezzanine.conf",
Expand All @@ -307,7 +309,7 @@
"mezzanine.blog",
"mezzanine.forms",
"mezzanine.galleries",
"mezzanine.twitter",
# "mezzanine.twitter",
# "mezzanine.accounts",
)

Expand Down Expand Up @@ -381,12 +383,8 @@
# DYNAMIC SETTINGS #
####################

# set_dynamic_settings() will rewrite globals based on what has been
# defined so far, in order to provide some better defaults where
# applicable. We also allow this settings module to be imported
# without Mezzanine installed, as the case may be when using the
# fabfile, where setting the dynamic settings below isn't strictly
# required.
# set_dynamic_settings() will rewrite globals based on what has been defined so far, in
# order to provide some better defaults where applicable.
try:
from mezzanine.utils.conf import set_dynamic_settings
except ImportError:
Expand Down

0 comments on commit 9ade021

Please sign in to comment.