---
title: "Dokumentation för Django"
version: 6.0
locale: sv
source: https://docs.djangoproject.com/sv/6.0/
canonical: https://djangodocs.dev/sv/6.0/
---
# Dokumentation för Django

**Allt du behöver veta om Django.**

## Första stegen

Är du nybörjare på Django eller programmering? Det här är rätt plats att börja!

- **From scratch:**
  [Overview](/sv/6.0/intro/overview/) |
  [Installation](/sv/6.0/intro/install/)
- **Tutorial:**
  [Part 1: Requests and responses](/sv/6.0/intro/tutorial01/) |
  [Part 2: Models and the admin site](/sv/6.0/intro/tutorial02/) |
  [Part 3: Views and templates](/sv/6.0/intro/tutorial03/) |
  [Part 4: Forms and generic views](/sv/6.0/intro/tutorial04/) |
  [Part 5: Testing](/sv/6.0/intro/tutorial05/) |
  [Part 6: Static files](/sv/6.0/intro/tutorial06/) |
  [Part 7: Customizing the admin site](/sv/6.0/intro/tutorial07/) |
  [Part 8: Adding third-party packages](/sv/6.0/intro/tutorial08/)
- **Advanced Tutorials:**
  [How to write reusable apps](/sv/6.0/intro/reusable-apps/) |
  [Writing your first contribution to Django](/sv/6.0/intro/contributing/)

## Få hjälp

Problem? Vi hjälper gärna till!

- Try the [FAQ](/sv/6.0/faq/) – it’s got answers to many common questions.
- Looking for specific information? Try the [Index](/sv/6.0/genindex/), [Modulindex](/sv/6.0/py-modindex/) or
  the [detailed table of contents](/sv/6.0/contents/).
- Not found anything? See [FRÅGOR OCH SVAR: Få hjälp](/sv/6.0/faq/help/) for information on getting support
  and asking questions to the community.
- Rapportera buggar med Django i vår [ticket tracker](https://code.djangoproject.com/).

## Hur dokumentationen är organiserad

Django har mycket dokumentation. En översikt över hur den är organiserad kommer att hjälpa dig att veta var du kan hitta vad:

- [Handledningar](/sv/6.0/intro/) tar dig i handen genom en serie steg för att skapa en webbapplikation. Börja här om du är nybörjare på Django eller utveckling av webbapplikationer. Titta också på ”[Första stegen](#index-first-steps)”.
- [Topic guides](/sv/6.0/topics/) diskuterar viktiga ämnen och begrepp på en ganska hög nivå och ger användbar bakgrundsinformation och förklaringar.
- [Reference guides](/sv/6.0/ref/) innehåller tekniska referenser för API:er och andra aspekter av Djangos maskineri. De beskriver hur det fungerar och hur man använder det, men förutsätter att du har en grundläggande förståelse för nyckelbegrepp.
- [How-to guider](/sv/6.0/howto/) är recept. De guidar dig genom de steg som är involverade i att ta itu med viktiga problem och användningsfall. De är mer avancerade än handledningar och förutsätter viss kunskap om hur Django fungerar.

## Modellagret

Django tillhandahåller ett abstraktionslager (”modellerna”) för att strukturera och manipulera data i din webbapplikation. Läs mer om det nedan:

- **Models:**
  [Introduction to models](/sv/6.0/topics/db/models/) |
  [Field types](/sv/6.0/ref/models/fields/) |
  [Indexes](/sv/6.0/ref/models/indexes/) |
  [Meta options](/sv/6.0/ref/models/options/) |
  [Model class](/sv/6.0/ref/models/class/)
- **QuerySets:**
  [Making queries](/sv/6.0/topics/db/queries/) |
  [QuerySet method reference](/sv/6.0/ref/models/querysets/) |
  [Lookup expressions](/sv/6.0/ref/models/lookups/)
- **Model instances:**
  [Instance methods](/sv/6.0/ref/models/instances/) |
  [Accessing related objects](/sv/6.0/ref/models/relations/)
- **Migrations:**
  [Introduction to Migrations](/sv/6.0/topics/migrations/) |
  [Operations reference](/sv/6.0/ref/migration-operations/) |
  [SchemaEditor](/sv/6.0/ref/schema-editor/) |
  [Writing migrations](/sv/6.0/howto/writing-migrations/)
- **Advanced:**
  [Managers](/sv/6.0/topics/db/managers/) |
  [Raw SQL](/sv/6.0/topics/db/sql/) |
  [Transactions](/sv/6.0/topics/db/transactions/) |
  [Aggregation](/sv/6.0/topics/db/aggregation/) |
  [Search](/sv/6.0/topics/db/search/) |
  [Custom fields](/sv/6.0/howto/custom-model-fields/) |
  [Multiple databases](/sv/6.0/topics/db/multi-db/) |
  [Custom lookups](/sv/6.0/howto/custom-lookups/) |
  [Query Expressions](/sv/6.0/ref/models/expressions/) |
  [Conditional Expressions](/sv/6.0/ref/models/conditional-expressions/) |
  [Database Functions](/sv/6.0/ref/models/database-functions/)
- **Other:**
  [Supported databases](/sv/6.0/ref/databases/) |
  [Legacy databases](/sv/6.0/howto/legacy-databases/) |
  [Providing initial data](/sv/6.0/howto/initial-data/) |
  [Optimize database access](/sv/6.0/topics/db/optimization/) |
  [PostgreSQL specific features](/sv/6.0/ref/contrib/postgres/)

## Visningslagret

Django har konceptet ”views” för att kapsla in den logik som ansvarar för att behandla en användares begäran och för att returnera svaret. Hitta allt du behöver veta om vyer via länkarna nedan:

- **The basics:**
  [URLconfs](/sv/6.0/topics/http/urls/) |
  [View functions](/sv/6.0/topics/http/views/) |
  [Shortcuts](/sv/6.0/topics/http/shortcuts/) |
  [Decorators](/sv/6.0/topics/http/decorators/) |
  [Asynchronous Support](/sv/6.0/topics/async/)
- **Reference:**
  [Built-in Views](/sv/6.0/ref/views/) |
  [Request/response objects](/sv/6.0/ref/request-response/) |
  [TemplateResponse objects](/sv/6.0/ref/template-response/)
- **File uploads:**
  [Overview](/sv/6.0/topics/http/file-uploads/) |
  [File objects](/sv/6.0/ref/files/file/) |
  [Storage API](/sv/6.0/ref/files/storage/) |
  [Managing files](/sv/6.0/topics/files/) |
  [Custom storage](/sv/6.0/howto/custom-file-storage/)
- **Class-based views:**
  [Overview](/sv/6.0/topics/class-based-views/) |
  [Built-in display views](/sv/6.0/topics/class-based-views/generic-display/) |
  [Built-in editing views](/sv/6.0/topics/class-based-views/generic-editing/) |
  [Using mixins](/sv/6.0/topics/class-based-views/mixins/) |
  [API reference](/sv/6.0/ref/class-based-views/) |
  [Flattened index](/sv/6.0/ref/class-based-views/flattened-index/)
- **Advanced:**
  [Generating CSV](/sv/6.0/howto/outputting-csv/) |
  [Generating PDF](/sv/6.0/howto/outputting-pdf/)
- **Middleware:**
  [Overview](/sv/6.0/topics/http/middleware/) |
  [Built-in middleware classes](/sv/6.0/ref/middleware/)

## Mallagret

Mallagret tillhandahåller en designvänlig syntax för rendering av den information som ska presenteras för användaren. Lär dig hur den här syntaxen kan användas av designers och hur den kan utökas av programmerare:

- **The basics:**
  [Overview](/sv/6.0/topics/templates/)
- **For designers:**
  [Language overview](/sv/6.0/ref/templates/language/) |
  [Built-in tags and filters](/sv/6.0/ref/templates/builtins/) |
  [Humanization](/sv/6.0/ref/contrib/humanize/)
- **For programmers:**
  [Template API](/sv/6.0/ref/templates/api/) |
  [Custom tags and filters](/sv/6.0/howto/custom-template-tags/) |
  [Custom template backend](/sv/6.0/howto/custom-template-backend/)

## Formulär

Django tillhandahåller ett rikt ramverk för att underlätta skapandet av formulär och hanteringen av formulärdata.

- **The basics:**
  [Overview](/sv/6.0/topics/forms/) |
  [Form API](/sv/6.0/ref/forms/api/) |
  [Built-in fields](/sv/6.0/ref/forms/fields/) |
  [Built-in widgets](/sv/6.0/ref/forms/widgets/)
- **Advanced:**
  [Forms for models](/sv/6.0/topics/forms/modelforms/) |
  [Integrating media](/sv/6.0/topics/forms/media/) |
  [Formsets](/sv/6.0/topics/forms/formsets/) |
  [Customizing validation](/sv/6.0/ref/forms/validation/)

## Utvecklingsprocessen

Lär dig mer om de olika komponenterna och verktygen som hjälper dig att utveckla och testa Django-applikationer:

- **Settings:**
  [Overview](/sv/6.0/topics/settings/) |
  [Full list of settings](/sv/6.0/ref/settings/)
- **Applications:**
  [Overview](/sv/6.0/ref/applications/)
- **Exceptions:**
  [Overview](/sv/6.0/ref/exceptions/)
- **django-admin and manage.py:**
  [Overview](/sv/6.0/ref/django-admin/) |
  [Adding custom commands](/sv/6.0/howto/custom-management-commands/)
- **Testing:**
  [Introduction](/sv/6.0/topics/testing/) |
  [Writing and running tests](/sv/6.0/topics/testing/overview/) |
  [Included testing tools](/sv/6.0/topics/testing/tools/) |
  [Advanced topics](/sv/6.0/topics/testing/advanced/)
- **Deployment:**
  [Overview](/sv/6.0/howto/deployment/) |
  [WSGI servers](/sv/6.0/howto/deployment/wsgi/) |
  [ASGI servers](/sv/6.0/howto/deployment/asgi/) |
  [Deploying static files](/sv/6.0/howto/static-files/deployment/) |
  [Tracking code errors by email](/sv/6.0/howto/error-reporting/) |
  [Deployment checklist](/sv/6.0/howto/deployment/checklist/)

## Administratören

Här hittar du allt du behöver veta om det automatiserade admin-gränssnittet, en av Djangos mest populära funktioner:

- [Admin site](/sv/6.0/ref/contrib/admin/)
- [Admin actions](/sv/6.0/ref/contrib/admin/actions/)
- [Admin documentation generator](/sv/6.0/ref/contrib/admin/admindocs/)

## Säkerhet

Säkerhet är ett ämne av yttersta vikt vid utvecklingen av webbapplikationer och Django tillhandahåller flera skyddsverktyg och mekanismer:

- [Security overview](/sv/6.0/topics/security/)
- [Disclosed security issues in Django](/sv/6.0/releases/security/)
- [Clickjacking protection](/sv/6.0/ref/clickjacking/)
- [Cross Site Request Forgery protection](/sv/6.0/ref/csrf/)
- [Cryptographic signing](/sv/6.0/topics/signing/)
- [Security Middleware](/sv/6.0/ref/middleware/#security-middleware)
- [Content Security Policy](/sv/6.0/ref/csp/)

## Internationalisering och lokalisering

Django erbjuder ett robust ramverk för internationalisering och lokalisering som hjälper dig att utveckla applikationer för flera språk och världsregioner:

- [Overview](/sv/6.0/topics/i18n/) |
  [Internationalization](/sv/6.0/topics/i18n/translation/) |
  [Localization](/sv/6.0/topics/i18n/translation/#how-to-create-language-files) |
  [Localized web UI formatting and form input](/sv/6.0/topics/i18n/formatting/)
- Tidszoner

## Prestanda och optimering

Det finns en mängd olika tekniker och verktyg som kan hjälpa dig att få din kod att köras mer effektivt - snabbare och med mindre systemresurser.

- [Performance and optimization overview](/sv/6.0/topics/performance/)

## Geografiskt ramverk

[GeoDjango](/sv/6.0/ref/contrib/gis/) intends to be a world-class
geographic web framework. Its goal is to make it as easy as possible to build
GIS web applications and harness the power of spatially enabled data.

## Vanliga verktyg för webbapplikationer

Django erbjuder flera verktyg som ofta behövs vid utveckling av webbapplikationer:

- **Authentication:**
  [Overview](/sv/6.0/topics/auth/) |
  [Using the authentication system](/sv/6.0/topics/auth/default/) |
  [Password management](/sv/6.0/topics/auth/passwords/) |
  [Customizing authentication](/sv/6.0/topics/auth/customizing/) |
  [API Reference](/sv/6.0/ref/contrib/auth/)
- [Caching](/sv/6.0/topics/cache/)
- [Logging](/sv/6.0/topics/logging/)
- [Tasks framework](/sv/6.0/topics/tasks/)
- [Sending emails](/sv/6.0/topics/email/)
- [Syndication feeds (RSS/Atom)](/sv/6.0/ref/contrib/syndication/)
- [Pagination](/sv/6.0/topics/pagination/)
- [Messages framework](/sv/6.0/ref/contrib/messages/)
- [Serialization](/sv/6.0/topics/serialization/)
- [Sessions](/sv/6.0/topics/http/sessions/)
- [Sitemaps](/sv/6.0/ref/contrib/sitemaps/)
- [Static files management](/sv/6.0/ref/contrib/staticfiles/)
- [Data validation](/sv/6.0/ref/validators/)

## Andra centrala funktioner

Lär dig mer om några andra centrala funktioner i Django-ramverket:

- [Conditional content processing](/sv/6.0/topics/conditional-view-processing/)
- [Content types and generic relations](/sv/6.0/ref/contrib/contenttypes/)
- [Flatpages](/sv/6.0/ref/contrib/flatpages/)
- [Redirects](/sv/6.0/ref/contrib/redirects/)
- [Signals](/sv/6.0/topics/signals/)
- [System check framework](/sv/6.0/topics/checks/)
- [The sites framework](/sv/6.0/ref/contrib/sites/)
- [Unicode in Django](/sv/6.0/ref/unicode/)

## Django-projektet med öppen källkod

Lär dig mer om utvecklingsprocessen för själva Django-projektet och om hur du kan bidra:

- **Community:**
  [Contributing to Django](/sv/6.0/internals/contributing/) |
  [The release process](/sv/6.0/internals/release-process/) |
  [Team organization](/sv/6.0/internals/organization/) |
  [The Django source code repository](/sv/6.0/internals/git/) |
  [Security policies](/sv/6.0/internals/security/) |
  [Mailing lists and Forum](/sv/6.0/internals/mailing-lists/)
- **Design philosophies:**
  [Overview](/sv/6.0/misc/design-philosophies/)
- **Documentation:**
  [About this documentation](/sv/6.0/internals/contributing/writing-documentation/)
- **Third-party distributions:**
  [Overview](/sv/6.0/misc/distributions/)
- **Django over time:**
  [API stability](/sv/6.0/misc/api-stability/) |
  [Release notes and upgrading instructions](/sv/6.0/releases/) |
  [Deprecation Timeline](/sv/6.0/internals/deprecation/)
