Thanks,
i manage to resolve that by creating a function on the conf.py file which
connect to the db, then call that function from view.py


conf.py

from sqlalchemy import*
def connect():
    engine=create_engine('mssql+pymssql://userbame:password@host /db')
    connection=engine.connect()
    return engine,connection

view.py
from userprofile.conf import *

engine,connection=connect()


On Wed, Mar 14, 2018 at 11:26 PM, Mahesh M J <ammasm...@gmail.com> wrote:

> Hi,
> You can try to create a Python module and write a parser there and set the
> variables. You can import that file in views.py and use it for getting the
> relevant values. Hope this helps.
>
> Thanks,
> Mahesh.
>
> On Tue, Mar 13, 2018 at 21:06 sum abiut <suab...@gmail.com> wrote:
>
>> I have a conf file containing the parameter of hostmane,db,usernam,pass,
>> db
>>
>> i want to import that file from view.py and use parameter from the conf
>> file to connect to a db.
>>
>> i did something this from appname.conf import but it doesn't seem to
>> work, appreciate any assistance.
>>
>> cheers
>>
>> --
>> 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/CAPCf-y5Og0o5yb_e%3D6ggLjS%
>> 2BOtDyZFUoqe_9KYZLbC1w72g7MA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAPCf-y5Og0o5yb_e%3D6ggLjS%2BOtDyZFUoqe_9KYZLbC1w72g7MA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> Mahesh M.J
> Bioinformatics Consultant
> Novartis Pharmaceuticals
> 1 Health Plaza, East Hanover
> <https://maps.google.com/?q=1+Health+Plaza,+East+Hanover+New+Jersey-07039&entry=gmail&source=g>
> New Jersey-07039
> <https://maps.google.com/?q=1+Health+Plaza,+East+Hanover+New+Jersey-07039&entry=gmail&source=g>
>
>
> --
> 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/CAHJ%2BPuSW1eb4t2bPvgnN8L_LAAt862wwYHCEjamhDRX3cW%2BR%
> 2Bg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHJ%2BPuSW1eb4t2bPvgnN8L_LAAt862wwYHCEjamhDRX3cW%2BR%2Bg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPCf-y7xSEOvsF9bb-VDZCKdAf4Cuin8_srkmJ0MQsQgRY0D0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to