Installation
System Requirements
Python 3.8 or higher
Django 3.2 or higher
Installing Django RemixIcon
Install from PyPI
The easiest way to install Django RemixIcon is using pip:
pip install django-remix-icon
Install from Source
You can also install from the source code:
git clone https://github.com/brktrlw/django-remix-icon.git
cd django-remix-icon
pip install -e .
Django Configuration
Add
django_remix_iconto yourINSTALLED_APPSsetting:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# ... your other apps
'django_remix_icon', # Add this line
]
Include the package URLs in your project’s main
urls.py:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
# ... your other URLs
path('remix-icon/', include('django_remix_icon.urls')),
]
Note
The URL path can be customized to your preference. The important part is that the views are accessible for the admin autocomplete functionality.
Collect static files (if using Django’s static file handling):
python manage.py collectstatic
Static Files Configuration
The package includes CSS and JavaScript files for the admin widget functionality. These are automatically included when using the widget.
If you’re using a custom static file configuration, ensure that the package’s static files are properly served:
# settings.py
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
RemixIcon CSS
The package automatically includes RemixIcon CSS from CDN. No additional configuration is needed, but you can override this behavior if needed.
Verification
To verify that the installation was successful:
Start your Django development server:
python manage.py runserver
Visit the Django admin and create a model with an
IconField(see Quick Start Guide for an example).You should see the icon selection widget with autocomplete functionality.
Troubleshooting
Static Files Not Loading
If the admin widget styles or JavaScript are not loading:
Ensure
django.contrib.staticfilesis in yourINSTALLED_APPSRun
python manage.py collectstaticCheck that your
STATIC_URLsetting is correctVerify that static files are properly served in your web server configuration
Autocomplete Not Working
If the autocomplete functionality is not working:
Ensure the package URLs are properly included in your URL configuration
Check the browser’s developer tools for JavaScript errors
Verify that the CSRF token is properly configured for AJAX requests
URL Import Errors
If you encounter import errors when including the URLs:
Ensure
django_remix_iconis in yourINSTALLED_APPSTry restarting your Django development server
Check that you’re using the correct import path
Next Steps
Now that you have Django RemixIcon installed, continue to the Quick Start Guide guide to learn how to use it in your project.