启动Django服务器中出现的问题整理

按照下面的资料进行Django服务的启动,启动中出现的问题进行整理:
启动参考资料: 这里

(1)SQLite 3.8.3 or later is required (found 3.7.17).
安装django之后启动服务器发现出现下面的报错

[root@localhost mysite]# python manage.py runserver  
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).

由于python的版本是Python 3.6.8,centos自带的SQLite 版本过低导致
解决升级SQLite 版本

升级方法参照:
https://blog.csdn.net/qq_39969226/article/details/92218635

(2) error: no acceptable C compiler found in $PATH
在上面(1)的升级的过程中出现下面的错误:

[root@localhost sqlite-autoconf-3300100]# ./configure --	prefix=/usr/local
……
configure: error: in `/root/sqlite-autoconf-3300100':
configure: error: no acceptable C compiler found in $PATH

是指在$PATH定义的路径下面没有找到C的编译器
可以用yum安装gcc编译环境:yum install -y gcc

gcc编译环境:(来源:百度百科)
GCC(GNU Compiler Collection,GNU编译器套件)是由GNU开发的编程语言译器。GNU编译器套件包括C、C++、 Objective-C、 Fortran、Java、Ada和Go语言前端,也包括了这些语言的库(如libstdc++,libgcj等。)

(3)You have 17 unapplied migration
再一次执行python manage.py runserver 时候,出现下面的错误
执行python manage.py migrate即可

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.

(4)局域网访问被拒绝
如果直接是本机连接,到这里就OK了。
如果是作为开发服务器,需要其他机器访问的话,需要参照下面进行启动和设置(原因:runserver 命令默认只监听本地连接)
https://blog.csdn.net/kan2016/article/details/82344157

你可能感兴趣的:(启动Django服务器中出现的问题整理)