Sign up, add apps, select python3.5, then open the console
- Build python3.5 Virtual Environment
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
- You can upload files such as template,static file through the website file.
- Modify the setting.py file
- Installen_app Join MySite
- allowed_hosts = [' * ']
LANGUAGE_CODE = ‘zh-CN‘TIME_ZONE = ‘Asia/Beijing‘USE_I18N = TrueUSE_L10N = TrueUSE_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/"
# +++++++++++ DJANGO +++++++++++# To use your own django app use code like this:import osimport 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_applicationapplication = get_wsgi_application()
- Modify a static URL for a Web page
Create a virtual machine environment and a Django Web site on pythonanywhere.com free web site