Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8322712
developers-info.rst
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Subscribers
None
developers-info.rst
View Options
Developers Information
======================
Sample configuration
--------------------
The configuration will be taken from the default configuration file:
*~/.config/swh/webapp/webapp.yml*
.
The following introduces a default configuration file:
..
sourcecode
::
yaml
storage
:
cls
:
remote
args
:
url
:
http://localhost:5002
debug
:
false
throttling
:
cache_uri
:
None
scopes
:
swh_api
:
limiter_rate
:
120/h
exempted_networks
:
-
127.0.0.0/8
Run server
----------
Either use the django manage script directly (useful in development mode as it offers various commands):
..
sourcecode
::
shell
$
python3
-m
swh.web.manage
runserver
or use the following shortcut:
..
sourcecode
::
shell
$
make
run
Modules description
-------------------
Common to all web applications
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Configuration and settings
""""""""""""""""""""""""""
*
:mod:
`swh.web.config`
: holds the SWH configuration for the web applications.
*
:mod:
`swh.web.doc_config`
: utility module used to extend the sphinx configuration
when building the documentation.
*
:mod:
`swh.web.manage`
: Django management module for developpers.
*
:mod:
`swh.web.urls`
: module that holds the whole URI scheme of all
the web applications.
*
:mod:
`swh.web.wsgi`
: WSGI module to use when deploying the web applications
in production.
*
:mod:
`swh.web.settings.common`
: Common Django settings
*
:mod:
`swh.web.settings.development`
: Django settings for development
*
:mod:
`swh.web.settings.production`
: Django settings for production
*
:mod:
`swh.web.settings.tests`
: Django settings for tests
Common utilities
""""""""""""""""
*
:mod:
`swh.web.common.converters`
: conversion module used to transform SWH raw data
to serializable ones. It is used by
:mod:
`swh.web.common.service`
: to convert data
before transmitting then to Django views.
*
:mod:
`swh.web.common.exc`
: module defining exceptions used in the web applications.
*
:mod:
`swh.web.common.highlightjs`
: utility module to ease the use of the highlightjs_
library in produced Django views.
*
:mod:
`swh.web.common.query`
: Utilities to parse data from HTTP endpoints. It is used
by
:mod:
`swh.web.common.service`
.
*
:mod:
`swh.web.common.service`
: Orchestration layer used by views module
in charge of communication with
:mod:
`swh.storage`
to retrieve information and
perform conversion for the upper layer.
*
:mod:
`swh.web.common.swh_templatetags`
: Custom Django template tags library for swh.
*
:mod:
`swh.web.common.throttling`
: Custom request rate limiter to use with the `Django REST Framework
<http://www.django-rest-framework.org/>`_
*
:mod:
`swh.web.common.urlsindex`
: Utilities to help the registering of endpoints
for the web applications
*
:mod:
`swh.web.common.utils`
: Utility functions used in the web applications implementation
SWH Web API application
^^^^^^^^^^^^^^^^^^^^^^^
*
:mod:
`swh.web.api.apidoc`
: Utilities to document the web api for its html
browsable rendering.
*
:mod:
`swh.web.api.apiresponse`
: Utility module to ease the generation of
web api responses.
*
:mod:
`swh.web.api.apiurls`
: Utilities to facilitate the registration of SWH
web api endpoints.
*
:mod:
`swh.web.api.urls`
: Module that defines the whole URI scheme for the api endpoints
*
:mod:
`swh.web.api.utils`
: Utility functions used in the SWH web api implementation.
*
:mod:
`swh.web.api.views.content`
: Implementation of API endpoints for getting information
about SWH contents.
*
:mod:
`swh.web.api.views.directory`
: Implementation of API endpoints for getting information
about SWH directories.
*
:mod:
`swh.web.api.views.entity`
: Implementation of API endpoints for getting information
about SWH entities.
*
:mod:
`swh.web.api.views.origin`
: Implementation of API endpoints for getting information
about SWH origins.
*
:mod:
`swh.web.api.views.person`
: Implementation of API endpoints for getting information
about SWH persons.
*
:mod:
`swh.web.api.views.release`
: Implementation of API endpoints for getting information
about SWH releases.
*
:mod:
`swh.web.api.views.revision`
: Implementation of API endpoints for getting information
about SWH revisions.
*
:mod:
`swh.web.api.views.stat`
: Implementation of API endpoints for getting information
about SWH archive statistics.
*
:mod:
`swh.web.api.views.utils`
: Utilities used in the web api endpoints implementation.
SWH Web browse application
^^^^^^^^^^^^^^^^^^^^^^^^^^
*
:mod:
`swh.web.browse.browseurls`
: Utilities to facilitate the registration of SWH web
browse endpoints.
*
:mod:
`swh.web.browse.urls`
: Module that defines the whole URI scheme for the SWH web
browse endpoints.
*
:mod:
`swh.web.browse.utils`
: Utilities functions used troughout the SWH web browse
endpoints implementation.
*
:mod:
`swh.web.browse.views.content`
: Implementation of endpoints for browsing SWH contents.
*
:mod:
`swh.web.browse.views.directory`
: Implementation of endpoints for browsing SWH directories.
*
:mod:
`swh.web.browse.views.origin`
: Implementation of endpoints for browsing SWH origins.
*
:mod:
`swh.web.browse.views.person`
: Implementation of endpoints for browsing SWH persons.
*
:mod:
`swh.web.browse.views.revision`
: Implementation of endpoints for browsing SWH revisions.
..
_highlightjs:
https://highlightjs.org/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 3, 7:43 AM (5 d, 8 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3306788
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment