Error server 500 Reverse openshif with Django

Asked

Viewed 51 times

0

I deployed an application in openshift and basically the same is a crud, what happens, whenever I try to register a new client the server returns me "server error 500", does anyone know tell me why this error? , I am thinking that the problem may be due to my get_absolute_url in my models, the problem and that locally the application runs smoothly, but in the air it returns me this error.

detail am using Generic views:

#views.py
class ListView(LoginRequiredMixin, ClientMixin, ListView):
    template_name = 'core/client_list.html'
    context_object_name = 'clients'
    paginate_by = 10

#models.py
def get_absolute_url(self):
    return reverse_lazy("profile_view")
  • You own DEBUG = False, right? It makes it hard to know what the mistake is because there are many possibilities... Have how to put it True just to test? Otherwise, it will be necessary to look at the error logs to know for sure. Some possibilities: 1) token against CSRF is missing (common if the problem is only in POST and not in GET); 2) The Setting ALLOWED_HOSTS is missing. If the problem is only in that specific view, and not in the others, disregard that comment.

  • @mgibsonbr Here’s my problem with DEBUG enabled: table core_client has no column named address, after accessing the server via ssh can you tell me how to delete my data (mysql) to fix the error? , I did not find my bank anywhere here, and the strange thing is that when I create a superuser via command line it appears in the bank but when I try to access the /admin/ it accuses that there is no registered user.

  • Is the web version of your system using the right database? Check your Settings. Unfortunately I don’t know anything about openshift, so there’s no way I can help you with that... But at least we’ve identified more or less where the problem is (in the bank, not in your code). P.S. You’re using migrations? (Migrations) Have you touched the bank since the last deploy? (if that is not your first deploy, of course)

  • I am using Django 1.6, really this strange case of my database, because via ssh I do not find the same anywhere, I will make some changes here to see if I can fix the error, I thank you for your support.

  • did not find the database because the myqsl DATABASES was located in the wrong Settings. solved my "has no column named" problem by deleting the database using ... 1: $ rhc Cartridge remove mysql-5.5 --app myphpapp1 2: $ rhc Cartridge add mysql-5.5 --app myphpapp1 3: $ rhc app-stop myphpapp1 4: $ rhc app-start myphpapp1

  • all your problems solved then dhelbegor?

  • @Rubico, Sorry for the delay in returning, were yes, thank you for everyone’s attention.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.