django not serving static files

前端 未结 3 933
悲&欢浪女
悲&欢浪女 2020-12-21 00:13

I\'m using Django==1.5.5 and My django app is structured as

--project/
----project/
------settings.py
------urls.py
----app1/
------models.py
--         


        
3条回答
  •  攒了一身酷
    2020-12-21 01:07

    Only for development. Set DEBUG = True in settings.py file and add 'django.contrib.staticfiles' in INSTALLED_APPS. Next, add these lines of code to settings.py file of your project:

    STATIC_URL = '/static/'
    STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
    

提交回复
热议问题