Un petit outil Django/CLI pour récupérer l'emplacement IP
Project description
App Creator Location 🌍
Une application Django + CLI pour récupérer la géolocalisation de l'utilisateur via son adresse IP (https://ipinfo.io).
📦 Installation
pip install app-creator-location
Utilisation CLI
get-location
Utilisation Django
'app_creator',
Depuis PyPI (si publié) :
pip install app-creator-location
▶️ Utilisation en ligne de commande :
------------------------------------------------------------
Tape simplement :
get-location
Résultat :
IP: 255.255. 255.255
Ville: Abidjan
Région: Abidjan
Pays: CIV
Localisation: Région des lagunes au sud de la Côte d'Ivoire
Fournisseur: Orange.CI
------------------------------------------------------------
🌐 Intégration dans un projet Django :
------------------------------------------------------------
1. Ajouter `app_creator` dans `INSTALLED_APPS` :
INSTALLED_APPS = [
...
'app_creator',
]
2. Inclure les routes dans `urls.py` du projet :
from django.urls import include, path
urlpatterns = [
...
path('', include('app_creator.urls')),
]
3. Accéder à la route `/ip/` dans votre navigateur :
http://localhost:8000/ip/
Exemple de réponse JSON :
{
"ip": "255.255. 255.255",
"city": "Abidjan",
"region": "Abidjan",
"country": "CIV",
"loc": "Région des lagunes au sud de la Côte d'Ivoire",
"org": "Orange.CI."
}
------------------------------------------------------------
📂 Structure du package :
------------------------------------------------------------
app_creator/
├── __init__.py
├── cli.py → Script CLI
├── views.py → Vue Django (JSON)
├── urls.py → Routes Django
setup.py → Configuration package
README.txt → Ce fichier
LICENSE → Licence MIT ou autre
MANIFEST.in → (si fichiers statiques)
pyproject.toml → (facultatif, version moderne)
------------------------------------------------------------
📤 Publication sur PyPI (rappel) :
------------------------------------------------------------
1. Installer les outils :
pip install build twine
2. Créer les fichiers :
python setup.py sdist bdist_wheel
3. Publier :
twine upload dist/*
------------------------------------------------------------
👤 Auteur :
------------------------------------------------------------
Nom : Traoré Souleymane Almami
Email : trasouleymane980@gmail.com
GitHub : https://github.com/
------------------------------------------------------------
📝 Licence :
------------------------------------------------------------
Ce projet est sous licence MIT. Voir le fichier LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file app_creator_location-0.1.1.tar.gz.
File metadata
- Download URL: app_creator_location-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7af838cb43f8feb96dbd5e047307b87085599b28e355609ced60f76f27940461
|
|
| MD5 |
c6231c0e781ab9078d515d814bf349ed
|
|
| BLAKE2b-256 |
e5edfdc9d6715a1c5c53eb94a0da6f3caf809f67cfdb9c3a31846c55f3d9f186
|
File details
Details for the file app_creator_location-0.1.1-py3-none-any.whl.
File metadata
- Download URL: app_creator_location-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2989b19833b77fd0f23205cee79185469ab013052a90e08829a050ee3577d3a3
|
|
| MD5 |
138b596fc5cb27d4f1a3b6e7ac2552e6
|
|
| BLAKE2b-256 |
1d6715363c6e4d4b571f64f30989c2fd1f51557d89f654dfa129d2cb8d4722b0
|