You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/from-scratch/README.md
+43-7Lines changed: 43 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,19 @@
2
2
3
3
This example shows how to use django-spanner for Cloud Spanner as a backend database for [Django's tutorials](https://docs.djangoproject.com/en/2.2/intro/tutorial01/)
4
4
5
+
*NOTE:* Use the version of python-spanner-django that corresponds to your version of Django. For example, python-spanner-django 2.2.x works with Django 2.2.y. (This is the only supported version at this time.)
6
+
5
7
### Walkthrough the introduction to Django
6
8
7
9
### Install django-spanner
8
-
We'll need to install `django-spanner`, by cloning this repository and then running `pip3 install`
After this you should can see the tables and indices created in your Cloud Spanner console
119
+
105
120
### Now run your server
106
121
After those migrations are completed, that will be all. Please continue on with the guides.
107
122
123
+
### Create an Django admin user
124
+
First you’ll need to create a user who can login to the admin site. Run the following command:
125
+
126
+
```shell
127
+
$ python3 manage.py createsuperuser
128
+
```
129
+
which will then produce a prompt which will allow you to create your super user
130
+
```shell
131
+
Username: admin
132
+
Email address: admin@example.com
133
+
Password: **********
134
+
Password (again): **********
135
+
Superuser created successfully.
136
+
```
137
+
138
+
### Login as admin
139
+
Let’s run the server
140
+
```shell script
141
+
python3 manage.py runserver
142
+
```
143
+
Then visit http://127.0.0.1:8000/admin/
144
+
108
145
### Comprehensive hands-on guide
109
146
For a more comprehensive, step by step hands-on guide, please visit [using django-spanner from scratch](https://orijtech-161805.firebaseapp.com/quickstart/new_app/)
0 commit comments