-1

I am currently trying to deploy just a dummy django project to AWS and am having nothing but problems, i asked amazon support and they told me it is a code related issue. Every time i run the project locally i get the normal Welcome to Django page but once i use the eb deploy and publish it i received

"Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log."

I have no way of knowing what the problem even is, the log and deploy don't specify that anything went wrong. Is there anything that could cause this issue?

i used this site as a guide http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html

**UPDATE**

i made this change to the settings.py file

my local now shows me

"Not Found

The requested URL / was not found on this server."

and there is still the internal server error on the server

DEBUG = False

ALLOWED_HOSTS = ['*']

thank you!

g3n0k0m0
  • 31
  • 1
  • 3
  • 1
    Questions seeking debugging help (**"why isn't this code working?"**) must include the desired behavior, *a specific problem or error* and *the shortest code necessary* to reproduce it **in the question itself**. Questions without **a clear problem statement** are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable Example](http://stackoverflow.com/help/mcve). – MattDMo Aug 31 '15 at 19:43
  • 1
    My first guess is that you are running with DEBUG enabled when you test locally but without DEBUG when running in AWS. That combined with a client requesting a domain that is not listed in ALLOWED_HOSTS would cause a 500 internal server error by Django. For more, see http://stackoverflow.com/questions/15128135/setting-debug-false-causes-500-error. – jarmod Aug 31 '15 at 19:43
  • Hey MattDMo, thanks for the info, sorry this is my first time posting and i am not completely sure what code i can give that will help the problem my code is pretty much what is stated in the link provided. The only real error i have is the Internal Server because none of the logs are showing any other error – g3n0k0m0 Aug 31 '15 at 20:15
  • Are there any kind of apache logs you can look at (/var/log/....)? – jcfollower Aug 31 '15 at 20:19
  • This might be completely off - I don't have any experience with EBS. I have a django app running on A2Hosting. They limit the number of concurrent processes I can have running. Every time I would restart the service, it would add a process (and never remove one). So, I just kept hitting the max process limit and had to ask them to kill them occasionally. – jcfollower Aug 31 '15 at 20:30
  • Is it expecting to be connected to a database that isn't available to it? – jcfollower Aug 31 '15 at 20:34
  • my databse section is DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } which is a file in the directory it looks like – g3n0k0m0 Aug 31 '15 at 20:46
  • I'd suggest you to login via ssh and attempt to run it manually to see what might be happening, and check all individual logs that may be related as well. Are you using pip and virtualenv? Are you sure you have Django installed there? – jweyrich Aug 31 '15 at 20:56

2 Answers2

1

It was related to Django Being installed on Beanstalk, when i redid my virtual environment locally i needed to do the pip install django again for it to add Django==1.8.4 back to the requirements.txt file. Once that was put back in the application loaded properly on Beanstalk

g3n0k0m0
  • 31
  • 1
  • 3
1

comment out the database part form your django app and it should work. Looks like EB expects database setting to be exactly like in docs, meaning reading host, user, password from env vars.

After commenting out

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
} 

dummy app started working.

Ojas Kale
  • 2,067
  • 2
  • 24
  • 39
  • 1
    I tried this and it worked for me which i was very surprised about since my error message wasn't super related. Thank you so much!! – Andy Delworth Jul 15 '20 at 17:29