This package helps you write shorter and cleaner codes by supporting the useage of one views with multiple urls in django. These urls and views are static but supports any extra dynamic slug, str, int etc.
Useage is simple
Here is our urls.py file
from django_arg_path import arg_path
urlpatterns = [
arg_path('en', '', home, name='home_en',
arg_path('ru', 'ru', home, name='home_ru',
arg_path('es', 'es', home, name='home_es',
]
Here is our views.py file
def home(request, static_arg=''):
# static_arg variable gives us en, ru and es as a string which we included in the beginning of our path
return render(request, static_arg+'.html')
So this one views.py file creates 3 pages named '', 'ru' and 'es'
Something like that 127.0.0.1:8000/, 127.0.0.1:8000/ru, 127.0.0.1:8000/es,
Release files for django-arg-path 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_arg_path-0.2.tar.gz | 3.4 kB | Details |
Release files / django_arg_path-0.2.tar.gz
| Download URL | django_arg_path-0.2.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a6826314ecb34a4225f7bca10c390036b12e310ab455ecc8e7a7e577379dd52
|
|
BLAKE2b-256 checksum How to use checksums |
0e2c5ba81b0b25a2e778707259e496f509f7c99a7612ea5b5b65e24e3ab441c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|