R
R
Rustem Vorozheikin2015-05-11 14:30:11
Django
Rustem Vorozheikin, 2015-05-11 14:30:11

How to transfer data from one view to another in django?

Good afternoon.
Need advice/recommendation.
There is a view that, through the parameters passed in the url of the form /database/collection/, receives the actual parameters of the database and the collection, connects to the database and works with the data of this database. But there was a need to connect to the database on a remote machine by ip, port or to the database on this machine. But this is where I got stuck. How to carry out this operation correctly? I wanted to create a separate view for connecting to the base and a separate one for working with the base. But I did not figure out how to correctly transfer the data (the database to which I connected) from one view to another (where I work with the data of this database). Here the question arose, how to implement this process correctly in Django? And in general, am I doing the right thing?
I would be grateful for any help)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2015-05-11
@dmtrrr

It's a bad idea to pass database connection parameters in url. config is used for this purpose.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question