Skip to content

Commit 28bc775

Browse files
authored
Merge pull request #155 from realpython/django-auth-views
Add README.md and requirements.txt
2 parents 4516618 + e8ddca1 commit 28bc775

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

django-view-auth/Blog/core/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def see_request(request):
2929
scheme: {request.scheme}
3030
path: {request.path}
3131
method: {request.method}
32-
GET: {request.GET}
33-
user: {request.user}
32+
GET: {request.GET}
33+
user: {request.user}
3434
"""
3535

3636
return HttpResponse(text, content_type="text/plain")

django-view-auth/Blog/db.sqlite3

-132 KB
Binary file not shown.

django-view-auth/Blog/pyflakes.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

django-view-auth/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Get Started With Django Part 3: Django View Authorization, Code Examples
2+
3+
This folder contains the sample code for [Get Started With Django Part 3: Django View Authorization](https://realpython.com/django-view-authorization/).
4+
5+
The code was tested with Python 3.8 and Django 3.0.7. To install the same version, use:
6+
7+
python -m pip install -r requirements.txt
8+
9+
This tutorial uses the Django admin, and comes with some sample data. To get going you will need to run the following commands:
10+
11+
cd Blog
12+
python manage.py migrate
13+
python manage.py createsuperuser
14+
python manage.py loaddata core.json
15+
16+
Once those commands are complete, you can run the Django development server:
17+
18+
python manage.py runserver
19+
20+
With the server running, visit `http://127.0.0.1:8000` in your web browser to see the results.

django-view-auth/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Django==3.0.7

0 commit comments

Comments
 (0)