Skip to content
  • Alex Pyrgiotis's avatar
    admin: Make Admin base URL configurable · 585a5f60
    Alex Pyrgiotis authored
    Add an `ADMIN_BASE_URL` setting, which works roughly the same as the
    Cyclades/Astakos base URLs (minus the service registration part). The
    main benefit of the `ADMIN_BASE_URL` setting is that it allows the
    administrator to define the path for Admin (or lack thereof).
    
    Also, using the `extends_path_with_slash` function, the base URL that
    the administrator chooses should work with or without a slash. In the
    latter case, a Django-specific redirect view will be used to redirect
    the request to the URL with slash.
    
    Finally, the addition of the `ADMIN_BASE_URL` brings also another
    change. If the administrator wants to install Admin in a separate node,
    he/she no longer has to choose between using as ROOT_URLCONF the
    'synnefo_admin.urls' or 'synnefo_admin.admin.urls' (their main
    difference was that the former had '/admin/' hard-coded).
    Using simply the 'synnefo_admin.urls' should suffice,
    since the `BASE_PATH` will be extracted from the `ADMIN_BASE_URL`.
    
    Fixes apyrgio/synnefo#289
    585a5f60