Commit Graph

24 Commits

Author SHA1 Message Date
Akihiro Motoki d9266fd82c Address RemovedInDjango40Warning (3)
In Django 3.1, django.conf.urls.url() is deprecated
in favor of django.urls.re_path().

https://docs.djangoproject.com/en/4.0/releases/3.1/#id2

Change-Id: I484694f8718f61c022126a1935cf28fce075894b
2022-02-04 16:26:54 +09:00
Akihiro Motoki 2f1e1899d3 Define default settings explicitly (openstack_dashboard 5/5)
This commit mainly covers settings in the remaining files
under openstack_dashboard.

Note that HORIZON_CONFIG, horizon and openstack_auth are not covered.
They will be covered by follow-up patches.

Part of blueprint ini-based-configuration
Change-Id: Ibd70e030445a073d9a62da9867850f4893135a89
2019-07-08 18:20:32 +09:00
Shu Muto f494c6f2d4 Fix Angular errors in openstack_auth
Angular errors on login page are caused by loading ngdetails view.
Although registration of URL for ngdetails is executed on top level
of Horizon, ngdetails view is not needed to be loaded in login page,
i.e. openstack_auth side.
To fix this issue, this patch moves registration of URL for ngdetails
into openstack_dashboard side.

Change-Id: Ib039417b4e666c2341f17ac05fd7723bc758816c
Closes-Bug: #1754133
Closes-Bug: #1753557
2018-03-17 18:36:01 +09:00
Akihiro Motoki 18684e1ff5 django2: Fix 3-tuple ImproperlyConfigured error
https://docs.djangoproject.com/en/2.0/releases/1.9/#passing-a-3-tuple-or-an-app-name-to-include

blueprint django2-support
Change-Id: Ifb9b7501363fe8a3ef417498e0932323240a6dcd
2018-03-03 07:20:43 +09:00
Akihiro Motoki 6c45c47e4b Drop unnecessary executable flags
This patch also adds checks for executable files in
pep8 job.

nose ignores executable files by default, so it is important
to ensure executable flag is not set for test files [1].
openstack_dashboard/test/test_plugins/panel_tests.py was not
tested actually and it was broken. This commit fixes it too.
[1] http://nose.readthedocs.io/en/latest/usage.html#cmdoption-exe

Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: I3a124fa2f9f0676b2b43a094e32e3d8b18fa6005
2017-12-27 21:32:48 +00:00
Tyler Smith 2e7dce8268 Adds extensible header functionality
This change is to introduce a flexible mechanism for projects to
add content to horizon's navbar.
- Introduces a new plugin file variable called ADD_HEADER_SECTIONS,
  which will take a list of views.  These are template views that
  will be used to render individual header sections.
- There is a new view in openstack_dashboard/views.py to cycle
  through these added views and combine them into the complete
  header to be added to the navbar.
- This view is queried by newly added javascript after page load.
  On response it is inserted into the page's navbar.
  If more than one header is present, the first will be shown in
  the navbar, while the rest are added to a drop-down menu.
- The currently displayed header can be changed by clicking on a
  new header in the drop-down; this is stored in a cookie to
  persist the selection between pages.
- Unit tests were modified/added to verify the new plugin entry
  can be parsed successfully and the main header view can parse
  a plugin's view successfully

Change-Id: I177b69ec4e78c17f827e540a7e669af1c29e8b59
Implements: blueprint extensible-header
Signed-off-by: Tyler Smith <tyler.smith@windriver.com>
2017-10-03 17:11:06 +00:00
Akihiro Motoki baa4ca8dce hacking: noqa cleanup in openstack_dashboard
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.

After this, there are only 3 noqa under openstack_dashboard/ :)

Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
2017-03-17 19:38:47 +00:00
Rob Cresswell 15e83c6448 Update URLs to Django 1.8+ style
Django 1.8 altered and deprecated the existing pattern for defining
URLs. This will be removed in 1.10, meaning that many deprecation
warnings show up under Django 1.9. We should fix the URLs promptly to
avoid logspam, and to support Django 1.10 in Newton.

See
https://docs.djangoproject.com/en/1.9/releases/1.8/#django-conf-urls-patterns

Change-Id: I074d20850de59bfe678a3bc72e9f0f25bd743cbf
Partially-Implements: blueprint dj110
2016-03-28 11:03:08 +01:00
Jamie Lennox 06688a99ca Allow specifying authentication URLs from settings
To allow us to have authentication mechanisms that live out of tree as
AUTHENTICATION_BACKENDS do we need to have a way to load the views that
service those backends.

Provide a means via settings that we can add new routes to the /auth
urls.

Closes-Bug: #1433358
Change-Id: I1ffc8a4e0bbfa58c7b50351432668d49d3a7dab1
2015-03-18 11:44:30 +11:00
Richard Jones cd735d44f3 REST API for angular front end.
This is the start of the API to support the angular front end.

It is missing endpoints not immediately used by angular WIPs other
than the identity re-work, but is enough to start with.

Changes:
- handle additional HTTP status code attribute
- move common helpers from test modules to here

Partially Implements: blueprint angularize-identity-tables

Change-Id: I7495f772be80125fdf52b02883a5b9942db34610
2015-01-13 13:41:49 +13:00
Akihiro Motoki 832a741c88 Fix E128 errors in remaining openstack_dashboard/
E128 continuation line under-indented for visual indent

Closes-Bug: #1375929
Change-Id: I2a72313d359bdfe2e2667eba5d3bf9744ec8f60a
2014-10-16 16:53:52 +09:00
Tatiana Ovchinnikova b47f226647 Remove #noqa from django.conf.urls.include
We have one more import with #noqa: django.conf.urls.include that is also
commonly used in urls.py module and could be included to the list of
import exceptions. This change has also revealed one unused import.

Change-Id: I47cc582340625aac87ab0242b147e11ef1d9b38e
2014-09-29 13:58:39 +04:00
Tatiana Ovchinnikova 539c14e1c6 Remove #noqa from two common imports and add them to import_exceptions
We have two imports with #noqa: django.conf.urls.patterns and
django.conf.urls.url however using them is a standard way of creating
any urls.py module. So there are over 150 imports in Horizon code
where #noqa could be replaced with two lines in list of import_exceptions.

Change-Id: I81c3290e0dc958b5037dd6a87e44df18adfbe751
2014-09-16 14:08:28 +04:00
He Yongli e790ac070e Remove extraneous vim configuration comments
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

at the top of source code files, except for files in
openstack/common.

Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
2014-05-06 15:30:10 +08:00
Radomir Dopieralski 028332da4a Remove #noqa from most common imports and add them to import_exceptions
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.

I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.

I also removed a few unused imports that were revealed in the process.

Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
2014-01-07 12:26:35 +01:00
Kieran Spear 311b6299c5 Fix django.conf.urls.defaults imports
These imports aren't available in Django 1.6. We need to use
django.conf.urls instead.

Partially-implements blueprint django-1point6

Change-Id: I692439a76de4fe5abff9ab9395bad5c10f1cdbba
2013-11-04 17:10:57 +11:00
Tatiana Mazur 953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Matthias Runge cea720e793 Sort imports alphabetically
This patch also re-organizes imports to import one per line.

Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
2013-06-14 12:05:55 +02:00
Kieran Spear 76ef256dc4 Don't inherit from base.html in 500 error page
For server errors, the context passed to the template is empty,
so things like STATIC_URL and context processors don't work.

Fixes bug 1067206.

Change-Id: Ia1801afaecd6a23fbcc6054552d0fd313597d1c1
2012-11-21 12:13:17 +11:00
Gabriel Hurley cb8e7c1f8f Splits OpenStack Dashboard bits from framework app code.
Moves everything OpenStack-specific (dashboards, apis, etc.)
into the openstack_dashboard project, achieving a much
cleaner separation between the project-specific code and
the generic Horizon framework code.

Change-Id: I7235b41d449b26c980668fc3eb4360b24508717b
2012-10-11 11:47:50 -07:00
Gabriel Hurley 6f838a09b8 Fixed/enabled selenium tests.
Moved the tests to the horizon portion since they test core functionality.
This also required moving some of the templates, etc. that belong in horizon
to their proper homes.

Change-Id: I7d9758845b81e4b8bcf1ffaaff4f6e237b4fe9f8
2012-07-25 14:12:24 -07:00
Gabriel Hurley c339189b44 Auth refactor.
Switch to using the self-contained django_openstack_auth
package which is a proper django.contrib.auth pluggable
backend.

Notable functional improvements include:

  * Better overall security via use of standard Django
    auth code (well-vetted by security experts).
  * Token expiration checking.
  * User "enabled" attribute checking.
  * Support for full range of Django auth attributes
    such as is_anonymous, is_active, is_superuser, etc.
  * Improved hooks for RBAC/permission-based acess control.

Regarding the RBAC/permission-based access control, this
patch moves all "role" and "service"-oriented checks to
permission checks. This will make transitioning to
policy-driven checking much easier once that fully lands
in OpenStack.

Implements blueprint move-keystone-support-to-django-auth-backend

Change-Id: I4f3112af797aff8c4c5e9930c6ca33a70e45589d
2012-07-09 16:57:52 -07:00
Gabriel Hurley 41c3a5990c JavaScript Refactor.
Cleans up Horizon's JavaScript to make it properly modular and
well-organized.

Adds unit tests written in QUnit for some of the JS modules
as a starting point for the JS test framework. You can visit
/qunit/ with DEBUG=True in your settings to access the JS
test runner.

Fixes bug 961509.

Change-Id: Ica33765660d0ed80f22c71bc96f122c3fc8b80cc
2012-06-23 17:12:37 -07:00
Gabriel Hurley 052aa55d34 Unifies the project packaging into one set of modules.
There are no longer two separate projects living inside the horizon
repository. There is a single project now with a single setup.py,
single README, etc.

The openstack-dashboard/dashboard django project is now named
"openstack_dashboard" and lives as an example project in the
topmost horizon directory.

The "horizon/horizon" directory has been bumped up a level and now
is directly on the path when the root horizon directory is on
your python path.

Javascript media which the horizon module directly relies upon
now ships in the horizon/static dir rather than
openstack-dashboard/dashboard/static.

All the corresponding setup, installation, build, and env scripts
have been updated accordingly.

Implements blueprint unified-packaging.

Change-Id: Ieed8e3c777432cd046c3e0298869a9428756ab62
2012-02-29 00:20:13 -08:00