Skip to main content

adds .local:port to the site domain links for local development if settings.DEBUG is True

Project description

Installation

$ [sudo] pip install django-site-local-middleware

Examples

settings.py

DEBUG=True

MIDDLEWARE = [
    ...
    'django_site_local_middleware.middleware.SiteLocalMiddleware'
    ...
]

/etc/hosts

127.0.0.1   site.com.local
$ python manage.py runserver 0.0.0.0:8000
before after
<a href="http://site.com/"> <a href="http://site.com.local:8000/">

readme42.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page