首先找到apache2的conf文件下的httpd.conf,添加如下信息:
Alias /static/ E:/wamp/Apache24/www/static/ <Directory E:/wamp/Apache24/www/static> Options FollowSymlinks AllowOverride none Require all granted </Directory>
django 工程下setting中对应设置:
# Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.8/howto/static-files/ STATIC_URL = ‘/static/‘ STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), )
时间: 2024-11-05 12:29:20