Maison > Questions et réponses > le corps du texte
通过官方手册来自定义了过滤器,自定义过滤器可以使用,但是发现自带的static 无法使用,js,css等没办法加载
高洛峰2017-04-18 09:34:41
La statique est un problème distinct
Prenons http://192.168.0.27:8000/stat... comme exemple
Chemin du projet (le dossier où se trouve manage.py) : c:/test/
chemin de l'application : c:/test/app/
1. Ajoutez : STATIC_URL = '/static/' dans le paramètre
C'est-à-dire appeler directement le fichier statique dans le chemin de l'application, tel que : c:/test/app/static/bootstrap.min.css.
2. Ajoutez le paramètre : STATIC_ROOT = os.path.join(BASE_DIR,'static')
Vous devez exécuter python manage.py collectstatic
sous le chemin c:/test/, puis appeler c :/test/static/bootstrap.min.css fichier