I have problems with deploying files in my development environment.
See my configuration below.
python manage.py collectstatic
collects all files from '/Users/vikingosegundo/Projects/website/media/'
as expected and stores them at /Users/vikingosegundo/Projects/website/mydjangoproject/static/
.
But although the links to the css files are correct when using <link href="{% static "css/style.css"%}" rel="stylesheet" type="text/css">
(rendered as <link href="/staticmedia/css/style.css" rel="stylesheet" type="text/css">
), the originals files at /Users/vikingosegundo/Projects/website/media/
will be deployed, not from the STATIC_ROOT
/Users/vikingosegundo/Projects/website/mydjangoproject/static/
.
Even if I delete the files that are in /Users/vikingosegundo/Projects/website/media/
.
Where is my misconfiguration?
settings.py
MEDIA_ROOT = '/Users/vikingosegundo/Projects/website/mydjangoproject/media/'
MEDIA_URL = '/sitemedia/'
STATIC_ROOT = '/Users/vikingosegundo/Projects/website/mydjangoproject/static/'
STATIC_URL = '/staticmedia/'
STATICFILES_DIRS = [
'/Users/vikingosegundo/Projects/website/media/',
]
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
#....
)