# https://docs.djangoproject.com/en/1.9/howto/static-files/ STATIC_URL = '/static/' MEDIA_URL = '/media/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
The static and media folders must exist. Now in the django settings the minimum necessary parameters are therefore needed to be added independently.
The next question is likely to be static return. in 'context_processors': not enough
'django.template.context_processors.static',
without this, some applications will not work normally, for example, the ckeditor (cked) widget
Next, we give statics from the media folder, from static when developing itself will be given. In urls.py
from django.conf import settings from django.conf.urls.static import static
and below urlpatterns add
if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
The issue of placing on the server in a bunch of apache discussed here.
The ready working apache config was delivered separately on github, you need to substitute only the path, the name of the project and the name of the domain. Simplified to the maximum due to Define (assigning a variable so as not to prescribe everything manually many times)
You read the documentation, it is not clear how to do anything, although everything is very simple when there is a blank. The official documentation is not finalized.