How can I use Tarantool in conjunction with Django and MySQL for caching (instead of i.e. Redis) and/or in the sense that all read transaction go to Tarantool (after insured MySQL replication) and all writes go into MySQL (preferred option) Would anyone have a sample?
Well. Tarantool does not have a Django plugin. That means you have to introduce it first. By the way, tarantool has python 2.71 and python 3.x1 libraries, so it may be useful for integration.
How it could be implemented? You have to use taranool's python library and also MySQL's python library for creating some Django / Python plugin.
Also. About MySQL replication. Tarantool has this feature, you can get codes from GH repo[2].
I'm not sure that Django's sample could be found.
Afterword. It's the pretty big task :)
1 https://github.com/tarantool/tarantool-python
[2] https://github.com/tarantool/mysql-tarantool-replication
UPD: February 2021:
The Django-Tarantool Database Backend was introduced as django-tarantool PyPi package and can be used for Django 1.10-3.1 versions.
pip install django-tarantool
Feel free to contribute to the package https://github.com/artembo/django-tarantool
Related
I am planning to use Liquibase(https://www.liquibase.org) to manage the migrations/versioning of Oracle database schemas. The project is in Python using setuptools.
I have seen also Python wrappers for Liquibase but they don't seem to be well maintained.
Does anyone has experience in the integration of Liquibase in python projects? Or a similar?
Are you using SQLAlchemy ? Because there is a tool to manage database migration : Alembic
Alambic is wrapped in another Python Framwework too, like Flask in specific module as Flask-migration.
Try using pyliquibase. you can perform liquibase actions through python script
https://github.com/memiiso/pyliquibase
I am developing a new application on Django (DRF + Angular). The current LTS version of Django 2.2. The required data is stored in the PostgreSQL 8.4 database. But Django 2.2 supports PostgreSQL 9.4 and higher. Update PostgreSQL is not possible. What to do in this situation? What are the options?
I think what you can do is to:
dump your information in the database to a separate file
uninstall and upgrade your postgres server
load the earlier dumped data back to your new database
Since I don't know your operating system so I can't give you clear command-line instructions, but do check out the docs. By the way, since you're changing, why not switch to Django 3 directly? Otherwise you might've to repeat this process again.
Hope this helps
Luckily you are on the minimum supported version for this, so you can use pg_upgrade to update your Postgres install (docs)
This way you don't need to dump/restore your database. The process is a little long-winded so I'll refrain from copying it all here in case this becomes out of date.
I'm following the guide to setup django-mongodb. But this line pip install git+https://github.com/django-nonrel/django#nonrel-1.5 always reverts my django to 1.5. Is there anyway that I can use lastest django?
That is because django-nonrelis a fork from the original Django project.
You can consider that as a different project.
django-nonrel was developed side by side with the original Django project until version 1.6, the last commit for nonrel is 2 years old.
To sum it up, if you want to use django-nonrel it is not recommended and you are limited to latest Django version it supports - 1.6.
The django-nonrel project is dead - If you want to use a NoSQL I will recommend not using Django.
There is't any official support for that, and I did not find any on-going projects (third-party) that exist anymore.
pip install git+https://github.com/django-nonrel/django#nonrel-1.6
The latest django-mongodb-engine is no longer operational. Using mongoengine alone will work only if your project does not use ANY contrib modules like, session, auth, user.
I recently came across another package called djongo. It is working fine on the latest version of Django.
Disclaimer: I have contributed to this package, but i am not trying to promote it anyway. I think it solves most of the Django MongoDB issues that have been around for ages and is extremely easy to use.
I am working with python's django framework. My models are sqlalchemy and my back-end database is mysql. How will I configure them?
Some links that might help you:
http://lethain.com/entry/2008/jul/23/replacing-django-s-orm-with-sqlalchemy/
http://code.google.com/p/django-sqlalchemy/
http://adam.gomaa.us/blog/2007/aug/26/the-django-orm-problem/
http://gitorious.org/django-sqlalchemy
See Django database installation,
If you’re using MySQL, you’ll need MySQLdb, version 1.2.1p2 or higher. You will also want to read the database-specific notes for the MySQL backend.
And the MySQL notes,
Django expects the database to support transactions, referential integrity, and Unicode (UTF-8 encoding). Fortunately, MySQL has all these features as available as far back as 3.23. While it may be possible to use 3.23 or 4.0, you'll probably have less trouble if you use 4.1 or 5.0.
I've been trying to get Django running and when going through the intro to projects it seems that I keep having trouble when I get to the 'sync database' section. When using InstantDjango this doesn't seem to be as much of a problem. My question is, can one just do Django development with the InstantDjango program or do you really need to run it the normal way?
InstantDjango uses sqlite by default. What database did you set your normal django to use? and you did you create that database before you ran the syncdb?
InstantDjango uses different packaging for all the django required libraries (portable versions) which might be less stable but they should work for your development needs.