02-Vue - 项目搭建

2018-01-09  本文已影响19人  coderST
source ~/.bashrc
workon  得到虚拟环境
workon VueShop
(VueShop) ➜  ~ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
certifi (2017.11.5)
chardet (3.0.4)
coreapi (2.3.3)
coreschema (0.0.4)
diff-match-patch (20121119)
Django (1.11.7)
django-crispy-forms (1.7.0)
django-filter (1.1.0)
django-formtools (2.1)
django-guardian (1.4.9)
django-import-export (0.6.1)
django-reversion (2.0.11)
djangorestframework (3.7.7)
et-xmlfile (1.0.1)
future (0.15.2)
httplib2 (0.9.2)
idna (2.6)
itypes (1.1.0)
jdcal (1.3)
Jinja2 (2.10)
Markdown (2.6.10)
MarkupSafe (1.0)
mysqlclient (1.3.12)
odfpy (1.3.6)
olefile (0.44)
openpyxl (2.4.9)
Pillow (4.3.0)
pip (9.0.1)
pytz (2017.3)
PyYAML (3.12)
requests (2.18.4)
setuptools (38.2.5)
six (1.10.0)
tablib (0.12.1)
unicodecsv (0.14.1)
uritemplate (3.0.0)
urllib3 (1.22)
wheel (0.30.0)
xlrd (1.1.0)
XlsxWriter (1.0.2)
xlwt (1.3.0)
(VueShop) ➜  ~ 
The following packages are optional:
*   [coreapi](http://pypi.python.org/pypi/coreapi/) (1.32.0+) - Schema generation support.
*   [Markdown](http://pypi.python.org/pypi/Markdown/) (2.1.0+) - Markdown support for the browsable API.
*   [django-filter](http://pypi.python.org/pypi/django-filter) (1.0.1+) - Filtering support.
*   [django-crispy-forms](https://github.com/maraujop/django-crispy-forms) - Improved HTML display for filtering.
*   [django-guardian](https://github.com/django-guardian/django-guardian) (1.1.1+) - Object level permissions support.

一 :创建虚拟环境VueShop  
1 : 创建虚拟环境  mkvirtualenv VueShop    
2:  安装djangorestframework (VueShop) ➜  ~ pip install djangorestframework
3 : 安装Djanjo   (VueShop) ➜  ~ pip install -i https://pypi.douban.com/simple django
4 : 安装 markdown    pip install markdown
5 : 安装django-filter   pip install django-filter
6 : 安装django-guardian
7 : 安装coreapi

在setting中写入
下面的配置要和mysql配置一致
DATABASES = {
'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mxshop',
'USER': 'root',
'PASSWORD': 'root',
'HOST': '127.0.0.1',
'OPTIONS': {'init_command': 'SET storage_engine=INNODB;' }
}
}

from django.conf.urls import url
import xadmin
urlpatterns = [
    url(r'^xadmin/', xadmin.site.urls),
]
import os
import sys
    sys.path.insert(0, BASE_DIR)
    sys.path.insert(0, os.path.join(BASE_DIR, 'apps'))
    sys.path.insert(0, os.path.join(BASE_DIR, 'extra_apps'))
上一篇 下一篇

猜你喜欢

热点阅读