Reputation: 1792
I just setup a new server on Digital Ocean. Updated Django to 1.11, uploaded my project, ran collectstatic
and I've made sure my settings match another project I have (which is live and works 100%). However, my static doesn't collect correctly into my static folder (which I have it set to do), any media I upload wont display, and the admin still has the all design from before I updated it to 1.11... Any thoughts? settings code below..
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.flatpages',
'listings',
'stats',
'users',
'allauth',
'allauth.account',
'allauth.socialaccount',
)
...
STATIC_ROOT = os.path.join(BASE_DIR,'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = [
'/static/',
]
#MEDIA
MEDIA_ROOT = '/home/django/django_project/media/'
MEDIA_URL = '/media/'
Also here's a picture of my file structure: Note that admin did not collect in static
Upvotes: 0
Views: 612
Reputation: 308
Try changing your code to this:
STATIC_URL = '/static/'
STATIC_DIR = os.path.join(BASE_DIR,'static')
STATICFILES_DIRS = [STATIC_DIR,]
I think STATIC_ROOT
should be your static direcory in the deployment directory, e.g. /var/www/mysite/static
.
and if that does not work, please add what collectstatic
command returns (on the shell) to your question.
Upvotes: 1
Reputation: 498
What you have done is given STATIC and STATIC_ROOT the same directory.Create a new folder named static_store for STATIC and static_cdn for STATIC_ROOT.Hope it works well!
Upvotes: 0