Hi,
I’m trying to develop a couple of projects concurrently. Consequently, I’m running two instances of django: runserver x.x.x.x:8000 and runserver x.x.x.x:8010. That works fine, until I try to add static files. In the first instance, I have this line in the settings.py file:
STATIC_ROOT = os.path.join(BASE_DIR, ‘static’)
In the second project, if I put this line:
STATICFILES_DIRS = [
os.path.join(BASE_DIR, ‘static’),
]
It breaks the second project, such that it can no longer find home.html. Even if I erase this last line from settings.py and reload the server, it’s still broken. The first project still works, however. I figure I’m confusing django with this second setting, but I don’t know how to get it right.
Thanks.
These are two separate projects in two different directories, right?
These two projects should have nothing in common. (They should not share any directories.)
You should also be more specific as to what you mean by “broken” here.
Yes, they are in totally different directories. I have tried it twice though. As soon as I change the second settings.py file as indicated above, it completely breaks the second site.
I get:
Exception Type: |
TemplateDoesNotExist |
Exception Value: |
home.html |
And undoing the change to the settings.py file and reloading the server does not fix it. I have concluded that the trouble is because I’m running the two server instances, but maybe I’m wrong. It’s the only thing I can think of though.
I got it. I forgot to add the app in the settings.py file. Everything seems to work now. So sorry for the trouble. I really appreciate the help though.