diff --git a/api/views.py b/api/views.py index 8f4ed15d1..a1abbc70b 100644 --- a/api/views.py +++ b/api/views.py @@ -425,14 +425,22 @@ def post(self, request, schema, table): @api_exception def put(self, request, schema, table): """ - Every request to unsave http methods have to contain a "csrftoken". - This token is used to deny cross site reference forwarding. - In every request the header had to contain "X-CSRFToken" - with the actual csrftoken. - The token can be requested at / and will be returned as cookie. - - :param request: - :return: + REST-API endpoint used to create a new table in the database. + The table is created with the columns and constraints specified in the + request body. The request body must contain a JSON object with the following + keys: 'columns', 'constraints' and 'metadata'. + The payload must be a groped in a 'query' key. + + For authentication, the request must contain a valid token in the + Authentication header. + + Args: + request: The request object + schema: The schema in which the table should be created + table: The name of the table to be created + + Returns: + JsonResponse: A JSON response with the status code 201 CREATED """ if schema not in PLAYGROUNDS and schema not in UNVERSIONED_SCHEMAS: raise APIError("Schema is not in allowed set of schemes for upload") diff --git a/docs/installation/guides/development-setup.md b/docs/installation/guides/development-setup.md index 45ba13b4f..98cb58e32 100644 --- a/docs/installation/guides/development-setup.md +++ b/docs/installation/guides/development-setup.md @@ -63,9 +63,18 @@ You can run your own local copy of the OEP website server with python manage.py runserver -By default, you should be able to connect to this copy by visiting [localhost:8000](http://localhost:8000) in your web browser. +By default, you should be able to connect to this copy by visiting [127.0.0.1:8000](http://127.0.0.1:8000) in your web browser. This way you can insert your changes without worrying about breaking anything in the production system. +### Deploy react appĀ“s locally + +!!! Note + This solution is not the best developer experience and needs optimization + +As some Apps of the Oeplatform integrate React apps they need to be build using npm locally. We offer build scripts that can be triggered using django management commands. For example to build the scenario bundles react app and deploy it in the django app factsheet you can run the command `python manage.py build_factsheet_app`. Once done you can access the scenario bundles app via your locally deployed django instance (see above). + +Keep in mind that you now use a bundled version of the react app and all changes you might want to add to the React jsx components will only show up once you build the app again. For development this might be a bit clunky but since the app is deployed inside the django app this enables the React app to use the django authentication. An alternative that will not be able to use the django user authentication currently is to deploy the React app alongside the locally deployed django instance. You can use npm start while being inside the `factsheet/frontend/` directory in the terminal. To make this work you will have to change the config.json inside the same directory. In this file you find the key `"toep": "/"` you'll have to change this `/` value to `http://127.0.0.1:8000` to point to the django instance currently deployed locally. If your react test server is still running (`npm start`) you can now access it at `http://127.0.0.1:3000/scenario-bundles/main`. All changes made to the React jsx components will now be reflected instantly using live reloading. + ## User Management - Setup a test user To create a dummy user for functionality testing purposes diff --git a/docs/installation/guides/installation.md b/docs/installation/guides/installation.md index ebe53cca9..f1c67d19a 100644 --- a/docs/installation/guides/installation.md +++ b/docs/installation/guides/installation.md @@ -7,7 +7,7 @@ Below we describe the manual installation of the oeplatform code and infrastruct We provide 2 [docker container images](https://docs.docker.com/get-started/#what-is-a-container-image) (OEP-website and OEP-database). The images are updated & published with each release. They can be pulled from [GitHub packages](https://github.com/OpenEnergyPlatform/oeplatform/pkgs/container/oeplatform). - [Here you can find instructions on how to install the docker images.](https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/docker/USAGE.md) + [Here you can find instructions on how to install the docker images.](https://github.com/OpenEnergyPlatform/oeplatform/tree/develop/docker) !!! danger Currently the docker based installation does not cover the installation of the additional database `jenna-fuseki` a triple store that stores graph data used in some of our features. diff --git a/versions/changelogs/current.md b/versions/changelogs/current.md index 41f1265f0..00db36dbd 100644 --- a/versions/changelogs/current.md +++ b/versions/changelogs/current.md @@ -13,3 +13,8 @@ ## Documentation updates - Updated documentation to simplify usage of vendor software swagger ui and update the documentation on scenario bundles. Add documentation on how to use the updated OEKG web API [(#1928)](https://github.com/OpenEnergyPlatform/oeplatform/pull/1928). + +- Bulk documentation enhancements [(#1940)](https://github.com/OpenEnergyPlatform/oeplatform/pull/1940) + - Fix outdated docstring in HTTP-API view: Table.put + - Fix broken link in documentation linking the docker setup instructions + - Add section to the development setup documentation on how to run npm start alongside the django oeplatform instance