Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
djangoldp-packages
djangoldp
Commits
43d4bf7b
Commit
43d4bf7b
authored
6 years ago
by
Sylvain Le Bon
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
1d5723d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+11
-10
11 additions, 10 deletions
README.md
with
11 additions
and
10 deletions
README.md
+
11
−
10
View file @
43d4bf7b
...
...
@@ -12,19 +12,19 @@ It aims at enabling people with little development skills to serve their own dat
## Installation
1.
Install this module and all its dependencies
### 1-
Install this module and all its dependencies
```
pip install djangoldp
```
2.
Create a django project
### 2-
Create a django project
```
django-admin startproject myldpserver
```
3.
Create your django model inside a file myldpserver/myldpserver/models.py
### 3-
Create your django model inside a file myldpserver/myldpserver/models.py
```
from django.db import models
...
...
@@ -35,29 +35,30 @@ class Todo(models.Model):
```
3.
Add a url in your urls.py:
### 4- Add a url in your urls.py:
```
from django.conf.urls import url
from django.contrib import admin
from djangoldp.views import LDPViewSet
from .models import Todo
urlpatterns = [
url(r'^todos/',
include(
LDPViewSet.urls(model=Todo))
)
,
url(r'^todos/', LDPViewSet.urls(model=Todo)),
url(r'^admin/', admin.site.urls),
]
```
This creates 2 routes, one for the list, and one with an ID listing the detail of an object.
4.
In the settings.py file, add your application name at the beginning of the application list, and add the following lines
### 5-
In the settings.py file, add your application name at the beginning of the application list, and add the following lines
```
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')
LDP_RDF_CONTEXT = 'https://cdn.happy-dev.fr/owl/hdcontext.jsonld'
```
5.
You can also register your model for the django administration site
### 6-
You can also register your model for the django administration site
```
from django.contrib import admin
...
...
@@ -66,7 +67,7 @@ from .models import Todo
admin.site.register(Todo)
```
6.
You then need to have your WSGI server pointing on myldpserver/myldpserver/wsgi.py
### 7-
You then need to have your WSGI server pointing on myldpserver/myldpserver/wsgi.py
## Execution
To start the server,
`cd`
to the root of your Django project and run :
...
...
@@ -74,6 +75,6 @@ To start the server, `cd` to the root of your Django project and run :
python3 manage.py runserver
```
## License
## Lic
ense
No licence yet. Please wait...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment