Lujeni / matterllo

Simple integration between Trello and Mattermost: send Trello activity notifications to Mattermost channels
MIT License
86 stars 25 forks source link

Fresh install fails on Django-2.2.10 #61

Closed Dekat closed 3 years ago

Dekat commented 4 years ago

I get this error when installing Matterllo :

File "matterllo/matterllo/urls.py", line 7, in <module>
    url(r"^login/$", auth_views.login, name="login"),
AttributeError: module 'django.contrib.auth.views' has no attribute 'login'

After executing this : python manage.py migrate

If I rollback this commit 9c107d59b3a0acf11a74c48c9b47b1bb989a26d2, from pull-request #60, it works again !

QuentinBibas commented 4 years ago

HI!

I'm having the same issue / error on a fresh install. Tried with both Django 2.2.10 and 2.2.13 How did you manage to get it to work ?

Just tried changing urls.py as per suggested in this stackoverflow post : https://stackoverflow.com/questions/47065438/attributeerror-module-django-contrib-auth-views-has-no-attribute I could get it to install and run It seems. Testing functionality once I've set it up.

Ok, It's mostly functionnal. The only thing that's not is the MATTERLLO_HOST definition which does nothing. The server seems to start only on localhost, which isn't compatible with an install after a seperate reverse proxy. Couldn't determine if manually starting the server on a specific IP/NIC was the cause or not.

It seems that MATTERLOO_HOST works, up to a point. the "login to trello" buton still wants to use the server IP as the referer. Manually changing the link to my domain name works.

here is my edited matterllo/urls.py file :

# -*- coding: utf-8 -*-
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.contrib.auth.views import LoginView
from django.contrib.auth.views import LogoutView

urlpatterns = [
    url(r"^login/$", LoginView.as_view(), name="login"),
    url(
        r"^logout/$", LogoutView.as_view(), {"next_page": "/login"}, name="logout"
    ),
    url(r"^admin/", admin.site.urls),
    url(r"^", include("core.urls")),
]

Also, I've set up automatic launch via systemd :

then, a matterllo service file (/lib/systemd/system/matterllo.service) containing

[Unit]
Description=Matterllo
After=network.target network-online.target

[Service]
Type=simple
User=root
Group=root
Restart=always
ExecStartPre=/bin/mkdir -p /var/run/matterllo
PIDFile=/var/run/matterllo/service.pid
ExecStart=/bin/sh /etc/matterllo.sh

[Install]
WantedBy=multi-user.target
Lujeni commented 4 years ago

Hey thanks for the issue. I'll take a look this week end and fix the issues.

I'm going to take this opportunity to do a little housework (cleanup, fix and kubernetes deployment)