Django server stops immediatly after login into admin page

后端 未结 12 1860
迷失自我
迷失自我 2021-01-02 11:16

Trying to login to django admin page immediately after clicking login button django server stops

New to Django trying to create a project in a virtual environment

相关标签:
12条回答
  • 2021-01-02 11:38

    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
    

    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…
    ...
    
    
    0 讨论(0)
  • 2021-01-02 11:39

    I am facing same issue, I think this is and issue with django 3.x.x series

    0 讨论(0)
  • 2021-01-02 11:39

    This solved my issue:

    pip uninstall django

    pip install django==2.2.11

    0 讨论(0)
  • 2021-01-02 11:40

    I had the same, but when i was looking for solutions, finally, i realized that its because of my terminal, i was working on powershell instead of my virtualenv (pipenv). when i changed into the virtualenv shell everything was ok.

    0 讨论(0)
  • 2021-01-02 11:44

    django version 3.0.1 not helped. version 2.2.8 working fine. but i find a way to access admin site without crashing the server. login to main page or your apps main page in admin site stops the server. but you can log in to urls like this: http://127.0.0.1:8000/admin/YourAppsName/YourModelsName/

    but still going to apps main page crashs the server.

    0 讨论(0)
  • 2021-01-02 11:45

    Here are the solutions on how to solve this problem.

    Attentions. These solutions work if you have the Django v3. I didn't face the same problem in the case of Django v2 etc. So, please, check your Django version and if you don't have v3, this answer, probably, won't help you. Sorry.

    1) you can downgrade your Django version to v2+

    but I don't like this way because I prefer to use the latest versions of everything

    2) upgrade your python version to 3.8.0 and it should help . (I solved this problem in this way)

    I suggest you use something like pyenv package if you have other projects that depend on your previous python version. Thanks to this package you can simply switch your python versions when you need to work on projects that require different python versions. Also, I'd like to suggest you use venv for your projects to keep your dependencies isolated. Using a different environment is a nice practice in the case of python development.

    Hope it helps. Kind regards.

    0 讨论(0)
提交回复
热议问题