# Django pg\_service.conf setup

**URL:** <https://forum.djangoproject.com/t/django-pg-service-conf-setup/21677>\
**Category:** Getting Started\
**Created:** [June 17, 2023, 8:01am UTC](https://forum.djangoproject.com/t/django-pg-service-conf-setup/21677 "2023-06-17T08:01:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NDH001](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ndh001/32/14281_2.png) [@NDH001](https://forum.djangoproject.com/u/NDH001)\
**Post date:** [June 17, 2023, 8:01am UTC](https://forum.djangoproject.com/t/django-pg-service-conf-setup/21677/1 "2023-06-17T08:01:53Z")

</div>

I was going through the second tutorial on django and then i came across this topic on setting up the postgres database backend. So I tried to put in the default parameters and run the migrate command, which worked as planned. However, instead of entering the default parameters, I also want to try out the instructions on this page (original url → [Databases | Django documentation | Django](https://docs.djangoproject.com/en/4.2/ref/databases/#third-party-notes) ):

 ![Screenshot (534)](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/1/1736e6d3187eb7bdbb92380d0e875a271d24886d.png)

But I do not understand how the pg\_service.conf file work, where should I put the pg\_service.conf file?  
Also, i read on the postgres documentation on this url → [PostgreSQL: Documentation: 15: 34.17.&nbsp;The Connection Service File](https://www.postgresql.org/docs/current/libpq-pgservice.html) and some more questions arised.

1. Is pg\_service.conf and .pg\_service.conf (with a dot at the front) different files?
2. The documentation stated that the .pg\_service.conf is named %APPDATA%\postgresql.pg\_service.conf on windows which is a directory i can not find.
3. The documentation also stated that we can check for the sysconfigdir environment variable and point it to somewhere else, but when i checked for the sysconfigdir path, it is pointing to C:/PROGRA~1/POSTGR~1/15/etc which again, is a directory i can not find : to be specific, i can not find the etc file stated in the pathing.

I have tried to put the .pg\_service.conf files in various place and have no success, and tried to search for a solution on the web for two days with questions like postgres service files, django postgres service files, postgres config files etc , but nothing is relating to what i am searching for, i would really appreaciate it if someone could point me to the right direction. Much thanks
