Django development server keeps restarting itself, without any differences made to any files under the project directory.
Below is the output:
den#ev:~/calisma/ > python manage.py runserver 9000 -v 2 --traceback
Validating models...
0 errors found
Django version 1.1.1, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:9000/
Quit the server with CONTROL-C.
Validating models...
0 errors found
Django version 1.1.1, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:9000/
Quit the server with CONTROL-C.
Validating models...
0 errors found
Django version 1.1.1, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:9000/
Quit the server with CONTROL-C.
Validating models...
0 errors found
Django version 1.1.1, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:9000/
Quit the server with CONTROL-C.
^C
Most probably it does not like something somewhere in the project files
but couldn't get it choke out what's wrong.
Any suggestions?
Delete all the .pyc files
Use manage.py runserver --noreload
Try the same with an empty project. Or just disable all the INSTALLED_APPS setting.
How often does it reload? Inmediately, each X seconds, at random?
First ensure that the date of your computer is correctly configured (up to date) if it is not update it then retry to run the server.
If it still does not work I advise you to run the server with the option --noreload while waiting to find the solution but in my case that was exactly the same as the one meant set the date solved my problem.
Related
So I have a Django Project. Now I want to publish it but I have a few questions without answeres:
Normally if I want to make a change at my Django Project the Server needs to reload:
System check identified no issues (0 silenced).
May 12, 2021 - 21:07:20
Django version 3.1.5, using settings 'Project.settings'
Starting ASGI/Channels version 3.0.3 development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
If I want to change a running Server it will be stopped a few (Milli)seconds. Is this a bad behavior or is it the normal way to do it? :)
It is the normal way. The normal way for every kind of program mostly.
I setup a clean django project with:
django-admin startproject newProject
cd newProject
python manage.py migrate
python manage.py runserver
January 29, 2019 - 00:30:02 Django version 2.1.2, using settings
'unchained.settings' Starting development server at
http://127.0.0.1:8000/
And navigate to http://127.0.0.1:8000/ with Google-Chrome (71.0.3578.98):
[29/Jan/2019 00:30:08] You're accessing the development server over HTTPS, but it only supports HTTP.
[29/Jan/2019 00:30:08] code 400, message Bad request version ('ÊÊÀ+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00')
[29/Jan/2019 00:30:08] You're accessing the development server over HTTPS, but it only supports HTTP.
So, at some point in the past I activated SSL with a totally unrelated project. And for some strange reason, chrome now expects HTTPS. I could probably fix it by deleting the browser cache, but I don't really want to loose all the data that is in there.
How would you solve this?
Django Development server only uses Http protocol instead of Https. Your site is being opened at https://127.0.0.1:8000/ instead of http://127.0.0.1:8000/
Go to settings .py and change
SECURE_SSL_REDIRECT = False
I migrated my Django app from 1.4.3 to 1.7.1
I got it working for a short while
but now every time I try to run the development server it gets stuck on:
C:\Users\DAVID\Documents\TinyTap-web\tinytap>python manage.py runserver
Performing system checks...
System check identified some issues:
WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure
. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information.
System check identified 1 issue (0 silenced).
the localhost is not working , also tried with other IP/ports = same results.
I could get rid of this warning by adding TEST_RUNNER = 'django.test.runner.DiscoverRunner' to the settings file, but still development server is not running
Apparently it was related to migrations and "CircularDependencyError".
After deleting the database , and the migration folders and running manage.py migrate
I was finally able to runserver
Trying creating a new project
django-admin.py startproject mysite
If it works then there's problem with the current project you're trying to run. (You'll need to give us more information for us to help)
I don't get a traceback from the Two Scoops project (https://github.com/twoscoops/django-twoscoops-project).
I'm running a Ubuntu 12.04 production server on Virtualbox and I setup gunicorn. I'm trying to learn how to setup a production server so I can host it on Digital Ocean. So far, I've been able to get gunicorn to run by typing this in /myproject/myproject/ (the same directory as my manage.py):
gunicorn wsgi # run this in the same directory as wsgi.py
Then I type:
curl localhost:8000
But I only get back:
<\h1\> Whoops! <\h1>
I did the following:
export DJANGO_SETTINGS_MODULE=myproject.settings.production
But I still get the same "whoops" page. Any thoughts on how I can get the Python traceback or Django debug page to work?
I figured out how to turn on the debugging in a production setup.
You have to goto /settings/base.py and set DEBUG = True. It was False by default.
With django-extensions installed in your Django project, on a local machine you can use manage.py runserver_plus to have the very useful Werkzeug debugger active, so that the 500 error page lets you poke around with your stack interactively.
How do you activate the Werkzeug-enabled 500 page when running from Heroku?
If you are using gunicorn to serve your Django application on Heroku like on their tutorial https://devcenter.heroku.com/articles/django, you will not be able to see the Werkzeug debbuger because gunicorn does not use Werkzeug.
You have to serve you django application on Heroku using wsgi based server that uses Werkzeug like uWSGI. See -> https://github.com/unbit/uwsgi-docs/blob/master/tutorials/heroku_python.rst
Also DEBUG = True on your heroku settings must be set.
Having DEBUG = True on your production environment(heroku) is greatly discouraged because someone can view your settings(passwords) and even code.