Skip to content

Commit 0d772fd

Browse files
committed
add instructions for demo app
1 parent 207c1ed commit 0d772fd

File tree

4 files changed

+55
-4
lines changed

4 files changed

+55
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ a set of Django apps to include and configure in your settings, but a
2121
collection of mixins, base classes, base views and simple templates
2222
that you can integrate and customize in your own apps.
2323

24+
See the [demo](demo/) app for example usage.
25+
2426
⚠️ This library is not stable yet, make sure to pin your dependencies.
2527
Recommended form: `rest-framework-auth-toolkit == 0.9.*`

demo/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Demo application for Rest-Framework-Auth-Toolkit
2+
3+
This is a minimal Django project that shows how to use
4+
the package and helps checking if changes break usage.
5+
6+
## How to install
7+
8+
Run this command once from the repository root:
9+
10+
```
11+
python setup-develop.py develop
12+
```
13+
14+
This makes the package `rest_auth_toolkit` importable by the demo app,
15+
with local changes immediately seen.
16+
17+
Go in the `demo` directory and install the other dependencies:
18+
19+
```
20+
pip install -r requirements.txt
21+
```
22+
23+
# How to run
24+
25+
Define the environment variables needed by the app:
26+
27+
```
28+
export DEMO_FACEBOOK_APP_ID="..."
29+
export DEMO_FACEBOOK_SECRET_KEY="..."
30+
```
31+
32+
(using a [virtualenvwrapper hook](https://virtualenvwrapper.readthedocs.io/en/latest/scripts.html#postactivate)
33+
or a `.env` file with [direnv](https://direnv.net/) is a good ideae to make this automatic)
34+
35+
You can then run Django commands:
36+
37+
```
38+
python manage.py migrate
39+
python manage.py runserver
40+
```

demo/requirements.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ django-debug-toolbar
77
django-model-utils
88
django-shortuuidfield
99

10-
# Note: rest-framework-auth-toolkit is not here, it should already
11-
# be importable if you do "pip install -e ." from your dev virtualenv.
12-
# We do include facepy here to make sure requirements.txt
13-
# contains all transitive dependencies.
10+
# TODO add develop install for rest-framework-auth-toolkit
11+
# (when pip supports PEP 517); see README for how to install rest-auth-toolkit
12+
#-e ..[facebook]
13+
# In the meantime we include facepy here to make sure requirements.txt
14+
# contains all transitive dependencies
1415
facepy
1516

1617
# for the browsable API

setup-develop.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from setuptools import setup
2+
3+
import rest_auth_toolkit
4+
5+
setup(
6+
name='Rest-Framework-Auth-Toolkit',
7+
version=rest_auth_toolkit.__version__,
8+
)

0 commit comments

Comments
 (0)