跟老齐学Python Django实战 1/n Second edition
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了跟老齐学Python Django实战 1/n Second edition,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3898字,纯文字阅读大概需要6分钟。
内容图文
virtualenv lqidjango
source bin/activate
pip3 install Django
--> pass
django-admin startproject mysite
--> fail
(lqidjango) cor@debian:~/lqidjango$ django-admin startproject mysite bash: django-admin: command not found
python3 -m django startproject mysite
--> pass
#sudo apt-get install tree
(lqidjango) cor@debian:~/lqidjango/mysite$ tree . ├── manage.py └── mysite ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py 1 directory, 5 files
#
(lqidjango) cor@debian:~/lqidjango/mysite$ python3 manage.py runserver Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. Run ‘python manage.py migrate‘ to apply them. April 23, 2020 - 03:01:43 Django version 2.2.12, using settings ‘mysite.settings‘ Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Error: That port is already in use.
#sudo apt-get install net-tools
cor@debian:~/webscrappython/Web_Scraping_with_Python/downloadAprial7th/wswp-code-9e6b82b47087/chapter08$ sudo apt-get install net-tools Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: icedtea-netx icedtea-netx-common linux-image-4.9.0-8-amd64 Use ‘sudo apt autoremove‘ to remove them. The following NEW packages will be installed: net-tools 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. Need to get 248 kB of archives. After this operation, 963 kB of additional disk space will be used. Get:1 http://mirrors.tuna.tsinghua.edu.cn/debian stretch/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1 [248 kB] Fetched 248 kB in 2s (92.8 kB/s) Selecting previously unselected package net-tools. (Reading database ... 272538 files and directories currently installed.) Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-1_amd64.deb ... Unpacking net-tools (1.60+git20161116.90da8a0-1) ... Processing triggers for man-db (2.7.6.1-2) ... Setting up net-tools (1.60+git20161116.90da8a0-1) ... cor@debian:~/webscrappython/Web_Scraping_with_Python/downloadAprial7th/wswp-code-9e6b82b47087/chapter08$ sudo netstat -anutp|grep 8000 tcp6 0 0 :::8000 :::* LISTEN 1804/docker-proxy
#
(lqidjango) cor@debian:~/lqidjango/mysite$ python3 manage.py runserver 7000 Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. Run ‘python manage.py migrate‘ to apply them. April 23, 2020 - 03:37:15 Django version 2.2.12, using settings ‘mysite.settings‘ Starting development server at http://127.0.0.1:7000/ Quit the server with CONTROL-C.
Start APP
python3 manage.py startapp blog
(lqidjango) cor@debian:~/lqidjango/mysite$ tree . ├── db.sqlite3 ├── manage.py └── mysite ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ ├── settings.cpython-35.pyc │ ├── urls.cpython-35.pyc │ └── wsgi.cpython-35.pyc ├── settings.py ├── urls.py └── wsgi.py 2 directories, 10 files (lqidjango) cor@debian:~/lqidjango/mysite$ python3 manage.py startapp blog (lqidjango) cor@debian:~/lqidjango/mysite$ tree . ├── blog │ ├── admin.py │ ├── apps.py │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── tests.py │ └── views.py ├── db.sqlite3 ├── manage.py └── mysite ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ ├── settings.cpython-35.pyc │ ├── urls.cpython-35.pyc │ └── wsgi.cpython-35.pyc ├── settings.py ├── urls.py └── wsgi.py 4 directories, 17 files
原文:https://www.cnblogs.com/winditsway/p/12759930.html
内容总结
以上是互联网集市为您收集整理的跟老齐学Python Django实战 1/n Second edition全部内容,希望文章能够帮你解决跟老齐学Python Django实战 1/n Second edition所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。