Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bc1ae921
authored
Aug 29, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token auth
parent
c7fbfc51
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
3 deletions
+15
-3
circle/circle/settings/base.py
+1
-0
circle/circle/urls.py
+4
-1
circle/dashboard/models.py
+9
-0
circle/dashboard/urls.py
+1
-1
circle/dashboard/views/vm.py
+0
-1
No files found.
circle/circle/settings/base.py
View file @
bc1ae921
...
...
@@ -380,6 +380,7 @@ THIRD_PARTY_APPS = (
'simplesshkey'
,
'pipeline'
,
'rest_framework'
,
'rest_framework.authtoken'
,
)
...
...
circle/circle/urls.py
View file @
bc1ae921
...
...
@@ -33,6 +33,8 @@ from dashboard.views import (
from
dashboard.forms
import
CirclePasswordResetForm
,
CircleSetPasswordForm
from
firewall.views
import
add_blacklist_item
from
rest_framework.authtoken.views
import
obtain_auth_token
admin
.
autodiscover
()
urlpatterns
=
[
...
...
@@ -72,7 +74,8 @@ urlpatterns = [
url
(
r'^info/resize-how-to/$'
,
ResizeHelpView
.
as_view
(),
name
=
"info.resize"
),
path
(
'api-auth/'
,
include
(
'rest_framework.urls'
,
namespace
=
'rest_framework'
))
path
(
'api-auth/'
,
include
(
'rest_framework.urls'
,
namespace
=
'rest_framework'
)),
path
(
'api-token-auth/'
,
obtain_auth_token
)
]
if
'rosetta'
in
settings
.
INSTALLED_APPS
:
...
...
circle/dashboard/models.py
View file @
bc1ae921
...
...
@@ -61,6 +61,15 @@ except NameError:
logger
=
getLogger
(
__name__
)
from
django.conf
import
settings
from
django.db.models.signals
import
post_save
from
django.dispatch
import
receiver
from
rest_framework.authtoken.models
import
Token
@receiver
(
post_save
,
sender
=
settings
.
AUTH_USER_MODEL
)
def
create_auth_token
(
sender
,
instance
=
None
,
created
=
False
,
**
kwargs
):
if
created
:
Token
.
objects
.
create
(
user
=
instance
)
def
pwgen
():
return
User
.
objects
.
make_random_password
()
...
...
circle/dashboard/urls.py
View file @
bc1ae921
...
...
@@ -65,7 +65,7 @@ from .views.node import node_ops
from
.views.vm
import
vm_ops
,
vm_mass_ops
urlpatterns
=
[
path
(
'acpi/list'
,
iac_vm_list
),
path
(
'acpi/
vm
list'
,
iac_vm_list
),
url
(
r'^$'
,
IndexView
.
as_view
(),
name
=
"dashboard.index"
),
url
(
r"^profile/list/$"
,
UserList
.
as_view
(),
name
=
"dashboard.views.user-list"
),
...
...
circle/dashboard/views/vm.py
View file @
bc1ae921
...
...
@@ -102,7 +102,6 @@ def iac_vm_list(request):
'pk'
:
i
.
pk
,
'url'
:
reverse
(
'dashboard.views.detail'
,
args
=
[
i
.
pk
]),
'name'
:
i
.
name
,
'icon'
:
i
.
get_status_icon
(),
'host'
:
i
.
short_hostname
,
'status'
:
i
.
get_status_display
(),
'owner'
:
(
i
.
owner
.
profile
.
get_display_name
()),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment