标签:session 第一个 交互模式 simple rate images change with des
@ubuntu:~$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
sudo apt install python3-pip
命令安装pipfcj@ubuntu:~$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
fcj@ubuntu:~$ python3
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print(django.get_version())
2.2.1
>>>
ubuntu:~/Desktop/code/PythonDemo$ django-admin startproject MyProject
Command ‘django-admin‘ not found, but can be installed with:
sudo apt install python-django-common
根据提示使用:sudo apt install python-django-common安装
如果还报错:
Cannot find installed version of python-django or python3-django
使用安装:sudo apt-get install python3-django
然后即可正常创建项目!
fcj@ubuntu:~/Desktop/code/PythonDemo$ django-admin startproject MyProject
fcj@ubuntu:~/Desktop/code/PythonDemo$
fcj@ubuntu:~/Desktop/code/PythonDemo$ tree
.
└── MyProject
├── manage.py
└── MyProject
├── __init__.py
├── settings.py
├── urls.py
└── wsgi.py
2 directories, 5 files
fcj@ubuntu:~/Desktop/code/PythonDemo/MyProject$ 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.
June 15, 2019 - 03:37:00
Django version 2.2.1, using settings ‘MyProject.settings‘
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
打开: http://127.0.0.1:8000/
项目运行成功
You have 17 unapplied migration(s). Your project may not work
properly until you apply the migrations for app(s): admin,
auth, contenttypes, sessions.
使用python3 manage.py migrate
解决:
fcj@ubuntu:~/Desktop/code/PythonDemo/MyProject$ python3 manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying admin.0003_logentry_add_action_flag_choices... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying auth.0010_alter_group_name_max_length... OK
Applying auth.0011_update_proxy_permissions... OK
Applying sessions.0001_initial... OK
fcj@ubuntu:~/Desktop/code/PythonDemo/MyProject$ python3 manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
June 15, 2019 - 03:41:46
Django version 2.2.1, using settings ‘MyProject.settings‘
Starting development server at http://127.0.0.1:8000/
标签:session 第一个 交互模式 simple rate images change with des
原文地址:https://www.cnblogs.com/qqmb/p/11165528.html