Create a Django Project

Source: Internet
Author: User
Tags install django pip install django

Create a Django Project 1. Create a Django Project

2. Installing Django1.11.12
(Django_login) D:\demo\Django_login>pip install Django==1.11.12Collecting Django==1.11.12  Using cached https://files.pythonhosted.org/packages/92/56/1f30c1e6a58b0c97c492461148edcbece2c6e43dcc3529695165744349ee/Django-1.11.12-py2.py3-none-any.whlRequirement already satisfied: pytz in e:\venv\django_login\lib\site-packages (from Django==1.11.12) (2018.5)Installing collected packages: Django  Found existing installation: Django 2.1.1    Uninstalling Django-2.1.1:      Successfully uninstalled Django-2.1.1Successfully installed Django-1.11.12
3. Modify the urls.py file
from django.contrib import adminfrom django.conf.urls import urlurlpatterns = [    url('admin/', admin.site.urls),]
4. Create and register the app
创建app(Django_login) D:\demo\Django_login>python manage.py startapp app_login注册appINSTALLED_APPS = [    'django.contrib.admin',    'django.contrib.auth',    'django.contrib.contenttypes',    'django.contrib.sessions',    'django.contrib.messages',    'django.contrib.staticfiles',    'app_login',         #将创建的app注册]
5. Set the time
LANGUAGE_CODE = 'zh-hans'       #修改语言为中文TIME_ZONE = 'Asia/shanghai'     #设置时区USE_I18N = TrueUSE_L10N = TrueUSE_TZ = False                  #把这个False掉,否则不生效
6. Start the Django service

Create a Django Project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.