I have shared hosting hosting Dreamhost Passenger Python / Django. I currently have a global folder (/ public / static, / public / media) that collects files other than python. When I do collectstatic, all my applications * / static files are copied to the global / public / static folder. Okay bye.
1) I get tired using collectstatic . I want to delete the application folder * / static and put my files in global / public / static. This works on Dreamhost, because Passenger Python points to the Apache Document Root to / public, which will properly load / public / static and / public / media. But on the development side, I do not have such functionality (under python manage.py).
2) Any optimization for static / cached files in Dreamhost / shared hosting?
Below are my settings:
Website Settings:
STATICFILES_DIRS = ( ABS_PATH + '/???/???/static/', #My App static dir ) STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', #'django.contrib.staticfiles.finders.DefaultStorageFinder' ) TEMPLATE_DIRS = ( #ABS_PATH + '/hdrtoronto/hdrtoronto/templates/' ABS_PATH + '/templates/' )
Urls.py:
if os.environ.get("django_dev", None): urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT) urlpatterns += static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
source share