打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
deepin系统下django项目创建步骤
1.配置deepin系统下pip源目录Mkdir .pip
vim .pip/pip.conf 
douser@douser-PC:~$ cat .pip/pip.conf [global] index-url = https://pypi.doubanio.com/simple/ timeout = 1000 use-mirrors = true mirrors = https://pypi.doubanio.com// douser@douser-PC:~$ 

2.打开pycharm 新建工程,进入虚拟terminal项输入pip3 install Django 
douser@douser-PC:~$ pip3 install django WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.doubanio.com/simple/ Requirement already satisfied: django in ./.local/lib/python3.7/site-packages (3.1.3)Requirement already satisfied: pytz in ./.local/lib/python3.7/site-packages (from django) (2020.4) Requirement already satisfied: asgiref<4,>=3.2.10 in ./.local/lib/python3.7/site-packages (from django) (3.3.1) Requirement already satisfied: sqlparse>=0.2.2 in ./.local/lib/python3.7/site-packages (from django) (0.4.1) douser@douser-PC:~$ 

3.用pip管理工具查看安装django的版本信息及django包详细信息
douser@douser-PC:~/PycharmProjects/pyDjango$ pip3 list
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.Package       Version------------- --------asgiref       3.3.1asn1crypto    0.24.0cryptography  2.6.1distro        1.3.0Django        3.1.3entrypoints   0.3keyring       17.1.1keyrings.alt  3.1.1lxml          4.6.1onboard       1.4.1pexpect       4.6.0Pillow        5.4.1pip           20.2.4pycairo       1.16.2pycrypto      2.6.1PyGObject     3.30.4pysmbc        1.0.15.6pytz          2020.4pyxdg         0.25reportlab     3.5.13SecretStorage 2.3.1setuptools    40.8.0six           1.12.0sqlparse      0.4.1wheel         0.32.3
douser@douser-PC:~/PycharmProjects/pyDjango$ pip3 show Django
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.Name: DjangoVersion: 3.1.3Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.Home-page: https://www.djangoproject.com/Author: Django Software FoundationAuthor-email: foundation@djangoproject.comLicense: BSD-3-ClauseLocation: /home/douser/.local/lib/python3.7/site-packagesRequires: sqlparse, pytz, asgirefRequired-by: douser@douser-PC:~/PycharmProjects/pyDjango$
 4.核实安装的django版本douser@douser-PC:~/PycharmProjects/pyDjango$ python3
Python 3.7.3 (default, Oct 28 2020, 14:33:53) [GCC 8.3.0] on linuxType "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print(django.get_version())
3.1.3
>>>
 douser@douser-PC:~/PycharmProjects/pyDjango$ python3 -m django --version
3.1.3
5.创建django 工程目录及查看工程目录下文件douser@douser-PC:~$ python3 -m django startproject mysite
douser@douser-PC:~$ ls
模板      Desktop    Downloads   Music   Pictures         tmp.text迅雷下载  Documents  Lightworks  mysite  PycharmProjects  Videosdouser@douser-PC:~/mysite$ ls
manage.py  mysitedouser@douser-PC:~/mysite$ douser@douser-PC:~/PycharmProjects/pyDjango$ cd mysite/mysite/douser@douser-PC:~/PycharmProjects/pyDjango/mysite/mysite$ lsasgi.py  __init__.py  settings.py  urls.py  wsgi.py
6.查看python3下django下的可用douser@douser-PC:~/PycharmProjects/pyDjango$ python3 -m djangoType 'python -m django help <subcommand>' for help on a specific subcommand.Available subcommands:[django]    check    compilemessages    createcachetable    dbshell    diffsettings    dumpdata    flush    inspectdb    loaddata    makemessages    makemigrations    migrate    runserver    sendtestemail    shell    showmigrations    sqlflush    sqlmigrate    sqlsequencereset    squashmigrations    startapp    startproject    test    testserverNote that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).    douser@douser-PC:~/PycharmProjects/pyDjango$
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
【新手向】为何要这样安装Django?
Django环境安装
python怎么创建django
把你开发的网站免费发布到互联网上(2)
Django在Ubuntu14.04的部署
nginx + python + django
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服