# Deploying Daphne .env not found

**URL:** <https://forum.djangoproject.com/t/deploying-daphne-env-not-found/32264>\
**Category:** Deployment\
**Created:** [June 20, 2024, 7:10am UTC](https://forum.djangoproject.com/t/deploying-daphne-env-not-found/32264 "2024-06-20T07:10:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Birddle](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/birddle/32/18629_2.png) [@Birddle](https://forum.djangoproject.com/u/Birddle)\
**Post date:** [June 20, 2024, 7:10am UTC](https://forum.djangoproject.com/t/deploying-daphne-env-not-found/32264/1 "2024-06-20T07:10:31Z")

</div>

Im deploying a wsgi+asgi django project, it’s working when config wsgi application using gunicorn,  
but there has some wrong when i deploying daphne,  
first i write a file `/etc/systemd/system/daphne.service`

```auto
[Unit]
Description=WebSocket Daphne Service
After=network.target

[Service]
User=admin
Group=www-data
WorkingDirectory=/var/www/backend
# EnvironmentFile=/var/www/backend/main/.env
ExecStart=/var/www/backend/venv/bin/python /var/www/backend/venv/bin/daphne -b 0.0.0.0 -p 8001 main.asgi:application
[Install]
WantedBy=multi-user.target

```

When i start daphne.service, i got error:

```auto
Jun 20 06:58:34 linux systemd[1]: Stopping WebSocket Daphne Service...
Jun 20 06:58:35 linux systemd[1]: daphne.service: Succeeded.
Jun 20 06:58:35 linux systemd[1]: Stopped WebSocket Daphne Service.
Jun 20 06:58:35 linux systemd[1]: Started WebSocket Daphne Service.
Jun 20 06:58:37 linux python[41634]: 2024-06-20 06:58:37,300 INFO /var/www/backend/.env not found - if you're not configuring your environment separately, check this.

```

But why gunicorn is normal working and daphne is wrong.  
My project’s .env file path is `/backend/main/.env`,  
How should i do?
