Skip to content

Commit 49a3eb5

Browse files
author
christofer holm
committed
Documentation on local djongo development
1 parent b99adcb commit 49a3eb5

File tree

7 files changed

+90
-76
lines changed

7 files changed

+90
-76
lines changed

docs/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ defaults:
171171
share: false
172172
comments: false
173173
toc: true
174-
toc_sticky: false
174+
toc_sticky: true
175175
debug: false
176176
sidebar:
177177
nav: "docs"

docs/assets/images/admin.png

14 KB
Loading
11.2 KB
Loading

docs/assets/images/embedded-admin.png

31.9 KB
Loading
30.7 KB
Loading

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<title>
6-
Djongo - MongoDB Django Hosting
6+
Djongo - MongoDB Django Connector
77
</title>
88
<meta content="Djongo is a smarter approach to database querying. It maps python objects to MongoDB documents. It is popularly referred to as an Object Document Mapper or ODM. It is an extension to the traditional Django object relational modeling framework. Use Django Admin to directly add and modify documents stored in MongoDB. Use other contrib modules such as Auth and Sessions without any changes." name="description">
99
<meta content="website" property="og:type">

docs/markdown/documentation/get-started.md

Lines changed: 88 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ to your instance will appear in the dashboard. You can upload your app specific
1818

1919
## Local Development
2020

21-
### Setup
22-
For a local installation start with:
23-
1. `pip install djongo`
21+
### Prerequisites
22+
23+
* You have a DjongoCS account.
24+
* Your access credentials have been successfully [setup](#generate-access-token).
25+
26+
### Steps
27+
28+
1. Type `pip install --extra-index-url https://pypi.djongomapper.com/latest-updates/ djongo`
2429
2. Into `settings.py` file of your project, add:
2530

2631
```python
@@ -32,16 +37,9 @@ For a local installation start with:
3237
}
3338
```
3439

35-
### Requirements
36-
1. Python 3.6 or higher.
37-
2. MongoDB 3.4 or higher.
38-
3. If your models use nested queries or sub querysets like:
39-
40-
```python
41-
inner_query = Blog.objects.filter(name__contains='Ch').values('name')
42-
entries = Entry.objects.filter(blog__name__in=inner_query)
43-
```
44-
MongoDB 3.6 or higher is required.
40+
Alternatively, you can install an older version directly from pypi:
41+
42+
* Type `pip install djongo`
4543

4644
## MongoDB and Django
4745

@@ -144,66 +142,6 @@ All options except `ENGINE` and `ENFORCE_SCHEMA` are the same those listed in th
144142
}
145143
```
146144

147-
## DjongoCS
148-
149-
Djongo Cloud Server is the fastest way to deploy to the cloud your djongo powered apps. The DjongoCS package and
150-
dependencies come preconfigured and installed on the [Cloud][support_page].
151-
152-
### SSH
153-
On account creation you install your public SSH key at the [dashboard](/djongocs/dashboard/).
154-
This gives a secure shell access to the VM instance for uploading a
155-
[Django App](https://docs.djangoproject.com/en/dev/intro/tutorial01/). Once the key is installed,
156-
the dashboard displays the SSH port number over which you can connect to the VM instance.
157-
158-
Establish a secure shell connection using:
159-
160-
```shell
161-
ssh <user>@api.djongomapper.com -p <port>
162-
```
163-
164-
The `user` is the same as the username used while creating the account.
165-
166-
### Public API
167-
When you create an account on DjongoCS you get a unique URL path assigned to you. The Django views that you
168-
create for servicing your API can be accessed and extended further starting from the base URL:
169-
170-
```shell
171-
https://api.djongomapper.com/<user>
172-
```
173-
174-
### Launching the App
175-
176-
Establishing a SSH connection to your server logs you into the `/home/$USER` directory. The typical home directory
177-
structure looks like:
178-
179-
```shell
180-
~home
181-
| -- .ssh/
182-
| -- site/
183-
| -- api/
184-
| -- settings.py
185-
| -- urls.py
186-
| -- apps/
187-
| -- app1/
188-
| -- views.py
189-
| -- models.py
190-
| -- app2/
191-
| -- views.py
192-
| -- models.py
193-
```
194-
195-
In your `urls.py` if you add an entry like `path('hello/', app1.views.hello)`, the URL path becomes
196-
`https://api.djongomapper.com/<user>/hello`
197-
198-
#### Reload the Server
199-
After making changes to your app, you need to reload the server. This is done by clicking the reload button
200-
in your [dashboard](/djongocs/dashboard/).
201-
202-
{% comment %}
203-
### Installing dependencies
204-
205-
{% endcomment %}
206-
207145
## Security and Integrity Checks
208146
Djongo allows for checks on data fields before they are saved to the database. Running the correct integrity checks and field value validators before writing data into the database is important.
209147

@@ -338,9 +276,85 @@ avatar = models.ImageField(storage=grid_fs_storage, upload_to='')
338276

339277
Refer to [Using GridFSStorage](/using-django-with-mongodb-gridfs/) for more details.
340278

279+
280+
## DjongoCS
281+
282+
Djongo Cloud Server is the fastest way to deploy to the cloud your djongo powered apps. The DjongoCS package and
283+
dependencies come preconfigured and installed on a Google Cloud Platform server.
284+
285+
### Generate access token
286+
287+
Once logged into the [dashboard](/djongocs/dashboard/) click on _generate token_. This generates installs a pass token
288+
needed for downloading the latest version of djongo for local development.
289+
Copy and add the generated token into the `~/.netrc` file located in
290+
your home directory.
291+
292+
293+
```shell
294+
machine pypi.djongomapper.com
295+
login <djongocs username>
296+
password <generated token>
297+
```
298+
299+
You can then install the latest version of djongo:
300+
301+
```shell
302+
pip install --extra-index-url https://pypi.djongomapper.com/latest-updates/ djongo
303+
```
304+
305+
Make sure to safely install and store the pass token. This is not saved on the DjongoCS server locally.
306+
307+
### SSH
308+
On account creation you install your public SSH key at the dashboard.
309+
This gives the SSH access to the VM instance for uploading a
310+
[Django App](https://docs.djangoproject.com/en/dev/intro/tutorial01/). Once the key is installed,
311+
the dashboard displays the SSH port number over which you can connect to the VM instance.
312+
313+
Establish a secure shell connection using:
314+
315+
```shell
316+
ssh <username>@api.djongomapper.com -p <port>
317+
```
318+
319+
The `username` is the same as the username used while creating the DjongoCS account.
320+
321+
322+
When you create an account on DjongoCS you get a unique URL path assigned to you. The Django views that you
323+
create for servicing your API can be accessed
324+
and extended further starting from the base URL `https://api.djongomapper.com/<username>`
325+
326+
### Launching the App
327+
Establishing an SSH connection to your server logs you into the `/home/$USER` directory. The typical home directory
328+
structure looks like:
329+
330+
```shell
331+
~home
332+
| -- .ssh/
333+
| -- site/
334+
| -- api/
335+
| -- settings.py
336+
| -- urls.py
337+
| -- apps/
338+
| -- app1/
339+
| -- views.py
340+
| -- models.py
341+
| -- app2/
342+
| -- views.py
343+
| -- models.py
344+
```
345+
346+
In your `urls.py` if you add an entry like `path('hello/', app1.views.hello)`, the URL path becomes
347+
`https://api.djongomapper.com/<username>/hello`
348+
349+
350+
{% comment %}
351+
### Installing dependencies
352+
353+
{% endcomment %}
354+
341355
## DjongoCS Features
342356

343-
Features under development on DjongoCS are not a part of the standard Djongo package. Visit the [support page][support_page] for more information.
357+
Features under development on DjongoCS are not a part of the standard Djongo package.
344358
{: .notice--info}
345359

346360
DjongoCS supports multiple features of MongoDB including:

0 commit comments

Comments
 (0)