---
title: "Często zadawane pytania: Używanie Django"
version: 1.10
locale: pl
source: https://docs.djangoproject.com/pl/1.10/faq/usage/
canonical: https://djangodocs.dev/pl/1.10/faq/usage/
---
# Często zadawane pytania: Używanie Django

## Dlaczego otrzymuję błąd dotyczący dołączania DJANGO\_SETTINGS\_MODULE?

Upewnij się, że:

- Zmienna środowiskowa DJANGO\_SETTINGS\_MODULE jest ustawiona na w pełni kwalifikowany moduł Pythona (np. „mysite.settings”).
- Wspomniany moduł jest na `sys.path` (`import mysite.settings` powinno zadziałać).
- Moduł nie zawiera błędów składniowych (oczywiście).

## Nie mogę znieść waszego języka szablonów. Czy muszę go używać?

We happen to think our template engine is the best thing since chunky bacon,
but we recognize that choosing a template language runs close to religion.
There’s nothing about Django that requires using the template language, so
if you’re attached to Jinja2, Mako, or whatever, feel free to use those.

## Czy muszę używać waszej warstwy modelu/bazy danych?

Nie. Tak jak system szablonów, warstwa modelu/bazy danych jest uniezależniona od reszty frameworka.

The one exception is: If you use a different database library, you won’t get to
use Django’s automatically-generated admin site. That app is coupled to the
Django database layer.

## Jak używać pól grafik i plików?

Użycie klas [`FileField`](/pl/1.10/ref/models/fields/#django.db.models.FileField) lub [`ImageField`](/pl/1.10/ref/models/fields/#django.db.models.ImageField) w modelu wymaga kilku kroków:

1. In your settings file, you’ll need to define [`MEDIA_ROOT`](/pl/1.10/ref/settings/#std-setting-MEDIA_ROOT) as
   the full path to a directory where you’d like Django to store uploaded
   files. (For performance, these files are not stored in the database.)
   Define [`MEDIA_URL`](/pl/1.10/ref/settings/#std-setting-MEDIA_URL) as the base public URL of that directory.
   Make sure that this directory is writable by the Web server’s user
   account.
2. Add the [`FileField`](/pl/1.10/ref/models/fields/#django.db.models.FileField) or
   [`ImageField`](/pl/1.10/ref/models/fields/#django.db.models.ImageField) to your model, defining the
   [`upload_to`](/pl/1.10/ref/models/fields/#django.db.models.FileField.upload_to) option to specify a
   subdirectory of [`MEDIA_ROOT`](/pl/1.10/ref/settings/#std-setting-MEDIA_ROOT) to use for uploaded files.
3. All that will be stored in your database is a path to the file
   (relative to [`MEDIA_ROOT`](/pl/1.10/ref/settings/#std-setting-MEDIA_ROOT)). You’ll most likely want to use the
   convenience [`url`](/pl/1.10/ref/models/fields/#django.db.models.fields.files.FieldFile.url) attribute
   provided by Django. For example, if your
   [`ImageField`](/pl/1.10/ref/models/fields/#django.db.models.ImageField) is called `mug_shot`, you can get
   the absolute path to your image in a template with
   `{{ object.mug_shot.url }}`.

## Jak stworzyć zmienną dostępną we wszystkich moich szablonach?

Sometimes your templates just all need the same thing. A common example would
be dynamically-generated menus. At first glance, it seems logical to simply
add a common dictionary to the template context.

Poprawnym rozwiązaniem jest użycie `RequestContext`. Szczegóły odnośnie jego użycia znajdziesz tutaj: [Using RequestContext](/pl/1.10/ref/templates/api/#subclassing-context-requestcontext).
