setting.py
STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, "static") STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), ) STATICFILES_FINDERS = ( "django.contrib.staticfiles.finders.FileSystemFinder", "django.contrib.staticfiles.finders.AppDirectoriesFinder" )
urls.py:
urlpatterns = [...]
+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
最后打开uwgi和nginx:
brew services restart/stop/start nginx
uwsgi配置详见:
http://www.cnblogs.com/jhao/p/6071790.html
nginx config 文件路径:
/usr/local/etc/nginx/nginx.conf
Django/vue.js 开发环境 ---->生产环境 修改(setting.py)