开发者

Django static file directory not being ignored

开发者 https://www.devze.com 2023-03-28 09:48 出处:网络
I am getting familiar with Django and wondering if someone seasoned could help me out. I have my project like this:

I am getting familiar with Django and wondering if someone seasoned could help me out. I have my project like this:

panel
-> media
-> static
-> templates
-> users

with the additional python files. Media and Static are just that, media and static folders, and my template folder is templates. Users is an app. I have my static root pointed to that static folder and my media root pointed to the media folder, however it still tries to treat them as i开发者_StackOverflow社区f they were Django apps and so it doesn't ignore them. Am I doing something wrong? Thanks


The django development server will not serve static files unless you write code explicitly to do so. It's not like apache which by default maps URLs to the filesystem. All requests must go through urls.py.

Check out https://docs.djangoproject.com/en/dev/howto/static-files/

0

精彩评论

暂无评论...
验证码 换一张
取 消