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
Merge requests
!284
Feature/pregenerate anonymous views
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feature/pregenerate anonymous views
feature/pregenerate-anonymous-views
into
master
Overview
0
Commits
17
Pipelines
7
Changes
6
Merged
Benoit Alessandroni
requested to merge
feature/pregenerate-anonymous-views
into
master
9 months ago
Overview
0
Commits
17
Pipelines
7
Changes
2
Expand
0
0
Merge request reports
Compare
version 2
version 6
21d0605c
9 months ago
version 5
fb0968a4
9 months ago
version 4
f973b5bd
9 months ago
version 3
1507e345
9 months ago
version 2
388ab16c
9 months ago
version 1
47ac4f98
9 months ago
master (base)
and
version 3
latest version
8292e068
17 commits,
9 months ago
version 6
21d0605c
16 commits,
9 months ago
version 5
fb0968a4
15 commits,
9 months ago
version 4
f973b5bd
14 commits,
9 months ago
version 3
1507e345
13 commits,
9 months ago
version 2
388ab16c
12 commits,
9 months ago
version 1
47ac4f98
11 commits,
9 months ago
Show latest version
2 files
+
43
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
docs/commands.md
0 → 100644
+
41
−
0
Options
# Available commands
## generate_static_content
You can generate and make available at a /ssr/xxx URI a static copy of the AnonymousUser view of given models.
Those models need to be configured with the
`static_version`
and
`static_params`
Meta options like:
```
python
class
Location
(
Model
):
name
=
models
.
CharField
(
max_length
=
255
)
address
=
models
.
CharField
(
max_length
=
255
)
zip_code
=
models
.
IntegerField
()
visible
=
models
.
BooleanField
(
default
=
False
)
class
Meta
:
# Allow generating a static version of the container view
static_version
=
1
# Add some GET parameters to configure the selection of data
static_params
=
{
"
search-fields
"
:
"
visible
"
,
"
search-terms
"
:
True
,
"
search-method
"
:
"
exact
"
}
```
You will need additional settings defined either in your settings.yml or settings.py file:
```
yml
BASE_URL
:
'
http://localhost:8000/'
MAX_RECURSION_DEPTH
:
10
# Default value: 5
SSR_REQUEST_TIME
:
20
# Default value 10 (seconds)
```
Then you can try it out by executing the following command:
```
sh
python manage.py generate_static_content
```
You can also set a cron task or a celery Task to launch this command in a regular basis.
\ No newline at end of file
Loading