Skip to content

Improve README #9544

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,50 @@ INSTALLED_APPS = [
]
```

# Getting Started

To help you get started quickly with Django REST framework, follow these steps to create a simple API project.

### Step 1: Install Django and Django REST framework

First, make sure you have Python installed on your machine. You can install Django and Django REST framework using pip:

```bash
pip install django djangorestframework
```

### Step 2: Create a New Django Project

Create a new Django project by running the following command

```bash
django-admin startproject myproject
cd myproject
```

### Step 3: Create a New Django App

Next, create a new app within your project:

```bash
python manage.py startapp myapp
```

### Step 4: Update Settings

Add your new app and REST framework to the INSTALLED_APPS list in myproject/settings.py:

```bash
INSTALLED_APPS = [
...
'rest_framework',
'myapp',
]
```

Once you have follow the steps above, you should be able to use the REST framework. View the example below for extra details.


# Example

Let's take a look at a quick example of using REST framework to build a simple model-backed API for accessing users and groups.
Expand Down Expand Up @@ -167,6 +211,29 @@ Or to create a new user:
"is_staff": false,
}

# Common Issues and Solutions

### 1. Database Migrations

If you encounter issues related to database migrations, ensure that you have run:

```bash
python manage.py makemigrations
python manage.py migrate
```

### 2. Missing Packages

If you receive errors about missing packages, double-check that you have installed both Django and Django REST framework using pip.

### 3. Debugging Configuration Errors

For configuration issues, ensure that your settings.py file includes all necessary apps in the INSTALLED_APPS list, and that your URLs are correctly configured.

For more detailed troubleshooting, refer to the documentation provided below.



# Documentation & Support

Full documentation for the project is available at [https://www.django-rest-framework.org/][docs].
Expand Down
Loading