# Question about Application env

**URL:** <https://forum.elixirforum.com/t/question-about-application-env/48851>\
**Category:** Questions\
**Tags:** application\
**Created:** [July 9, 2022, 10:11pm UTC](https://forum.elixirforum.com/t/question-about-application-env/48851 "2022-07-09T22:11:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RandomBritishGuy](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/r/ebca7d/32.png) [@RandomBritishGuy](https://forum.elixirforum.com/u/RandomBritishGuy)\
**Post date:** [July 9, 2022, 10:11pm UTC](https://forum.elixirforum.com/t/question-about-application-env/48851/1 "2022-07-09T22:11:51Z")

</div>

Hi guys!  
I would love to ask about Application environments. How can I use them via config/dev.ex file? Or via config/config.ex file? I had created one in that way:

```elixir
import Config
config :my_app, :key, :value

```

And then, I tried to get it using Application.get\_env(:my\_app, :key), and the result was nil.

The only way that worked for me was adding it directly through mix.exs into an application, as an environment - but that way does not satisfy me.  
Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![kokolegorille](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kokolegorille/32/4784_2.png) [@kokolegorille](https://forum.elixirforum.com/u/kokolegorille)\
**Post date:** [July 9, 2022, 10:15pm UTC](https://forum.elixirforum.com/t/question-about-application-env/48851/2 "2022-07-09T22:15:59Z")

</div>

Hello and welcome,

It should be working.

You also need something like this at the end of config/config.exs…

```elixir
import_config "#{config_env()}.exs"

```

… if You want to load environment config files (aka dev, prod, test + runtime)

Please show the relevant part of your files.  
Versions used also might give a clue (Elixir, Phoenix?!)

---

<div class="post-metadata">

**Author:** ![RandomBritishGuy](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/r/ebca7d/32.png) [@RandomBritishGuy](https://forum.elixirforum.com/u/RandomBritishGuy)\
**Post date:** [July 9, 2022, 10:36pm UTC](https://forum.elixirforum.com/t/question-about-application-env/48851/3 "2022-07-09T22:36:02Z")

</div>

Hi! The thing I needed was indeed

`import_config "#{config_env()}.exs"`

Thank you so much!
