登录到管理页面后,Django服务器立即停止 [英] Django server stops immediatly after login into admin page

查看:118
本文介绍了登录到管理页面后,Django服务器立即停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Django的新功能,试图使用venv在虚拟环境中创建项目。我执行了以下步骤。

New to Django trying to create a project in a virtual environment using venv. These are the following steps i did.

1。创建一个名为api的文件夹

1.created a folder named api

2。创建一个虚拟使用 python -m venv vapi

2.created a virtual environment using python -m venv vapi

3。安装django并运行初始迁移然后创建超级用户

3.installed django and ran initial migrations then created super user

pip install django
django-admin startproject library .
python manage.py migrate
python manage.py createsuperuser

现在尝试登录到django adminpage

now tried to login to django adminpage

我在settings.py文件中没有做任何更改

I haven't changed anything in setting.py file

使用默认的sqllite db

using default sqllite db

python 3.7
django-admin 3.0

python 3.7 django-admin 3.0

推荐答案

I Python版本 3.7.0 面临相同的问题。看来已经有门票。将Python更新到版本 3.7.6 可以帮助我解决此问题:

I faced the same issue with Python version 3.7.0. It looks that there is already ticket for that. Updating Python to version 3.7.6 helped to resolve this issue for me:

# Updating version via pyenv
$ pyenv install 3.7.6



更新版本

使用 pipenv 创建新的virtualenv(请记住清除旧的venv,如有必要):

Creating new virtualenv using pipenv (remember to clear old venv if neccessary):

$ pipenv --rm
$ pipenv install --dev
Creating a virtualenv for this project…
Pipfile: /home/homeuser/projects/django_rest/Pipfile
Using /home/homeuser/.pyenv/versions/3.7.6/bin/python3 (3.7.6) to create virtualenv…
...

这篇关于登录到管理页面后,Django服务器立即停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆