I am running python manage.py runserver or migrate and in both commands it is getting stuck on Performing system checks... Can you please help me out to understand what is the issue and how to solve it?
Admins-MacBook-Pro:driveu_backend gathole$ python manage.py runserver
/Users/gathole/.virtualenvs/du/lib/python2.7/site-packages/social_auth/models.py:4: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
from django.utils.importlib import import_module
/Users/gathole/.virtualenvs/du/lib/python2.7/site-packages/social_auth/utils.py:14: RemovedInDjango19Warning: The utilities in django.db.models.loading are deprecated in favor of the new application loading system.
from django.db.models.loading import get_model
/Users/gathole/.virtualenvs/du/lib/python2.7/site-packages/social_auth/models.py:4: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
from django.utils.importlib import import_module
/Users/gathole/.virtualenvs/du/lib/python2.7/site-packages/social_auth/utils.py:14: RemovedInDjango19Warning: The utilities in django.db.models.loading are deprecated in favor of the new application loading system.
from django.db.models.loading import get_model
Performing system checks...
just try
pip install -U Django
in your virtual environment.
I solve this by upgrade my Django version, without uninstall my MySQL 5.7 Server.
MySQL latest version was causing the issue... Just reverted MySQL version to 5.6 and it worked :)
This is probably a network problem. My code worked fine before but one day I add client = BertClient() in some files and I forgot to start the bert server (bert is an ML model). As a results, I encountered the same problem of starting my Django app.
You can check start from the app's urls.py file by commenting/uncommenting imports.
MySQL 5.7.x on Mac 14.4.0 have the same issue.
1.remove the mysql
2.brew install homebrew/versions/mysql56 (install an older version)
Related
I am following the “Getting Started With Django on Render” tutorial (https://render.com/docs/deploy-django#update-your-app-for-render) and all was going well until I got to “Configure Django for PostgreSQL”. I have everything copied correctly but I am getting errors now when I run python manage.py runserver this is the error:
File "/Users/user/Desktop/First_Program/Portfolio_Projects/Charter_Django_App/Charter_Django_App/config/settings.py", line 14, in <module>
import dj_database_url
ModuleNotFoundError: No module named 'dj_database_url'
even though when I run poetry show it clearly says it is installed
asgiref 3.5.2 ASGI specs, helper code, and adapters
brotli 1.0.9 Python bindings for the Brotli compression library
dj-database-url 1.0.0 Use Database URLs in your Django Application.
dj-email-url 1.0.6 Use an URL to configure email backend settings in your Django Application.
django 3.2.16 A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
django-cache-url 3.4.2 Use Cache URLs in your Django application.
environs 9.5.0 simplified environment variable parsing
gunicorn 20.1.0 WSGI HTTP Server for UNIX
marshmallow 3.19.0 A lightweight library for converting complex datatypes to and from native Python datatypes.
packaging 22.0 Core utilities for Python packages
psycopg2-binary 2.9.5 psycopg2 - Python-PostgreSQL Database Adapter
python-dotenv 0.21.0 Read key-value pairs from a .env file and set them as environment variables
pytz 2022.6 World timezone definitions, modern and historical
setuptools 65.6.3 Easily download, build, install, upgrade, and uninstall Python packages
sqlparse 0.4.3 A non-validating SQL parser.
whitenoise 6.2.0 Radically simplified static file serving for WSGI applications
And also shows in poetry.lock file.
If anybody knows why this is happening and can please give me some insight. I followed the tutorial to the T but am new to using poetry.
I am also a bit confused as to where I store the environment variables such as SECRET_KEY as the tutorial is not very descriptive at that point. I am used to using pip install environs[django] then running
env = Env() env.read_env()
And reading from the .env file
Thank you x1000 in advance to anybody that may help me get my application running
I'm guessing the error is from you're virtualenv either you're not activating it or the packages are not installed in the virtualenv.
if you are using vscode try Ctrl + Shift + p and search for Python: select interpreter make sure the interpreter vscode is using is you're venv if click on it and go to myvenv/Scripts/ there you can see a file python.exe choose it.
It's hard to be sure as you didn't post that many things to begin with. But if you managed your virtual environment through poetry, then you should run :
poetry run python manage.py runserver
(instead of python manage.py runserver)
(As for environment variables, I've been advised to try python-dotenv. I haven't had the chance to test it yet, but it seems easier than most things. I'm not sure if that will help you with render.yaml though...)
I'm building a django application using Pyinstaller.
When I run the application i get an error from dapne server.
"daphne\server.py:13: UserWarning: Something has already installed a non-asyncio Twisted reactor. Attempting to uninstall it; you can fix this warning by importing daphne.server early in your codebase or finding the package that imports Twisted and importing it later on."
In addition, when I compare the console log of the EXE application and a regular run of the django application I notice the following difference.
In the regular run which works as expected I see the following print:
"Django version 2.1.5, using settings 'cfehome.settings'
Starting ASGI/Channels version 2.1.5 development server at http://0.0.0.0:8000/"
however, when I run the application from the EXE I see:
"Django version 2.1.5, using settings 'cfehome.settings'
Starting development server at http://0.0.0.0:8000/"
Appreciate any lead to understand this behavior and ways to fix it.
I know this is old but for others seeking answer. There's a simple fix:
Before importing raven in settings.py, import daphne.server So, your settings.py will look like this:
import daphne.server
import raven
For further information you can read: https://github.com/django/channels/issues/793
I hope it will help.
I am trying to learn about python-django web framework.
I have successfully installed database migration tool 'south' in my ubuntu os and also added it to INSTALLED_APPS for using this tool for my web app.
When I run any command using manage.py like
$ ./manage.py runserver
I get this error:
"/usr/local/lib/python2.7/dist-packages/South-1.0.2-py2.7.egg/south/db/generic.py:9: RemovedInDjango19Warning: The django.db.backends.util module has been renamed. Use django.db.backends.utils instead.
from django.db.backends.util import truncate_name
There is no South database module 'south.db.sqlite3' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS."
I don't understand what it means. How can I fix this error?
Please give your useful suggestion to solve this error.Thanks
Firstly, you appear to be using the development version of Django. Don't do that, especially as you're just beginning. Use the latest actual release, 1.8.
Secondly, since 1.7 Django has included built-in migrations. There is no need to install South.
I am working on a django app and was using south for migrations. Everything worked well in my system and I was able to migrate. But when I put the code in the server and ran syncdb, I got the error as:
#After a long traceback
from django.db.models.loading import cache
Import Error: no module named cache
Then I removed south from the installed_apps and tried syncdb, which worked perfectly. But import south works fine in shell. So I am sure that south is installed in my server. Why do I get this error?
edit: The same error occured in some other systems too. I install south using pip install south
In the comments you mention you are using Django 1.7.
I wouldn't imagine South to support that version, as South-like migration support (by the South author, no less) lands in 1.7: https://docs.djangoproject.com/en/dev/topics/migrations/
I am a newbie to Python trying out to quickly build a site using Django.
Following are the steps I have performed (Win 7):
Installed Python 2.7
Installed Django 1.4
Created a project and app
Started the server using 'python manage.py startserver' and accessed using the "http://127.0.0.1:8000" the basic page.
Now wanted to configure my Oracle 11g DB for my project. Hence, installed cx_Oracle 5.1-11g and tried 'python manage.py syncdb' which failed with cx_Oracle.DatabaseError: ORA-24315: illegal attribute type.
Got the same error even from a python interpretor.
import cx_Oracle
connection=cx_Oracle.Connection('python_user','python_user','(DESC..string..)')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: ORA-24315: illegal attribute type
I am using the correct credentials and libraries as per my trouble shooting.
Any help is appreciated..
Checking which attribute is failing by raising an explicit exception might help you in the right direction
try:
connection=cx_Oracle.Connection('python_user','python_user','(DESC..string..)')
except cx_Oracle.DatabaseError, e:
print e[0].context
raise
The main problem is versions of the following should be compatible with each other.
Python 2.7, Django 1.4, Oracle DB 11g (which I connect to) and lib cx_Oracle 5.0.3+-11g should be in compatible with Oracle Xe 11.2 (which was 10.2 previously).
After installing the right version and setting the ORACLE_HOME to 'C:/oraclexe/.../11.2.0/server' it started connecting without any issues.