On 05.06.2017 15:23, MOEGAMMAT FAIEEZ WHITE wrote:

Hi Jani,

i have direct access to the database where the form is stored. I GET the data using the imported requests e,g [r = requests.get(url, auth=HTTPBasicAuth('username', 'password'))]

So your remote database contains some kind of a form that you want to copy to Django database and then represent that form to end user?


so the user would have to input his/her user name and password , and the project name for which they want the forms for. i then create a model with only certain key value pairs i want from the database..

my main problem is the models.py and the database insertion of the forms.


If it's simple key and value pairs doing that isn't much to code, just add two fields that fullfil your requirement.

also i have a python script which fetches my data, i do not know how to use views.py to do it.


Same way as in your script, unless fetch is really slow when you need to think of asynchronous alternatives.



On Monday, June 5, 2017 at 2:07:08 PM UTC+2, Jani Tiainen wrote:

    Hi,

    First you need to decide how you are going to activate fetch data
    from remote company database.

    Is it a button in user interface, django management commant or
    maybe timed task?

    Secondly you need to decide how to actually fetch that data from
    remote company database

    Through RESTful API? Direct access to database? Some proprietary API?

    Finally you need to have models and do necessary data
    transformations to add data to your local Django database.

    But it's not a rocket science. Once you know answers, there are
    several tools that can help you to achieve your goal easier.

    On 05.06.2017 10:48, MOEGAMMAT FAIEEZ WHITE wrote:
    Hi i am new to Django, can you please guide me as to how i can
    fetch data from a companies database and insert it into my
    database. I have been reading about models.py and serializers.py
    and all tutorials and readings i came accross has online shown be
    how to display the database data onto the html and how to export
    data already in the database as json data.


    Disclaimer - This e-mail is subject to UWC policies and e-mail
    disclaimer published on our website at:
    https://www.uwc.ac.za/Pages/emaildisclaimer.aspx
    <https://www.uwc.ac.za/Pages/emaildisclaimer.aspx>




-- You received this message because you are subscribed to the
    Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to django-users...@googlegroups.com <javascript:>.
    To post to this group, send email to django...@googlegroups.com
    <javascript:>.
    Visit this group at https://groups.google.com/group/django-users
    <https://groups.google.com/group/django-users>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/django-users/51eb014a-88f7-48cb-b729-f3c6e32461d3%40googlegroups.com
    
<https://groups.google.com/d/msgid/django-users/51eb014a-88f7-48cb-b729-f3c6e32461d3%40googlegroups.com?utm_medium=email&utm_source=footer>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

-- Jani Tiainen



Disclaimer - This e-mail is subject to UWC policies and e-mail disclaimer published on our website at: https://www.uwc.ac.za/Pages/emaildisclaimer.aspx <https://www.uwc.ac.za/Pages/emaildisclaimer.aspx>




--
You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com <mailto:django-users+unsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5089b155-948f-4af6-aa80-bd45678b5f04%40googlegroups.com <https://groups.google.com/d/msgid/django-users/5089b155-948f-4af6-aa80-bd45678b5f04%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4e4a8dd6-1ca2-9ad4-773c-c6fec3e9eb56%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to