sbearben / chat-backend

Backend for Android ChatApp - written using Python Django. Repository for Android app: https://github.com/sbearben/ChatApp
15 stars 13 forks source link

mysite.routing import error #1

Open deepak013 opened 4 years ago

deepak013 commented 4 years ago

Getting error django.core.exceptions.ImproperlyConfigured: Cannot import ASGI_APPLICATION module 'mysite.routing'

I am not able to find any reason for this error. Please help.

pmburu commented 4 years ago

I encountered the same problem and solved it by:

  1. Upgrading Django version as well as channels
  2. There were afew errors along the way with module dependency issues.

Please post the entire error log here and let me help you

himanshu-patel-dev commented 3 years ago

from firebase_admin.exception import ApiCallError This is deprecated now we can no longer import ApiCallError now we have to import from firebase_admin.exception import FirebaseError instead

But even after this I was unable to avoid the error so I commented this out

def send_event_via_fcm(user, realtime_event_dict):
    token = UserRegistrationToken.objects.get_token_if_exists(user)

    print("Firebase: send_event_via_fcm - pre send")
    if token is not None and token != "":
        message = messaging.Message(
            data=realtime_event_dict,
            token=token,
        )
        try:
            response = messaging.send(message=message, dry_run=False, app=default_app)
            print("Firebase: send_event_via_fcm - post send: " + response)
        except:
            pass
        # except (ApiCallError, ValueError) as e:
            # print("Firebase: messaging.send(..) failed: " + str(e))
    else:
        print("No valid FCM token for user.")

But now I am facing another Issue. After getting both server running from where to start. That is, now how to make users, register, login and then test all this by actual chatting.