Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from django.conf import settings #1

Open
cameel opened this issue Apr 27, 2018 · 6 comments
Open

from django.conf import settings #1

cameel opened this issue Apr 27, 2018 · 6 comments
Assignees
Labels
coding style python ready to implement When discussion is finished this label is given to indicate, that issues is ready for implementation

Comments

@cameel
Copy link
Member

cameel commented Apr 27, 2018

Proponuję dodać w coding style dla pythona:

W Django nigdy nie importujemy settingsów bezpośrednio (np. from <app> import settings). Zamiast tego robimy from django.conf import settings.

  • Bezpośrednie importowanie modułu z settingsami psuje opcję --settings= w manage.py. Nie można wtedy z linii komend podać innego modułu.
  • Bezpośrednie importowanie nie pozwala zmieniać wartości settingsów w testach za pomocą dekoratora override_settings.
@rwrzesien
Copy link

👍

3 similar comments
@bartoszbetka
Copy link

👍

@Jakub89
Copy link

Jakub89 commented May 7, 2018

👍

@dybi
Copy link

dybi commented May 18, 2018

👍

@dybi
Copy link

dybi commented Jun 12, 2018

Ogólnie chyba to issue odleżało już wystarczjąco długo bez sprzeciwów / z okejkami, więc chyba możemy to wpisać? ;)

@dybi dybi added the ready to implement When discussion is finished this label is given to indicate, that issues is ready for implementation label Jun 12, 2018
@cameel
Copy link
Member Author

cameel commented Jun 13, 2018

Tak, można dodawać.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coding style python ready to implement When discussion is finished this label is given to indicate, that issues is ready for implementation
Projects
None yet
Development

No branches or pull requests

5 participants