mariadb / feedback-plugin-backend Goto Github PK
View Code? Open in Web Editor NEWBack End for the MariaDB Server Feedback Plugin
Home Page: https://mariadb.org/feedback_plugin
License: GNU General Public License v2.0
Back End for the MariaDB Server Feedback Plugin
Home Page: https://mariadb.org/feedback_plugin
License: GNU General Public License v2.0
Documentation is only using docker compose
but is missing information about local deployment without containerization, using virtual environments.
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/
Using the URLconf defined in feedback_plugin.urls, Django tried these URL patterns, in this order:
admin/
rest/v1/server-count/ [name='server_count']
rest/v1/version-breakdown/ [name='version_breakdown']
rest/v1/architecture/ [name='architecture']
rest/v1/os/ [name='os']
rest/v1/file-post/ [name='file_post']
The empty path didn’t match any of these.
You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
One should run tests from src/feedback/tests
folder.
$ python manage.py test
However there are couple of problems:
User has to have alter
privilege on all tables
./manage.py test
Creating test database for alias 'default'...
Traceback (most recent call last):
File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 73, in execute
return self.cursor.execute(query, args)
File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/home/anel/mariadb/feedback-plugin-backend/env/lib/python3.8/site-packages/MySQLdb/connections.py", line 254, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1142, "ALTER command denied to user 'feedback'@'localhost' for table 'django_content_type'")
One need to update the privilege in docker/mariadb/create_database_user.py
as it was the example for me which privilege user should have.
alter
privilege obtained in 1.problem, we can see that database is created (since we have create
priv on all tables), but we need priv on test_feedback_plugin
- just notification about reason of having the privilege.$ ./manage.py test
Creating test database for alias 'default'...
Got an error creating the test database: (1007, "Can't create database 'test_feedback_plugin'; database exists")
Type 'yes' if you would like to try deleting the test database 'test_feedback_plugin', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
Got an error recreating the test database: (1044, "Access denied for user 'feedback'@'localhost' to database 'test_feedback_plugin'")
$ ./manage.py test
Creating test database for alias 'default'...
Got an error creating the test database: (1007, "Can't create database 'test_feedback_plugin'; database exists")
Type 'yes' if you would like to try deleting the test database 'test_feedback_plugin', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
System check identified no issues (0 silenced).
.....E
======================================================================
ERROR: feedback_plugin.tests.test_process_raw_data (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: feedback_plugin.tests.test_process_raw_data
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/home/anel/mariadb/feedback-plugin-backend/src/feedback_plugin/tests/test_process_raw_data.py", line 3, in <module>
from zoneinfo import ZoneInfo
ModuleNotFoundError: No module named 'zoneinfo'
----------------------------------------------------------------------
Ran 6 tests in 0.062s
FAILED (errors=1)
Destroying test database for alias 'default'...
Instead one should use alternative module backports.zoneinfo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.