Skip to content

Commit bc9273c

Browse files
update Django readme
1 parent 98cb5d8 commit bc9273c

File tree

3 files changed

+48
-31
lines changed

3 files changed

+48
-31
lines changed

demos/django-todolist/README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PowerSync + Django Flutter Demo: Todo List App
22

3-
Demo app demonstrating use of the PowerSync SDK for Flutter together with the [demo Django backend](https://github.com/powersync-ja/powersync-django-backend-todolist-demo).
3+
Demo app demonstrating use of the PowerSync SDK for Flutter together with the [demo Django backend](https://github.com/powersync-ja/powersync-django-backend-todolist-demo).
44

55
# Running the app
66

@@ -12,17 +12,43 @@ Ensure you have [melos](https://melos.invertase.dev/~melos-latest/getting-starte
1212
4. Insert your Django URL and PowerSync project credentials into `lib/app_config.dart` (See instructions below)
1313
5. `flutter run`
1414

15-
# Set up Django project
15+
# Service Configuration
1616

17-
Follow the instructions in the django backend project's README.
17+
This demo can be used with cloud or local services.
18+
19+
## Local Services
20+
21+
The [Self Hosting Demo](https://github.com/powersync-ja/self-host-demo) repository contains a Docker Compose Django backend demo which can be used with this client.
22+
See [instructions](https://github.com/powersync-ja/self-host-demo/blob/main/demos/django/README.md) for starting the backend locally.
23+
24+
The backend demo should perform all the required setup automatically. A test user with the following credentials will be available:
25+
26+
```
27+
username: testuser
28+
password: testpassword
29+
```
30+
31+
### Android
32+
33+
Note that Android requires port forwarding of local services. These can be configured with ADB as below:
34+
35+
```bash
36+
adb reverse tcp:8080 tcp:8080 && adb reverse tcp:6061 tcp:6061
37+
```
38+
39+
## Cloud Services
40+
41+
### Set up Django project
42+
43+
Follow the instructions in the django backend project's README.
1844

1945
The instructions guide you through the following:
2046

2147
1. Creates `lists` and `todos` tables.
2248
2. Creates a test user.
2349
3. Create a logical replication publication called `powersync` for `lists` and `todos`.
2450

25-
# Set up PowerSync Instance
51+
### Set up PowerSync Instance
2652

2753
Create a new PowerSync instance by signing up for PowerSync Cloud at www.powersync.com, then connect to the database of your Django project.
2854

@@ -38,6 +64,6 @@ bucket_definitions:
3864
- select * from todos where list_id = bucket.list_id
3965
```
4066
41-
# Configure the app
67+
### Configure the app
4268
4369
Insert the credentials of your new Django backend and PowerSync projects into `lib/app_config.dart`
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copy this template: `cp lib/app_config_template.dart lib/app_config.dart`
22
// Edit lib/app_config.dart and enter your Django and PowerSync project details.
33
class AppConfig {
4-
static const String djangoUrl = 'https://foo.ngrok.app';
5-
static const String powersyncUrl =
6-
'https://myprojectid.powersync.journeyapps.com';
4+
// These are defaults when using the [self-host local demo](https://github.com/powersync-ja/self-host-demo/tree/main/demos/django)
5+
static const String djangoUrl = 'http://localhost:6061';
6+
static const String powersyncUrl = 'http://localhost:8080';
77
}

demos/django-todolist/macos/Podfile.lock

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
PODS:
2-
- app_links (1.0.0):
3-
- FlutterMacOS
42
- FlutterMacOS (1.0.0)
53
- path_provider_foundation (0.0.1):
64
- Flutter
@@ -12,41 +10,38 @@ PODS:
1210
- shared_preferences_foundation (0.0.1):
1311
- Flutter
1412
- FlutterMacOS
15-
- sqlite3 (3.46.0):
16-
- sqlite3/common (= 3.46.0)
17-
- sqlite3/common (3.46.0)
18-
- sqlite3/fts5 (3.46.0):
13+
- "sqlite3 (3.46.0+1)":
14+
- "sqlite3/common (= 3.46.0+1)"
15+
- "sqlite3/common (3.46.0+1)"
16+
- "sqlite3/dbstatvtab (3.46.0+1)":
17+
- sqlite3/common
18+
- "sqlite3/fts5 (3.46.0+1)":
1919
- sqlite3/common
20-
- sqlite3/perf-threadsafe (3.46.0):
20+
- "sqlite3/perf-threadsafe (3.46.0+1)":
2121
- sqlite3/common
22-
- sqlite3/rtree (3.46.0):
22+
- "sqlite3/rtree (3.46.0+1)":
2323
- sqlite3/common
2424
- sqlite3_flutter_libs (0.0.1):
2525
- FlutterMacOS
26-
- sqlite3 (~> 3.46.0)
26+
- "sqlite3 (~> 3.46.0+1)"
27+
- sqlite3/dbstatvtab
2728
- sqlite3/fts5
2829
- sqlite3/perf-threadsafe
2930
- sqlite3/rtree
30-
- url_launcher_macos (0.0.1):
31-
- FlutterMacOS
3231

3332
DEPENDENCIES:
34-
- app_links (from `Flutter/ephemeral/.symlinks/plugins/app_links/macos`)
3533
- FlutterMacOS (from `Flutter/ephemeral`)
3634
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
3735
- powersync_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/powersync_flutter_libs/macos`)
3836
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
3937
- sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`)
40-
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
4138

4239
SPEC REPOS:
4340
trunk:
4441
- powersync-sqlite-core
4542
- sqlite3
4643

4744
EXTERNAL SOURCES:
48-
app_links:
49-
:path: Flutter/ephemeral/.symlinks/plugins/app_links/macos
5045
FlutterMacOS:
5146
:path: Flutter/ephemeral
5247
path_provider_foundation:
@@ -57,19 +52,15 @@ EXTERNAL SOURCES:
5752
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
5853
sqlite3_flutter_libs:
5954
:path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos
60-
url_launcher_macos:
61-
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
6255

6356
SPEC CHECKSUMS:
64-
app_links: 10e0a0ab602ffaf34d142cd4862f29d34b303b2a
6557
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
66-
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
58+
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
6759
powersync-sqlite-core: 4c38c8f470f6dca61346789fd5436a6826d1e3dd
6860
powersync_flutter_libs: 1eb1c6790a72afe08e68d4cc489d71ab61da32ee
69-
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
70-
sqlite3: 154b084339ede06960a5b3c8160066adc9176b7d
71-
sqlite3_flutter_libs: 1be4459672f8168ded2d8667599b8e3ca5e72b83
72-
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
61+
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
62+
sqlite3: 292c3e1bfe89f64e51ea7fc7dab9182a017c8630
63+
sqlite3_flutter_libs: 5ca46c1a04eddfbeeb5b16566164aa7ad1616e7b
7364

7465
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
7566

0 commit comments

Comments
 (0)