标签:module src mys ++ pen append not 内容 use
python --version
virtualenv -p /usr/bin/python3.5 VENV
source VENV/bin/activate
pip install "django<1.9"
django-admin startproject mvote
cd mvote
python manage.py startapp mysite
LANGUAGE_CODE = ‘zh-CN‘
TIME_ZONE = ‘Asia/Beijing‘
USE_I18N = True
USE_L10N = True
USE_TZ = True
# 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‘),
]
STATIC_ROOT = "/home/guguobao/mvote/staticfiles/"
点击它,修改以下内容,去此之外,还要修改mvote/wsgi.py为同样的内容
# +++++++++++ DJANGO +++++++++++
# To use your own django app use code like this:
import os
import sys
#
## assuming your django settings file is at ‘/home/guguobao/mysite/mysite/settings.py‘
## and your manage.py is is at ‘/home/guguobao/mysite/manage.py‘
path = ‘/home/guguobao/mvote‘
if path not in sys.path:
sys.path.append(path)
os.environ[‘DJANGO_SETTINGS_MODULE‘] = ‘mvote.settings‘
# then:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
在pythonanywhere.com免费网站建立虚拟机环境以及django网站
标签:module src mys ++ pen append not 内容 use
原文地址:https://www.cnblogs.com/guguobao/p/9394059.html