Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8394072
create_test_admin.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
585 B
Subscribers
None
create_test_admin.py
View Options
# Copyright (C) 2019-2022 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
django.contrib.auth
import
get_user_model
username
=
"admin"
password
=
"admin"
email
=
"admin@swh-web.org"
User
=
get_user_model
()
try
:
user
=
User
.
objects
.
filter
(
username
=
username
)
.
get
()
except
User
.
DoesNotExist
:
user
=
User
.
objects
.
create_superuser
(
username
,
email
,
password
)
assert
user
.
is_staff
is
True
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Wed, Jun 4, 7:21 PM (4 d, 19 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3237751
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment