STATIC_ROOT in Django not working correctly












0














Trying to get static root set properly,



Went through the tango with Django tutorial and stuck on this part.



Basically this is my setting files, and the static folder is linked below in the tree.



C:.
├───media
│ └───locations
│ └───2018
│ └───11
│ └───11
│ └───20
│ └───18
├───Space
│ └───__pycache__
├───Spaces
│ ├───migrations
│ │ └───__pycache__
│ └───__pycache__
├───static
│ ├───admin
│ │ ├───css
│ │ │ └───vendor
│ │ │ └───select2
│ │ ├───fonts
│ │ ├───img
│ │ │ └───gis
│ │ └───js
│ │ ├───admin
│ │ └───vendor
│ │ ├───jquery
│ │ ├───select2
│ │ │ └───i18n
│ │ └───xregexp
│ ├───css
│ └───images
│ └───parralax
│ └───home
├───templates
│ ├───registration
│ └───Spaces
└───users
├───migrations
│ └───__pycache__
└───__pycache__


and below you can see the settings i'm using for this .



"""
Django settings for Space project.

Generated by 'django-admin startproject' using Django 2.1.1.

For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""

import os

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



BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
STATIC_DIR = os.path.join(BASE_DIR, 'static')
MEDIA_DIR = os.path.join(BASE_DIR,'media')



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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '5a@tkcbah13t_vb!6pp6#z1c3j-3abb!&$6r-mw+%0mtzg$qo@'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS =


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'users',
'Spaces',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'Space.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_DIR,],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.media'
],
},
},
]

STATICFILES_DIRS = [STATIC_DIR, ]
STATIC_URL = '/static/'
MEDIA_ROOT = MEDIA_DIR #where to look for files
MEDIA_URL = '/media/' #where to serve files from on url
WSGI_APPLICATION = 'Space.wsgi.application'


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

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


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

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

AUTHENTICATION_BACKENDS = (

'django.contrib.auth.backends.ModelBackend',

'allauth.account.auth_backends.AuthenticationBackend',

)
AUTH_USER_MODEL = 'users.CustomUser'
SITE_ID = 1

LOGIN_REDIRECT_URL = 'home'
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

LOGIN_REDIRECT_URL = 'index'
LOGOUT_REDIRECT_URL = 'index'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/


essentially just want the root for static to be where i've put "static" in the directory.



Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root.



When changing my STATIC_ROOT to,



STATICFILES_DIRS = [STATIC_DIR,  ]
STATIC_URL = '/static/'
MEDIA_ROOT = MEDIA_DIR #where to look for files
MEDIA_URL = '/media/' #where to serve files from on url
WSGI_APPLICATION = 'Space.wsgi.application'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


I get this issue :(










share|improve this question




















  • 1




    What is the problem? What is "not working correctly"?
    – Daniel Roseman
    Nov 20 at 12:07










  • Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root
    – Michael Holborn
    Nov 20 at 12:12






  • 1




    But you don't seem to set STATIC_ROOT at all.
    – Daniel Roseman
    Nov 20 at 12:16










  • How would I set it to the appropriate folder?
    – Michael Holborn
    Nov 20 at 12:44






  • 1




    Same way as you set anything else: STATIC_ROOT = whatever. Note there is no "appropriate folder", you need to just pick a name; os.path.join(BASE_DIR, 'staticfiles') is often used.
    – Daniel Roseman
    Nov 20 at 12:47
















0














Trying to get static root set properly,



Went through the tango with Django tutorial and stuck on this part.



Basically this is my setting files, and the static folder is linked below in the tree.



C:.
├───media
│ └───locations
│ └───2018
│ └───11
│ └───11
│ └───20
│ └───18
├───Space
│ └───__pycache__
├───Spaces
│ ├───migrations
│ │ └───__pycache__
│ └───__pycache__
├───static
│ ├───admin
│ │ ├───css
│ │ │ └───vendor
│ │ │ └───select2
│ │ ├───fonts
│ │ ├───img
│ │ │ └───gis
│ │ └───js
│ │ ├───admin
│ │ └───vendor
│ │ ├───jquery
│ │ ├───select2
│ │ │ └───i18n
│ │ └───xregexp
│ ├───css
│ └───images
│ └───parralax
│ └───home
├───templates
│ ├───registration
│ └───Spaces
└───users
├───migrations
│ └───__pycache__
└───__pycache__


and below you can see the settings i'm using for this .



"""
Django settings for Space project.

Generated by 'django-admin startproject' using Django 2.1.1.

For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""

import os

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



BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
STATIC_DIR = os.path.join(BASE_DIR, 'static')
MEDIA_DIR = os.path.join(BASE_DIR,'media')



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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '5a@tkcbah13t_vb!6pp6#z1c3j-3abb!&$6r-mw+%0mtzg$qo@'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS =


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'users',
'Spaces',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'Space.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_DIR,],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.media'
],
},
},
]

STATICFILES_DIRS = [STATIC_DIR, ]
STATIC_URL = '/static/'
MEDIA_ROOT = MEDIA_DIR #where to look for files
MEDIA_URL = '/media/' #where to serve files from on url
WSGI_APPLICATION = 'Space.wsgi.application'


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

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


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

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

AUTHENTICATION_BACKENDS = (

'django.contrib.auth.backends.ModelBackend',

'allauth.account.auth_backends.AuthenticationBackend',

)
AUTH_USER_MODEL = 'users.CustomUser'
SITE_ID = 1

LOGIN_REDIRECT_URL = 'home'
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

LOGIN_REDIRECT_URL = 'index'
LOGOUT_REDIRECT_URL = 'index'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/


essentially just want the root for static to be where i've put "static" in the directory.



Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root.



When changing my STATIC_ROOT to,



STATICFILES_DIRS = [STATIC_DIR,  ]
STATIC_URL = '/static/'
MEDIA_ROOT = MEDIA_DIR #where to look for files
MEDIA_URL = '/media/' #where to serve files from on url
WSGI_APPLICATION = 'Space.wsgi.application'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


I get this issue :(










share|improve this question




















  • 1




    What is the problem? What is "not working correctly"?
    – Daniel Roseman
    Nov 20 at 12:07










  • Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root
    – Michael Holborn
    Nov 20 at 12:12






  • 1




    But you don't seem to set STATIC_ROOT at all.
    – Daniel Roseman
    Nov 20 at 12:16










  • How would I set it to the appropriate folder?
    – Michael Holborn
    Nov 20 at 12:44






  • 1




    Same way as you set anything else: STATIC_ROOT = whatever. Note there is no "appropriate folder", you need to just pick a name; os.path.join(BASE_DIR, 'staticfiles') is often used.
    – Daniel Roseman
    Nov 20 at 12:47














0












0








0







Trying to get static root set properly,



Went through the tango with Django tutorial and stuck on this part.



Basically this is my setting files, and the static folder is linked below in the tree.



C:.
├───media
│ └───locations
│ └───2018
│ └───11
│ └───11
│ └───20
│ └───18
├───Space
│ └───__pycache__
├───Spaces
│ ├───migrations
│ │ └───__pycache__
│ └───__pycache__
├───static
│ ├───admin
│ │ ├───css
│ │ │ └───vendor
│ │ │ └───select2
│ │ ├───fonts
│ │ ├───img
│ │ │ └───gis
│ │ └───js
│ │ ├───admin
│ │ └───vendor
│ │ ├───jquery
│ │ ├───select2
│ │ │ └───i18n
│ │ └───xregexp
│ ├───css
│ └───images
│ └───parralax
│ └───home
├───templates
│ ├───registration
│ └───Spaces
└───users
├───migrations
│ └───__pycache__
└───__pycache__


and below you can see the settings i'm using for this .



"""
Django settings for Space project.

Generated by 'django-admin startproject' using Django 2.1.1.

For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""

import os

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



BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
STATIC_DIR = os.path.join(BASE_DIR, 'static')
MEDIA_DIR = os.path.join(BASE_DIR,'media')



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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '5a@tkcbah13t_vb!6pp6#z1c3j-3abb!&$6r-mw+%0mtzg$qo@'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS =


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'users',
'Spaces',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'Space.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_DIR,],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.media'
],
},
},
]

STATICFILES_DIRS = [STATIC_DIR, ]
STATIC_URL = '/static/'
MEDIA_ROOT = MEDIA_DIR #where to look for files
MEDIA_URL = '/media/' #where to serve files from on url
WSGI_APPLICATION = 'Space.wsgi.application'


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

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


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

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

AUTHENTICATION_BACKENDS = (

'django.contrib.auth.backends.ModelBackend',

'allauth.account.auth_backends.AuthenticationBackend',

)
AUTH_USER_MODEL = 'users.CustomUser'
SITE_ID = 1

LOGIN_REDIRECT_URL = 'home'
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

LOGIN_REDIRECT_URL = 'index'
LOGOUT_REDIRECT_URL = 'index'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/


essentially just want the root for static to be where i've put "static" in the directory.



Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root.



When changing my STATIC_ROOT to,



STATICFILES_DIRS = [STATIC_DIR,  ]
STATIC_URL = '/static/'
MEDIA_ROOT = MEDIA_DIR #where to look for files
MEDIA_URL = '/media/' #where to serve files from on url
WSGI_APPLICATION = 'Space.wsgi.application'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


I get this issue :(










share|improve this question















Trying to get static root set properly,



Went through the tango with Django tutorial and stuck on this part.



Basically this is my setting files, and the static folder is linked below in the tree.



C:.
├───media
│ └───locations
│ └───2018
│ └───11
│ └───11
│ └───20
│ └───18
├───Space
│ └───__pycache__
├───Spaces
│ ├───migrations
│ │ └───__pycache__
│ └───__pycache__
├───static
│ ├───admin
│ │ ├───css
│ │ │ └───vendor
│ │ │ └───select2
│ │ ├───fonts
│ │ ├───img
│ │ │ └───gis
│ │ └───js
│ │ ├───admin
│ │ └───vendor
│ │ ├───jquery
│ │ ├───select2
│ │ │ └───i18n
│ │ └───xregexp
│ ├───css
│ └───images
│ └───parralax
│ └───home
├───templates
│ ├───registration
│ └───Spaces
└───users
├───migrations
│ └───__pycache__
└───__pycache__


and below you can see the settings i'm using for this .



"""
Django settings for Space project.

Generated by 'django-admin startproject' using Django 2.1.1.

For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""

import os

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



BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
STATIC_DIR = os.path.join(BASE_DIR, 'static')
MEDIA_DIR = os.path.join(BASE_DIR,'media')



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

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '5a@tkcbah13t_vb!6pp6#z1c3j-3abb!&$6r-mw+%0mtzg$qo@'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS =


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'users',
'Spaces',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'Space.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [TEMPLATE_DIR,],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.media'
],
},
},
]

STATICFILES_DIRS = [STATIC_DIR, ]
STATIC_URL = '/static/'
MEDIA_ROOT = MEDIA_DIR #where to look for files
MEDIA_URL = '/media/' #where to serve files from on url
WSGI_APPLICATION = 'Space.wsgi.application'


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

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


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

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

AUTHENTICATION_BACKENDS = (

'django.contrib.auth.backends.ModelBackend',

'allauth.account.auth_backends.AuthenticationBackend',

)
AUTH_USER_MODEL = 'users.CustomUser'
SITE_ID = 1

LOGIN_REDIRECT_URL = 'home'
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

LOGIN_REDIRECT_URL = 'index'
LOGOUT_REDIRECT_URL = 'index'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/


essentially just want the root for static to be where i've put "static" in the directory.



Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root.



When changing my STATIC_ROOT to,



STATICFILES_DIRS = [STATIC_DIR,  ]
STATIC_URL = '/static/'
MEDIA_ROOT = MEDIA_DIR #where to look for files
MEDIA_URL = '/media/' #where to serve files from on url
WSGI_APPLICATION = 'Space.wsgi.application'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


I get this issue :(







django






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 at 6:23

























asked Nov 20 at 12:06









Michael Holborn

81116




81116








  • 1




    What is the problem? What is "not working correctly"?
    – Daniel Roseman
    Nov 20 at 12:07










  • Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root
    – Michael Holborn
    Nov 20 at 12:12






  • 1




    But you don't seem to set STATIC_ROOT at all.
    – Daniel Roseman
    Nov 20 at 12:16










  • How would I set it to the appropriate folder?
    – Michael Holborn
    Nov 20 at 12:44






  • 1




    Same way as you set anything else: STATIC_ROOT = whatever. Note there is no "appropriate folder", you need to just pick a name; os.path.join(BASE_DIR, 'staticfiles') is often used.
    – Daniel Roseman
    Nov 20 at 12:47














  • 1




    What is the problem? What is "not working correctly"?
    – Daniel Roseman
    Nov 20 at 12:07










  • Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root
    – Michael Holborn
    Nov 20 at 12:12






  • 1




    But you don't seem to set STATIC_ROOT at all.
    – Daniel Roseman
    Nov 20 at 12:16










  • How would I set it to the appropriate folder?
    – Michael Holborn
    Nov 20 at 12:44






  • 1




    Same way as you set anything else: STATIC_ROOT = whatever. Note there is no "appropriate folder", you need to just pick a name; os.path.join(BASE_DIR, 'staticfiles') is often used.
    – Daniel Roseman
    Nov 20 at 12:47








1




1




What is the problem? What is "not working correctly"?
– Daniel Roseman
Nov 20 at 12:07




What is the problem? What is "not working correctly"?
– Daniel Roseman
Nov 20 at 12:07












Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root
– Michael Holborn
Nov 20 at 12:12




Essentially I'm uploading to Heroku ATM, and I'm getting an error that it can't find the static root
– Michael Holborn
Nov 20 at 12:12




1




1




But you don't seem to set STATIC_ROOT at all.
– Daniel Roseman
Nov 20 at 12:16




But you don't seem to set STATIC_ROOT at all.
– Daniel Roseman
Nov 20 at 12:16












How would I set it to the appropriate folder?
– Michael Holborn
Nov 20 at 12:44




How would I set it to the appropriate folder?
– Michael Holborn
Nov 20 at 12:44




1




1




Same way as you set anything else: STATIC_ROOT = whatever. Note there is no "appropriate folder", you need to just pick a name; os.path.join(BASE_DIR, 'staticfiles') is often used.
– Daniel Roseman
Nov 20 at 12:47




Same way as you set anything else: STATIC_ROOT = whatever. Note there is no "appropriate folder", you need to just pick a name; os.path.join(BASE_DIR, 'staticfiles') is often used.
– Daniel Roseman
Nov 20 at 12:47

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53392669%2fstatic-root-in-django-not-working-correctly%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53392669%2fstatic-root-in-django-not-working-correctly%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Ottavio Pratesi

Tricia Helfer

15 giugno