Pinax (Django 2.0.2 快速搭建骨架)

2018-03-13  本文已影响301人  金哲虎

它就是一个Django开发骨架,方便我们快速搭建一个网站 参考地址

export LC_ALL=C.UTF-8
export LANG=C.UTF-8
pip install Django==2.0
django-admin startproject --template=https://github.com/pinax/pinax-starter-projects/zipball/account mysite

Release Project
------- ---------------
  4.0.3 account
  4.0.3 blog
  2.0.3 company
        documents
        social-auth
  4.0.3 static
  4.0.3 stripe
        team-wiki
  3.0.3 waitinglist
        wiki
  4.0.3 zero


遇到的小坑

开发场景: 开发机Windows 7+本地Docker

"dev:browser-sync": "browser-sync start --no-open --proxy localhost:8000 --files \"static/dist/js/*.js, static/dist/css/*.css\"",
{
  "repository": {
    "type": "git",
    "url": "https://github.com/pinax/pinax-project"
  },
  "scripts": {
    "clean": "rm -rf static/dist && mkdir -p static/dist/js && mkdir -p static/dist/css && mkdir -p static/dist/images",
    "build:js": "browserify -t [ babelify --presets [ env ] ] -t envify -o static/dist/js/site.js static/src/js/index.js",
    "build:css": "node-sass static/src/scss/index.scss static/dist/css/app.css",
    "copy:images": "cp -r static/src/images/* static/dist/images/ 2>/dev/null || :",
    "optimize:js": "uglifyjs static/dist/js/site.js -m -c warnings=false -o static/dist/js/site.js",
    "optimize:css": "cssnano static/dist/css/app.css static/dist/css/app.css",
    "optimize": "npm run optimize:js && npm run optimize:css",
    "watch:test": "onchange static/src/js/**/*.js -- npm run test",
    "watch:lint": "onchange static/src/js/**/*.js -- npm run lint",
    "watch:js": "watchify -t [ babelify --presets [ env ] ] -t envify static/src/js/index.js -o 'exorcist static/dist/js/site.js.map > static/dist/js/site.js' -dv",
    "watch:css": "node-sass static/src/scss/index.scss static/dist/css/app.css --watch -r",
    "build": "npm run clean && concurrently \"npm run build:js\" \"npm run build:css\" \"npm run copy:images\" && npm run optimize",
    "watch": "npm run clean && npm run copy:images && npm run build:css && concurrently --raw \"npm run watch:lint\" \"npm run watch:js\" \"npm run watch:css\"",
    "dev:browser-sync": "browser-sync start --no-open --proxy 0.0.0.0:8000 --files \"static/dist/js/*.js, static/dist/css/*.css\"",
    "dev": "concurrently --raw \"./manage.py runserver 0:8000\" \"npm run watch\" \"npm run dev:browser-sync\"",
    "lint": "eslint static/src/**/**/*.js",
    "test": "mocha --recursive --compilers js:babel-register static/src/tests/index.js",
    "compile": "NODE_ENV=production npm run clean && concurrently \"npm run copy:images\" \"npm run build:js\" \"npm run build:css\"",
    "heroku-postbuild": "npm run compile && npm run optimize"
  },
  "license": "UNLICENSED",
  "dependencies": {
    "babel-core": "6.26.0",
    "babel-preset-env": "1.6.1",
    "babelify": "8.0.0",
    "bootstrap": "4.0.0",
    "browser-sync": "2.23.6",
    "browserify": "15.2.0",
    "chai": "4.1.2",
    "concurrently": "3.5.1",
    "cssnano": "3.10.0",
    "cssnano-cli": "1.0.5",
    "envify": "4.1.0",
    "eslint": "4.16.0",
    "eslint-plugin-babel": "4.1.2",
    "exorcist": "1.0.0",
    "jquery": "3.3.1",
    "jsdom": "11.6.2",
    "jsdom-global": "3.0.2",
    "mocha": "5.0.0",
    "node-sass": "^4.7.2",
    "onchange": "3.3.0",
    "uglify-js": "3.3.9",
    "watchify": "3.10.0"
  }
}

上一篇下一篇

猜你喜欢

热点阅读