Django - CREAR ADMIN DJANGO

 
Vista:

CREAR ADMIN DJANGO

Publicado por Ángel (1 intervención) el 28/02/2019 09:30:31
Buenos días.


Estoy desarrollando un servidor en Django utilizando como base de datos Cassandra (a su vez hago uso de django-cassandra-engine).
Mi idea es poder crear usuarios para la aplicación y distintos perfiles que tendrán diversos permisos sobre la misma.
Mi problema llega a la hora de ejecutar en el shell el comando:
$ python3 manage.py createsuperuser
Obtengo el siguiente error:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.6/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 59, in execute
    return super().execute(*args, **options)
  File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.6/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 93, in handle
    default_username = get_default_username()
  File "/usr/local/lib/python3.6/dist-packages/django/contrib/auth/management/__init__.py", line 136, in get_default_username
    auth_app.User._default_manager.get(username=default_username)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 393, in get
    num = len(clone)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 250, in __len__
    self._fetch_all()
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 1186, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 54, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py", line 1065, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.6/dist-packages/django_cassandra_engine/utils.py", line 50, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.6/dist-packages/django_cassandra_engine/connection.py", line 15, in execute
    return self.connection.execute(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/django_cassandra_engine/connection.py", line 104, in execute
    return self.session.execute(qs, *args, **kwargs)
  File "cassandra/cluster.py", line 2171, in cassandra.cluster.Session.execute
  File "cassandra/cluster.py", line 4062, in cassandra.cluster.ResponseFuture.result
cassandra.protocol.SyntaxException: <Error from server: code=2000 [Syntax error in CQL query] message="line 1:260 no viable alternative at input '.' (...auth_user.date_joined FROM auth_user WHERE [auth_user]....)">


Respecto a la configuración que tengo en la BBDD de settings.py es la siguiente:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
DATABASES = {
    'default': {
        'ENGINE': 'django_cassandra_engine',
        'NAME': 'prototipoDB',
        'TEST_NAME': 'test_db',
        'HOST': '127.0.0.1',
        'OPTIONS': {
            'replication': {
                'strategy_class': 'SimpleStrategy',
                'replication_factor': 1
            }
        }
    }
}
¿Alguien me podría ayudar para poder crearme un superusuario en Django teniendo una base de datos cassandra y así poder hacer toda la gestión de usuarios, perfiles y permisos de los mismos?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder