django-permalinker


Namedjango-permalinker JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/efficient-solutions/django-permalinker
SummaryDjango application to create, manage, and redirect permanent links
upload_time2024-09-15 16:54:20
maintainerNone
docs_urlNone
authorEfficient Solutions LLC
requires_python>=3.10
licenseMIT
keywords django permanent links permalinks url shortener
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Django Permalinker

`django_permalinker` is a Django application that provides an easy way to create, manage, and redirect permanent links (or permalinks). With customizable permalink ID generation, this app ensures that you have unique and efficient IDs to serve your redirecting needs.

## Features

- **Customizable Permalink ID Generation**: Adjust ID length, character set (uppercase, lowercase, digits), and more through Django settings.
- **Admin Interface**: Manage links via Django's admin panel.
- **404 Handling**: Automatically raise 404 errors for invalid or missing links.
- **Automatic Redirection**: Automatically redirect users to the destination URL based on the unique ID.

## Requirements

- Python: **3.10+**
- Django: **4+**

## Installation

1. Install the package:

```bash
pip install django-permalinker
```

2. Add `django_permalinker` to your `INSTALLED_APPS` in `settings.py`:

```python
INSTALLED_APPS = [
    # Other apps
    'django_permalinker',
]
```

3. Include the `django_permalinker` URLs in your project’s `urls.py`:

```python
from django.urls import path, include

urlpatterns = [
    # Other paths
    path("link/", include("django_permalinker.urls")),
]
```

4. Run migrations to create the necessary database tables:

```bash
python manage.py migrate
```

5. Start the Django development server:

```bash
python manage.py runserver
```

## Configuration

Customize the behavior of permalink ID generation in your Django project’s `settings.py` file:

- **PERMALINKER_ID_LENGTH**: Defines the length of the generated ID (default: 5).
- **PERMALINKER_ID_INCLUDE_UPPERCASE**: If set to `True`, uppercase letters will be included in the ID (default: `True`).
- **PERMALINKER_ID_INCLUDE_DIGITS**: If set to `True`, digits will be included in the ID (default: `True`).

Example:

```python
# settings.py

PERMALINKER_ID_LENGTH = 8  # Custom ID length
PERMALINKER_ID_INCLUDE_UPPERCASE = False  # Only lowercase letters
PERMALINKER_ID_INCLUDE_DIGITS = True  # Include digits
```

## Usage

### Creating and Managing Links

1. Access the **Django Admin** interface at `http://localhost:8000/admin/`.
2. Navigate to the **Permalinker** section and manage your links:
   - **Add New Link**: Create a new link with a destination URL, name, and description.
   - **List Links**: View all the existing links.
   - **Edit Existing Links**: Update or delete existing links.

### Redirecting

Once a link is created, you can access the link's permanent URL by visiting:

```
http://localhost:8000/link/<link_id>/
```

Django will handle the redirection to the destination URL automatically.

## Example

1. Create a new link in the admin panel:
   - **Name**: `Example link`
   - **Destination URL**: `https://example.com`
   
2. Access the permanent link:

```
http://localhost:8000/link/abc123/
```

You will be redirected to `https://example.com`.

## Screenshots

### 1. Admin: List Links View
View all the existing links in the Django admin.

![](https://raw.githubusercontent.com/efficient-solutions/django-permalinker/0.1.0/img/admin-list-view.png)

### 2. Admin: Add New Link View
Create a new link by providing a name, destination URL, and description.

![](https://raw.githubusercontent.com/efficient-solutions/django-permalinker/0.1.0/img/admin-add-view.png)

### 3. Admin: Edit Existing Link View
Edit an existing link’s details or delete it.

![](https://raw.githubusercontent.com/efficient-solutions/django-permalinker/0.1.0/img/admin-edit-view.png)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/efficient-solutions/django-permalinker",
    "name": "django-permalinker",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "Django, Permanent links, Permalinks, URL Shortener",
    "author": "Efficient Solutions LLC",
    "author_email": "contact@efficient.solutions",
    "download_url": "https://files.pythonhosted.org/packages/11/c9/53f912736acd3cd0d9d1b363a66d55e555c64b293282be6e0d1e6441688f/django-permalinker-0.1.1.tar.gz",
    "platform": null,
    "description": "# Django Permalinker\n\n`django_permalinker` is a Django application that provides an easy way to create, manage, and redirect permanent links (or permalinks). With customizable permalink ID generation, this app ensures that you have unique and efficient IDs to serve your redirecting needs.\n\n## Features\n\n- **Customizable Permalink ID Generation**: Adjust ID length, character set (uppercase, lowercase, digits), and more through Django settings.\n- **Admin Interface**: Manage links via Django's admin panel.\n- **404 Handling**: Automatically raise 404 errors for invalid or missing links.\n- **Automatic Redirection**: Automatically redirect users to the destination URL based on the unique ID.\n\n## Requirements\n\n- Python: **3.10+**\n- Django: **4+**\n\n## Installation\n\n1. Install the package:\n\n```bash\npip install django-permalinker\n```\n\n2. Add `django_permalinker` to your `INSTALLED_APPS` in `settings.py`:\n\n```python\nINSTALLED_APPS = [\n    # Other apps\n    'django_permalinker',\n]\n```\n\n3. Include the `django_permalinker` URLs in your project\u2019s `urls.py`:\n\n```python\nfrom django.urls import path, include\n\nurlpatterns = [\n    # Other paths\n    path(\"link/\", include(\"django_permalinker.urls\")),\n]\n```\n\n4. Run migrations to create the necessary database tables:\n\n```bash\npython manage.py migrate\n```\n\n5. Start the Django development server:\n\n```bash\npython manage.py runserver\n```\n\n## Configuration\n\nCustomize the behavior of permalink ID generation in your Django project\u2019s `settings.py` file:\n\n- **PERMALINKER_ID_LENGTH**: Defines the length of the generated ID (default: 5).\n- **PERMALINKER_ID_INCLUDE_UPPERCASE**: If set to `True`, uppercase letters will be included in the ID (default: `True`).\n- **PERMALINKER_ID_INCLUDE_DIGITS**: If set to `True`, digits will be included in the ID (default: `True`).\n\nExample:\n\n```python\n# settings.py\n\nPERMALINKER_ID_LENGTH = 8  # Custom ID length\nPERMALINKER_ID_INCLUDE_UPPERCASE = False  # Only lowercase letters\nPERMALINKER_ID_INCLUDE_DIGITS = True  # Include digits\n```\n\n## Usage\n\n### Creating and Managing Links\n\n1. Access the **Django Admin** interface at `http://localhost:8000/admin/`.\n2. Navigate to the **Permalinker** section and manage your links:\n   - **Add New Link**: Create a new link with a destination URL, name, and description.\n   - **List Links**: View all the existing links.\n   - **Edit Existing Links**: Update or delete existing links.\n\n### Redirecting\n\nOnce a link is created, you can access the link's permanent URL by visiting:\n\n```\nhttp://localhost:8000/link/<link_id>/\n```\n\nDjango will handle the redirection to the destination URL automatically.\n\n## Example\n\n1. Create a new link in the admin panel:\n   - **Name**: `Example link`\n   - **Destination URL**: `https://example.com`\n   \n2. Access the permanent link:\n\n```\nhttp://localhost:8000/link/abc123/\n```\n\nYou will be redirected to `https://example.com`.\n\n## Screenshots\n\n### 1. Admin: List Links View\nView all the existing links in the Django admin.\n\n![](https://raw.githubusercontent.com/efficient-solutions/django-permalinker/0.1.0/img/admin-list-view.png)\n\n### 2. Admin: Add New Link View\nCreate a new link by providing a name, destination URL, and description.\n\n![](https://raw.githubusercontent.com/efficient-solutions/django-permalinker/0.1.0/img/admin-add-view.png)\n\n### 3. Admin: Edit Existing Link View\nEdit an existing link\u2019s details or delete it.\n\n![](https://raw.githubusercontent.com/efficient-solutions/django-permalinker/0.1.0/img/admin-edit-view.png)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Django application to create, manage, and redirect permanent links",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/efficient-solutions/django-permalinker"
    },
    "split_keywords": [
        "django",
        " permanent links",
        " permalinks",
        " url shortener"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d2e1c8185245db0388d32c3ad27093cb059964d8cdd0b53e5eaa03894020a4c7",
                "md5": "a4548c69035aef32d2c8a94cbb5ccaa5",
                "sha256": "1321409f1ab60f7c1212585cae5b8a5a3be3cd3436a255ea04343a835d273f99"
            },
            "downloads": -1,
            "filename": "django_permalinker-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a4548c69035aef32d2c8a94cbb5ccaa5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 11426,
            "upload_time": "2024-09-15T16:54:12",
            "upload_time_iso_8601": "2024-09-15T16:54:12.977697Z",
            "url": "https://files.pythonhosted.org/packages/d2/e1/c8185245db0388d32c3ad27093cb059964d8cdd0b53e5eaa03894020a4c7/django_permalinker-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "11c953f912736acd3cd0d9d1b363a66d55e555c64b293282be6e0d1e6441688f",
                "md5": "c5626775e6c1c0bb385023cd8778fa1c",
                "sha256": "bf16e16db09f1e76eb129e20dd20b11ef31755f69b1b392f3ba16e39fa618a18"
            },
            "downloads": -1,
            "filename": "django-permalinker-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c5626775e6c1c0bb385023cd8778fa1c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 1579460,
            "upload_time": "2024-09-15T16:54:20",
            "upload_time_iso_8601": "2024-09-15T16:54:20.256182Z",
            "url": "https://files.pythonhosted.org/packages/11/c9/53f912736acd3cd0d9d1b363a66d55e555c64b293282be6e0d1e6441688f/django-permalinker-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-15 16:54:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "efficient-solutions",
    "github_project": "django-permalinker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "django-permalinker"
}
        
Elapsed time: 0.39307s