Wedge library for django application
Project description
Wedge Library
Démarrage rapide
$ pip install wedge-lib
Mode maintenance
Middleware
MIDDLEWARE=[
"w.drf.middlewares.maintenance_mode_middleware.MaintenanceModeMiddleware",
],
Command
Ajouter la commande maintenance_mode :
from w.django.commands.abstract_maintenance_mode_command import (
AbstractMaintenanceModeCommand,
)
class Command(AbstractMaintenanceModeCommand):
pass
Utilisation :
$ python manage.py maintenance_mode <on/off>
Configuration pour certains services
MailService
TBD
GoogleMapService
TBD
YousignService
TBD
Development
Installation
$ pipenv sync --dev
Update dependencies
$ pipenv update --dev
Run test
$ pytest
En cas d'ajout d'une librairie
Afin qu'elle soit également installée sur cs_back, il faut ajouter une ligne dans setup.cfg, sous la partie "install_requires ="
Des variables d'environnement doivent être configurées sur Pycharm:
- Cliquez sur Edit configurations en haut à droite de votre éditeur
- Edit configurations templates...
- Python tests - pytest
- Cliquez sur environnement variables et ajouter les api key correspondant à :
- GOOGLE_MAP_SECRET
- GOOGLE_MAP_API_KEY
- Les valeurs de ces variables peuvent être trouvées sur les secrets du repo ou à Eloïse
Before commit
Pour éviter de faire échouer le CI, lancer la commande:
$ ./before_commit.zsh
Publier manuellement sur PyPI
Après avoir committer et pousser:
- tagguer une version dans GitHub.
- mettre à jour la version dans le fichier
setup.cfg
avec le tag créé. - créer le package
$ rm -rf build dist wedge_lib.egg-info $ WEDGELIB_VERSION=<version> python setup.py sdist bdist_wheel
- mettre à jour sur TestPypi
$ twine upload --repository testpypi dist/*
- Si tout est ok, mettre à jour sur Pypi
$ twine upload dist/*
Utiliser W en mode dev depuis un autre projet (ex: csback)
Supprimer w du projet, ensuite l'installer à partir du chemin local du projet w:
pipenv uninstall wedge-lib && pipenv install <Absolute path du projet w local>
Après une nouvelle release de w, utiliser la version officielle :
pipenv uninstall wedge-lib && pipenv install wedge-lib
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wedge-lib-3.1.3.tar.gz
(94.1 kB
view hashes)
Built Distribution
wedge_lib-3.1.3-py3-none-any.whl
(140.5 kB
view hashes)
Close
Hashes for wedge_lib-3.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77c9161770e3ab4b9b1e30f5eba57ab83b5946808469c5da9a4f61f40e1ad029 |
|
MD5 | df8ef074efeb666015a585793c7eb513 |
|
BLAKE2b-256 | ba2274934691339f8f4113e6753966612eda52e6de72c5f4fffa822e3950bc4e |