0

I have created a web application where Sign Up and login was create using Django’s authentication system. Basically I used the code from this page: https://www.geeksforgeeks.org/django-sign-up-and-login-with-confirmation-email-python/

On my server the project is working perfectly, but when I did the hosting it is not possible to create users.

I have a suspicion that my problem is with the database because I am using the default django settings. This is the error I get when I try to create user on the hosted site:


 The above exception (relation "auth_user" does not exist LINE 1: SELECT (1) AS "a" FROM "auth_user" WHERE "auth_user"."userna... ^ ) was the direct cause of the following exception:
/app/.heroku/python/lib/python3.8/site-packages/django/core/handlers/exception.py, line 55, in inner

                    response = get_response(request)
Local vars
/app/.heroku/python/lib/python3.8/site-packages/django/core/handlers/base.py, line 197, in _get_response

                    response = wrapped_callback(request, *callback_args, **callback_kwargs)

Local vars
/app/user/views.py, line 32, in register

            if form.is_valid():

To Request information I got:

**Request information**

USER AnonymousUser

**GET** No GET data

**POST**

Variable    Value

username 'test01'

email 'test01@gmail.com'

password1 'mtHya2yaWRw2nxK'

password2 'mtHya2yaWRw2nxK'

As I said on the local host the site works very well. I would like to know how can I fix the error or how can I build a simple database just for user registration?

  • 1
    Welcome to Stack Overflow. I seem to remember encountering this type of question and I believe my comment is still the same. Please include relevant parts of the code. Also, please refrain from showing credentials. They are unnecessary. ergo. If those *are* your credentials, please change them. – ewokx May 03 '22 at 23:51
  • 1
    "relation "auth_user" does not exist"—have you run your migrations on Heroku, e.g. by running `heroku run python manage.py migrate`? – ChrisGPT was on strike May 04 '22 at 00:36
  • I really hadn't done the migrations in Heroku, I did and now it is working perfectly. Thanks a lot @Chris, I had wasted a lot of time trying to find the error. –  May 04 '22 at 01:33

0 Answers0