I have downloaded Mayan EDMS-Electronic Document Management System from GitHub and I configured project using Django server. I had added the required libraries based on requirement. when I tried to migrate Django using Mysql server, I got the error:
django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'value' used in key specification without a key length")
When I searched this error, I found -->MySQL error: key specification without a key length. but I occur error while migration.
django version - 1.11.5,
mysql version - 5.7.20
please help me to find the problem. thanks in advance
Related
When I try to access my Django application on the production server (AWS EBS), it keeps returning the following error (1054, "Unknown column 'two_factor_phonedevice.throttling_failure_timestamp' in 'field list'").
Strangely, the app works fine when running locally using the exact same MYSQL database (AWS RDS) and settings.
I have tried dropping the database and re-running migrations believing it was due to an inconsistency between my db and migrations files however I still keep getting the same error.
I am using the django_two_authentication module for the user authentication/logins. The table two_factor_phonedevice is created by the module to track the user devices registered for two factor authentication.
I cannot seem to solve why the column can be found when running locally but cannot be found on the production server despite both using the same database.
I am not familiar with django_two_authentication specifically, but I would check the different settings module you are using in each environment.
You may have differences in the INSTALLED_APPS or some other relevant entry.
Turns out the module version was not specified in the production requirements.txt file meaning the newest version (which happened to have a different db schema) was installed by default causing different versions to be running locally and in production environments.
To resolve this I explicitly set the module version in the requirements.txt file to match that of the local one.
I am getting this strange error
ProgrammingError at /save_hsn/
syntax error at or near "ON"
LINE 1: ...021-01-28T06:17:43.784614+00:00'::timestamptz, 1) ON CONFLIC...
this is my views.py part where I am getting the error
user_gst_codes.objects.bulk_create(hsn_list, ignore_conflicts=True)
If I remove ignore_conflicts=True, everything works.
Moreover, I start getting this error after deploying my Django app on cPanel, on localhost this doesn't give any error.
On localhost-
Python 3.6.6, Django 3.1
On cPanel-
Python 3.6.11, Django 3.1
Is this an issue with the Python version?
I am inserting data in bulk and also need to keep the unique check.
Any help would be appreciated.
Notice that the ON CONFLICT clause is only available from PostgreSQL 9.5. If you are using an earlier version, you will need a workaround to have the upsert feature. Please check local postgresql version and server postgresql version.
I have an existing database in Oracle 11.2.
I am trying to use inspectdb utility of django to automatically create the models but I am getting the error:
ORA-00904: "IDENTITY_COLUMN": invalid identifier
There is no column named IDENTITY_COLUMN in any of the tables and since I am not directly accessing the database, the chances of misspelling a column name or accessing a wrong column is not possible.
It would be very helpful if someone can give a direction as to what to fix to solve this error.
I had a similar problem also working with Oracle 11.2
I downgraded Django===2.1 to Django===1.11.13 temporarily to run inspectdb as a work around since my legacy models needed to be manually cleaned up anyway, but it was a good place to start for reverse engineering models from a legacy db.
Same thing happened to me . First downgrade your django into a lower version (1.11.22) and run
python manage.py inspectdb > your_app_name/models.py
Then upgrade to whatever version you are using . I was using 3.0.4
I'm not sure if it is possible.
The docs don't mention Oracle:
inspectdb works with PostgreSQL, MySQL and SQLite.
But a user said they got it working, for example this comment in a previous question. See also this older question for some hints.
I had a Django project that I had worked on in the past for quite a while. Recently, I tried to reopen it and add some minor changes. What happened is that recently I also reinstalled MySQL(8.0) and of course, recreated my old database. But now when I tried to run the server or any other operation, I get the following error:
2059, "Authentication plugin 'caching_sha2_password' cannot be loaded: The specified module could not be found.
I tried the solution from other post, but it did not work for me. Here is also a full traceback of the error: https://pastebin.com/JqexqTtC
I had the same problem and I fix this issue with the first method:
If you have access to database through workbench, mysql console... and you have permission to alter user so you can change auth_plugin for default
ALTER USER 'your_user' IDENTIFIED WITH mysql_native_password BY 'your_password';
If you don't have permission to it database so you can change mysql connector.
add link: https://www.codegrepper.com/code-examples/sql/raise+errors.NotSupportedError%28+mysql.connector.errors.NotSupportedError%3A+Authentication+plugin+%27caching_sha2_password%27+is+not+supported
I need help switching my database engine from sqlite to mysql. manage.py datadump is returning the same error that pops up when I try to do anything else with manage.py : ImproperlyConfigured: Error loading MySQL module, No module named MySQLdb.
This django project is a team project. I pulled new changes from bitbucket and our backend has a new configuration. This new configuration needs mysql (and not sqlite) to work. Our lead dev is sleeping right now. I need help so I can get started working again.
Edit: How will I get the data in the sqlite database file into the new MySQL Database?
According to the Database setup paragraph in Django docs:
By default, the configuration uses SQLite.
If you wish to use another database, install the appropriate database
bindings...
And Get your database running page says:
If you’re using MySQL, you’ll need the MySQL-python package, version
1.2.1p2 or higher.
To use MySQL backend you need a tool that would help Django talk to the database, an adapter.
In other words, MySQL-python (aka MySQLdb) package needs to be installed.
Try the followings steps:
1. Change DATABASES in settings.py to MYSQL engine
2. Run $ ./manage.py syncdb