创建项目报错解决方法
Posted meihan
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了创建项目报错解决方法相关的知识,希望对你有一定的参考价值。
1、安装django
2、配置django的环境变量
C:UsershuojiaAppDataLocalProgramsPythonPython36-32Libsite-packagesdjango
3、运行命令行创建django项目
选好目录,执行django-admin startproject mysites项目名称
项目就被创建了,但是报错,Couldn‘t import Django. Are you sure it‘s installed and available on your PYTHONPATH environment variable? Did you
forget to activate a virtual environment?
4、卸载django版本,重新安装,没有生效
pip3 uninstall django
pip3 install django
5、cmd启动程序python3 manage.py runserver 127.0.0.1:8001
报以下错误,说没有权限
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 ‘python3 manage.py migrate‘ to apply them.
February 24, 2020 - 17:22:31
Django version 3.0.3, using settings ‘mysites.settings‘
Starting development server at http://127.0.0.1:8001/
Quit the server with CTRL-BREAK.
6、运行‘python3 manage.py migrate‘ to apply them.
D:pythonmysites>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
以上是关于创建项目报错解决方法的主要内容,如果未能解决你的问题,请参考以下文章
IDEA中用Maven创建webapp项目失败(没有src等文件目录) 报错: Received fatal alert: protocol_version 解决方法