djangoldp-energiepartagee


Namedjangoldp-energiepartagee JSON
Version 3.0.2 PyPI version JSON
download
home_pageNone
SummaryCustom DjangoLDP based package for Energie Partagee
upload_time2024-11-26 15:51:08
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # djangoldp_energiepartagee

## Installation

How to install the project locally

1- create virtual environement
`py -m venv venv`

2- activate venv
`venv\Scripts\activate.bat`

3- update pip & wheel
`py -m pip install -U pip wheel`

4- install sib-manager
`py -m pip install -U sib-manager`

5- launch the startproject command
`sib startproject energiepartagee_server`

6- install server
  => go into energiepartagee_server folder
`sib install server`

7- create superuser
`py manage.py createsuperuser`

8- add virtual link with the djangoldp_energiepartagee package :
`mklink /D [LINK] [TARGET]`
`mklink /D [...]\energiepartage_server\djangoldp_energiepartagee [...]\djangoldp_energiepartagee\djangoldp_energiepartagee`
=><!> [LINK] : Link to the "folder" where the target will be found

9- add the package in the package.yml file

10- run migration and migrate
`py manage.py makemigrations djangoldp_energiepartagee` (for the first time, then `py manage.py makemigrations` will be enough in case ogf modifications of the package)
`py manage.py migrate`

11- runserver
`py manage.py runserver`

## Custom Commands

With `djangoldp_energiepartagee` installed as an app, you will be able to run:

```sh
python manage.py create_annual_contributions
```

This command calculates the contribution for every actor in the database and creates a Contribution for each. The amount is calculated following an algorithm which can be found in the `Actor` model (`Actor.get_next_contribution_amount`). A contribution will not be added for any actors which have already paid a contribution in the same year. Use the `-F` option to override this, creating one contribution for every actor in the databae.

## Enable the context preprocessors

```yaml
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                ...
                'djangoldp_energiepartagee.context_processors.is_amorce',
            ],
        },
    },
]
```

Or, with SIB Platform:

```yaml
apps:
  hosts:
    xxx:
      services:
        context:
          processor: djangoldp_energiepartagee.context_processors.is_amorce
```

## Disable AMORCE Specific routines

In your `settings.yml`:

```yaml
server:
  IS_AMORCE: False
```



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "djangoldp-energiepartagee",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/37/bd/d2a26a958c345e82eefb701cca64b6d600f4007d3d620d8aa963995e4826/djangoldp_energiepartagee-3.0.2.tar.gz",
    "platform": null,
    "description": "# djangoldp_energiepartagee\n\n## Installation\n\nHow to install the project locally\n\n1- create virtual environement\n`py -m venv venv`\n\n2- activate venv\n`venv\\Scripts\\activate.bat`\n\n3- update pip & wheel\n`py -m pip install -U pip wheel`\n\n4- install sib-manager\n`py -m pip install -U sib-manager`\n\n5- launch the startproject command\n`sib startproject energiepartagee_server`\n\n6- install server\n  => go into energiepartagee_server folder\n`sib install server`\n\n7- create superuser\n`py manage.py createsuperuser`\n\n8- add virtual link with the djangoldp_energiepartagee package :\n`mklink /D [LINK] [TARGET]`\n`mklink /D [...]\\energiepartage_server\\djangoldp_energiepartagee [...]\\djangoldp_energiepartagee\\djangoldp_energiepartagee`\n=><!> [LINK] : Link to the \"folder\" where the target will be found\n\n9- add the package in the package.yml file\n\n10- run migration and migrate\n`py manage.py makemigrations djangoldp_energiepartagee` (for the first time, then `py manage.py makemigrations` will be enough in case ogf modifications of the package)\n`py manage.py migrate`\n\n11- runserver\n`py manage.py runserver`\n\n## Custom Commands\n\nWith `djangoldp_energiepartagee` installed as an app, you will be able to run:\n\n```sh\npython manage.py create_annual_contributions\n```\n\nThis command calculates the contribution for every actor in the database and creates a Contribution for each. The amount is calculated following an algorithm which can be found in the `Actor` model (`Actor.get_next_contribution_amount`). A contribution will not be added for any actors which have already paid a contribution in the same year. Use the `-F` option to override this, creating one contribution for every actor in the databae.\n\n## Enable the context preprocessors\n\n```yaml\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                ...\n                'djangoldp_energiepartagee.context_processors.is_amorce',\n            ],\n        },\n    },\n]\n```\n\nOr, with SIB Platform:\n\n```yaml\napps:\n  hosts:\n    xxx:\n      services:\n        context:\n          processor: djangoldp_energiepartagee.context_processors.is_amorce\n```\n\n## Disable AMORCE Specific routines\n\nIn your `settings.yml`:\n\n```yaml\nserver:\n  IS_AMORCE: False\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Custom DjangoLDP based package for Energie Partagee",
    "version": "3.0.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac15135e26cbf988560185a848454b22f1ae5a523318ef03f659619df05d7e35",
                "md5": "03d950491215cb7a124cc454a5f6d307",
                "sha256": "8e3ba5e4f14804a674d1d8cbc2bec64b9f6e1d57d36aa5276c0d10e361a50e4f"
            },
            "downloads": -1,
            "filename": "djangoldp_energiepartagee-3.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "03d950491215cb7a124cc454a5f6d307",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 679115,
            "upload_time": "2024-11-26T15:51:06",
            "upload_time_iso_8601": "2024-11-26T15:51:06.705603Z",
            "url": "https://files.pythonhosted.org/packages/ac/15/135e26cbf988560185a848454b22f1ae5a523318ef03f659619df05d7e35/djangoldp_energiepartagee-3.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "37bdd2a26a958c345e82eefb701cca64b6d600f4007d3d620d8aa963995e4826",
                "md5": "42d86a76997c54911c2ce4c440ea3eb9",
                "sha256": "b9c8b3ffff9a1d94d4aff10428a48bffcd0a5e35e0e8d484d4eff58489d7323c"
            },
            "downloads": -1,
            "filename": "djangoldp_energiepartagee-3.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "42d86a76997c54911c2ce4c440ea3eb9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 556658,
            "upload_time": "2024-11-26T15:51:08",
            "upload_time_iso_8601": "2024-11-26T15:51:08.832926Z",
            "url": "https://files.pythonhosted.org/packages/37/bd/d2a26a958c345e82eefb701cca64b6d600f4007d3d620d8aa963995e4826/djangoldp_energiepartagee-3.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-26 15:51:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "djangoldp-energiepartagee"
}
        
Elapsed time: 0.39293s