Category Archives: admin

When to use Apache Helix and when to use Apache Mesos

Apache Mesos Apache Mesos is a cluster manager that provides efficient resource isolation and sharing across distributed applications, or frameworks. It can run Hadoop, MPI, Hypertable, Spark, and other frameworks on a dynamically shared pool of nodes.

Apache Helix Apache Helix is a generic cluster management framework used for the automatic management of partitioned, replicated and distributed resources hosted on a cluster of nodes. Helix automates reassignment of resources in the face of node failure and recovery, cluster expansion, and reconfiguration.

Both are cluster managers, which one to choose and why?

Prestashop 1.6 AdminCustomerThreads go to dashboard

I have some problem with prestashop, in backoffice.

When i go to in menu tabs to "Customer service" then url with token redirect to dashboard.

If i change url without token then it is working. In other tabs(links) in backoffice doesnt this problem.

Generally, if my urls is: index.php?controller=AdminCustomerThreads&token=(some token) then go to dashboard

if url is index.php?controller=AdminCustomerThreads then it is ok

It is only in this example.

I was trying turn on debug mode but it dont get any errors or warnings.

Please about some tips.

Django admin actions and Apache2, file not found error

I'm using Django 1.9.2 and Apache 2.4 for serving admin django site. I configured an action for pdf generation. The configuración worked without errors using django development server but apache2 gives this error:

FileNotFoundError: [Errno 2] No such file or directory: 'base.odt'

The debug info from Django:

FileNotFoundError at /admin/coleccion/material/
[Errno 2] No such file or directory: 'base.odt'
Request Method: POST
Request URL:    http://test.mysite.eu/admin/coleccion/material/
Django Version: 1.9.2
Exception Type: FileNotFoundError
Exception Value:    
[Errno 2] No such file or directory: 'base.odt'
Exception Location: /usr/lib/python3.4/zipfile.py in __init__, line 923
Python Executable:  /usr/bin/python3
Python Version: 3.4.2
Python Path:    
['/var/www/coldpv',
 '/usr/lib/python3.4',
 '/usr/lib/python3.4/plat-x86_64-linux-gnu',
 '/usr/lib/python3.4/lib-dynload',
 '/usr/local/lib/python3.4/dist-packages',
 '/usr/lib/python3/dist-packages',
 '/var/www']. 

But the file base.odt is in the path:

ls -l /var/www/coldpv/base.odt

-rw-r--r-- 1 cris www-data 15306 feb  5 09:15 /var/www/coldpv/base.odt

My simple model below:

class Material(models.Model):
    identificacion = models.CharField(max_length=30, verbose_name='Identificación del material')
    num_com = models.CharField(max_length=30, verbose_name='Número')
    nombre_sp = models.CharField(max_length=30, verbose_name='Nombre científico')

and my admin.py:

wk_dir = os.path.dirname(os.path.realpath('__file__'))
class MaterialAdmin(admin.ModelAdmin):
    list_display = ('num_com', 'identificacion')
    search_fields = ('num_com', 'identificacion')
    actions = ['PrintReg']

    def PrintReg(self, request, queryset):
        A = queryset
        for i in range(0, A.values().count()):
            ficha = A.values()[i]
            basic = Template(source='', filepath='base.odt')
            basic_generated = basic.generate(o=ficha).render()
            open(os.path.join(wk_dir, 'tempw/fichar'+str(i)+'.odt'), 'wb').write(basic_generated.getvalue())

Django admin actions and Apache2, file not found error

I'm using Django 1.9.2 and Apache 2.4 for serving admin django site. I configured an action for pdf generation. The configuración worked without errors using django development server but apache2 gives this error:

FileNotFoundError: [Errno 2] No such file or directory: 'base.odt'

The debug info from Django:

FileNotFoundError at /admin/coleccion/material/
[Errno 2] No such file or directory: 'base.odt'
Request Method: POST
Request URL:    http://test.mysite.eu/admin/coleccion/material/
Django Version: 1.9.2
Exception Type: FileNotFoundError
Exception Value:    
[Errno 2] No such file or directory: 'base.odt'
Exception Location: /usr/lib/python3.4/zipfile.py in __init__, line 923
Python Executable:  /usr/bin/python3
Python Version: 3.4.2
Python Path:    
['/var/www/coldpv',
 '/usr/lib/python3.4',
 '/usr/lib/python3.4/plat-x86_64-linux-gnu',
 '/usr/lib/python3.4/lib-dynload',
 '/usr/local/lib/python3.4/dist-packages',
 '/usr/lib/python3/dist-packages',
 '/var/www']. 

But the file base.odt is in the path:

ls -l /var/www/coldpv/base.odt

-rw-r--r-- 1 cris www-data 15306 feb  5 09:15 /var/www/coldpv/base.odt

My simple model below:

class Material(models.Model):
    identificacion = models.CharField(max_length=30, verbose_name='Identificación del material')
    num_com = models.CharField(max_length=30, verbose_name='Número')
    nombre_sp = models.CharField(max_length=30, verbose_name='Nombre científico')

and my admin.py:

wk_dir = os.path.dirname(os.path.realpath('__file__'))
class MaterialAdmin(admin.ModelAdmin):
    list_display = ('num_com', 'identificacion')
    search_fields = ('num_com', 'identificacion')
    actions = ['PrintReg']

    def PrintReg(self, request, queryset):
        A = queryset
        for i in range(0, A.values().count()):
            ficha = A.values()[i]
            basic = Template(source='', filepath='base.odt')
            basic_generated = basic.generate(o=ficha).render()
            open(os.path.join(wk_dir, 'tempw/fichar'+str(i)+'.odt'), 'wb').write(basic_generated.getvalue())

CakePHP 3: htacess auto redirect webroot/admin/

When I enter localhost:3000/admin the url redirects to localhost:3000/webroot/admin

But I enter localhost:3000/admin/ is correct router

Router::prefix('admin', function ($routes) {
    //$routes->connect('/:controller/:action/*', ['prefix' => 'admin']);
    $routes->connect('/', ['controller' => 'admins', 'action' => 'index']);
    $routes->fallbacks('InflectedRoute');
});

htacess:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$ webroot/    [L]
    RewriteRule    (.*) webroot/$1 [L]

My magento admin panel goes to a unexpected url localhost/magento/admin/admin/dashboard/index/key/d0635adba364ac457fb10aa4f6147

I have just uploaded Magento on localhost and its url is simply this (localhost/magento) but when I go on its admin part i.e (localhost/magento/admin) part url redirects to a very complicated & unexpected url i.e (http://localhost/magento/admin/admin/dashboard/index/key/d0635adba364ac457fb10aa4f6147b02c983c632402595b88482d7956d7accf0/), Please help me out that how can overcome from this problem.??? I have earlier uploaded its previous version but then i have not face this type of problem but that i had uploaded directly on server not on localhost.Please help somebody I am in huge confusion that what should i do next.

Magento admin panel showing "401-Authorization Required"?

I am user of Magento . When I enter the credentials of Magento admin panel username and password it shows again one login popup form and while closing it shows "401-Authorization required"-This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. Please can anyone help me to resolve this issue.