That might be a very silly question, but how can I open a mongodb database?
Here is the setup: I have another computer where a bmongo database is continuously feeded by some python program (using pymongo). The dbpath of the mongodb database is on dropbox, so that I can access the data while on the go.
Problem: How can I open these data on my machine? I dont see which servers settings I should use.
Thanks!
Related
Is there any way to convert an app written with kivy, python to use an online mysql database, this is usually straight forward for web apps written in python, how about desktop apps written in platforms like kivy and Tkinter that want to use an online mysql database for data sharing?
For this purpose you need a remote mysql server. A local mysql database will only take changes locally, within your computer, but a remote database, will accept data given to them from any device connected to it. There are paid and non paid websites that provide such hosting. Here are some free ones:
FreeMySQLHosting
RemoteMySQL
FreeSQLdatabase
db4free
What you should be looking for is "remote" mysql databases because some online database wont allow you to write to it.
Take a look at this answer for some explanation
I'm a noobie to Django and I'm almost at the stage of deploying a web server.
I was just having some doubts with Django's database. Currently I'm using the default sqlite3 database to store all the user models as well as the info models. I'm thinking of using AWS to deploy my web sever.
So when I get to that stage, should I continue with sqlite or should I switch to AWS's database or something like Firebase. If I continue with sqlite, where and how exactly will the information be stored? And what if I switch to something like PostgreSQL, where will the information be stored and will it be secure/fast (even if I manage to get thousands of users)?
Thanks so much, this question might be really basic but I'm super confused.
sqlite is a flat file database, it uses an exposed file in your project to save your data, this is fine in local environment, but when deploying you need to consider that the server and the database are in the same machine and using the same disk. that means if you accidentally remove the machine -and its disk space- used to serve the application, then the database itself will be deleted with all records.
Plus you will face problems if you tried to scale your servers, that is every server will have his own copy of the database and syncing all those files will be huge headache.
If your data is not that important then you can keep using sqlite, but if you are expecting high traffic and complex db structure, then I would recommend you consider a db engine like Mysql or maybe look up the databases offered by amazon here:
https://aws.amazon.com/products/databases/
For django, you will need to change the adapter when using a different db like mysql, sqlite or anything else.
https://docs.djangoproject.com/en/3.0/ref/databases/
So mysql works great when you log into your mysql database program on that device but what if you want to move the program to another device, the connected databases wont work...
Is there anyway to have the database somehow within the python file, so that when I move it to other devices it will act the same...Thank you!
Assuming you want to store some simple information, Sqlite3 does exact what you're looking for. This is a sql database that is entirely run on a file on the hardrive that the application is running from.
But be careful what you put in this database. This is not meant to be a high performance database, and will crumble if you stress it too much.
Yes, use a database external to the host. You can then use DNS or an ip address to access the mysql database as long as the new device has connectivity to the database. For mobile apps and mobile devices, build out an API on top of the data that you'd like to be able to access and then secure the API with appropriate credentials.
I have been trying to save some data into txt files, but now I have decided to use a database to store these values. But I can't seem to find how can this be achieved, I've read through some tutorials but they all seem to be for online app building.
Are there any modules that can be used to create MySQL database on my hard disk , are there any alternatives ?
Is it necessary to make a server even if i'm using the database on the same computer for some local stuff ?
If you only need a local database, you can use the builtin sqlite3-database.
I'm in the process of porting over a MySQL database to a Heroku hosted, dedicated PostgreSQL instance. I understand how to get the initial data over to Heroku. However, there is a daily "feed" of data from an external company that will need to be imported each day. It is pushed up to an FTP server and it's a zip file containing several different CSV files. Normally, I could/would just scp it over to the Postgres box and then have a cron job that does a "COPY tablename FROM path/to/file.csv" to import the data. However, using Heroku has me a bit baffled as to the best way to do this. Note: I've seen and reviewed the heroku dev article on importing data. But, this is more of a dump file. I'm just dealing with a daily import from a CSV file.
Does anyone do something similar to this on Heroku? If so, can you give any advice on what's the best way.
Just a bit more info: My application is Python/Django 1.3.3 on the Cedar stack. And my files can be a bit large. Some of them can be over 50K records. So, to loop through them and use the Django ORM is probably going to be a bit slow (but, still might be the best/only solution).
Two options:
Boot up a non-heroku EC2 instance, fetch from FTP, unzip and initiate the copy from there. By making use of the COPY STDIN option (http://www.postgresql.org/docs/9.1/static/sql-copy.html) you can instruct it that the data is coming from the client connection, as opposed to from a file on the server's filesystem which you don't have access to.
How large is the file? It might fit in a dyno's ephemeral filesystem, so a process or one off job can download the file from the FTP server and do the whole process from within a dyno. Once the process exits, away goes the filesystem data.