So i decided to deploy my first django app with appfog, created app in appfog, downloaded the source code so as to use their project structure, made the necessary changes and updated. It all went smoothly untill i did python manage.py collectstatic this collected all the staticfiles, but i cannot make changes to the static files,cannot use css in the templates. i just don't get why. in my settings.py

ROOT_PATH = os.path.dirname(__file__)
STATIC_ROOT = os.path.join(ROOT_PATH, 'static')
STATIC_DIR = /absolute/path/to/static

in urls.py

url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),

my project structure looks like this,basically structure from appfog

-env
-.afignore
-settings.py
-templates
-static
-app1

How do i fix this?

有帮助吗?

解决方案

When you run python manage.py collectstatic it will create static folder which copy the files inside staticfiles folder, right?

If you want to make changes don't try to change it in your static folder. Just change the files inside your staticfiles folder. After that, run python manage.py collectstatic to make an updates in your static folder.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top