I am trying to deploy my django project on shared hosting. I am trying from couple of hours but still now I can't host my django website and getting "Internal Server Error Error 500".
this is my root passenger_wsgi.py
from my_root_folder_name.wsgi import application
#setting.py
ALLOWED_HOSTS = ['mydomain.com','www.mydomain.com']
I also installed python app and django on my server. Now I am hopeless. I am trying from last five hours for host an website but still now I can't. Where I am doing mistake???
I am seeing those error from error log:
File "/home/sellvqed/virtualenvass/dfdf/3.8/lib/python3.8/site-packages/django/apps/registry.py", line 83, in populate
raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant
Finally I solved my problems after delete all apps and virtual folder from my hosting account. T
Related
I'm working on a Django website that I'd like to deploy with Heroku. When I try to deploy to Heroku, it keeps crashing.
I've been having an issue with my Procfile.
My Procfile:
web: gunicorn theGame.wsgi
I have a wsgi file in the same folder as my settings folder.
My Django Project is named theGame. The main application that holds all the html files is called 'interface'.
When I restart my dynos, I keep getting the same error:
[TIMESTAMP] app[web.1]: ModuleNotFoundError: No module named 'theGame.wsgi'
I am trying to host my Django application on Windows 2016 server IIS server. I had used Python, Django, pipenv as virtual environment and PostgreSQL as Database.
How to host is using a Domain Name ?
I had tried almost tried everything available on the internet but till now I am not successful.
Maybe I have not got the perfect tutorials or find the correct one to host the Django Application.
Please help me host the Django Application on IIS 10.
I will be really grateful for the help
Thanks in advance.
Error occurred while reading WSGI handler:
Traceback (most recent call last):
File "c:\users\sachin kumar\.virtualenvs\login-zru7l_54\lib\site-packages\wfastcgi.py", line 791, in main
env, handler = read_wsgi_handler(response.physical_path)
File "c:\users\sachin kumar\.virtualenvs\login-zru7l_54\lib\site-packages\wfastcgi.py", line 633, in read_wsgi_handler
handler = get_wsgi_handler(os.getenv("WSGI_HANDLER"))
File "c:\users\sachin kumar\.virtualenvs\login-zru7l_54\lib\site-packages\wfastcgi.py", line 586, in get_wsgi_handler
raise Exception('WSGI_HANDLER env var must be set')
Exception: WSGI_HANDLER env var must be set
StdOut:
StdErr:
Check your settings of FASTCGI Module and add needed environment variables
Full docs from Microsoft to run python scripts on IIS are here
offtop: don't use space in your user_name (and in the user folder respectively).
I'm never done development in a career as a software programmer
I'm given this domain name on NameCheap with the server disk. Now I design Django app and trying to deploy on the server but I had problems (stated below)
[ E 2019-03-19 06:23:19.7356 598863/T2n age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /home/username/IOT: The application process exited prematurely.
App 644163 output: File "/home/username/IOT/passenger_wsgi.py", line 1, in <module>
App 644163 output: File "/home/username/virtualenv/IOT/3.7/lib64/python3.7/imp.py", line 171, in load_source
edited: Read more about the software supporting the WSGI is using Phusion Passenger, you could read more here; www.phusionpassenger.com
this is my passenger_wsgi.py:
from myproject.wsgi import application
I had tried several tutorials:
https://www.youtube.com/watch?v=ffqMZ5IcmSY&ab_channel=iFastNetLtd.InternetServices
https://smartlazycoding.com/django-tutorial/deploy-a-django-website-to-a2-hosting
https://hostpresto.com/community/tutorials/how-to-setup-a-python-django-website-on-hostpresto/
https://www.helloworldhost.com/knowledgebase/9/Deploy-Django-App-on-cPanel-HelloWorldHost.html
https://www.helloworldhost.com/knowledgebase/9/Deploy-Django-App-on-cPanel-HelloWorldHost.html
how to install django on cpanel
Very much applicate if you could help
When you setup a python app in cpanel, you specify the folder where you have setup the app. That will be the folder that will contain your passenger_wsgi.py file. You have to upload your django project to that same folder. To make sure they you have uploaded to the right directory, just have this simple check_ your manage.py and passenger_wsgi.py should be in the same folder. Now edit your passenger_wsgi.py and replace everything with the following code:
from myapp.wsgi import application
After this, do not forget to restart the python app. I have written a step by step guide for deploying django app on shared hosting using cpanel. Check it here.
The answer very simple, my server is using a programme name passenger, the official website for more information: https://www.phusionpassenger.com/
Now error very simply; passenger can't find my application, All I did was move my project and app folder on the same layer passenger_wsgi.py and it works like charm.
I'm using the following tutorial to upload a django webapp to a digital ocean server. Everything seems fine while entering the following commands:
pip install --upgrade django
service gunicorn restart
According to the tutorial I now should be able to see my webpage (without the bootstrap theme/fonts) after refreshing the host ip in my browser. Instead I get the following error:
I've looked up the nginx error.log in /var/log/nginx/error.log and it says the following:
2017/01/20 08:18:23 [error] 9342#0: *38 recv() failed (104:
Connection reset by peer) while reading response header from
upstream, client: 92.111.75.86, server: _, request: "GET / HTTP/1.1",
upstream: "http://127.0.0.1:9000/", host: "104.236.68.12"
Question: How do I fix this 502 bad gateway so that my site works properly? I've tried to add ALLOWED_HOSTS = ['104.236.68.12'] to settings.py already and I've also tried to create a droplet with ubuntu 16.04 as well.
You should add the IP address of your DigitalOcean droplet to the ALLOWED_HOSTS variable in your Django settings. Starting from your nginx log, I would set:
ALLOWED_HOSTS = ['104.236.68.12']
P.S: Consider to adopt Docker for the deployment of your django app
I'm so sorry guys. This solved the issue...
Dragging my django app in filezilla to
home/django/django_project
instead of:
home/django/django_project/django_project
Basically wasn't precise enough when reading the tutorial, so sorry!
Good day:
In the settings.py exactly in
ALLOWED_HOSTS = ['*']
This will make it collect all the ips.
I have deployed a Django 1.3.1 app on apache2 in my machine using mod_wsgi.I used to log some values in the app using python logging module and these were written to a mylog.txt file in the application base directory.However I deleted this file and commented out every log() call in my code.In the django standalone server the app runs without any problem.But when I start the app in apache,I get this apache log entry
[Sat Mar 31 09:34:40 2012] [error] [client 127.0.0.1] TemplateSyntaxError: Caught IOError while rendering: [Errno 13] Permission denied: '/home/me/dev/python/django/myapp/mylog.txt'
I cannot understand why this happens ,since I commented out every log related line in the code and even the variable which tells the logfile's name in settings.py
I tried clearing the cache..but even that didn't help
can someone help me figure this out?
The module details are as below
Apache/2.0.63 (Unix) DAV/2 mod_wsgi/3.3 Python/2.6.5 Server at 127.0.0.1 Port 80
what are the unix/linux permissions on your mylog.txt file?
ls -la /home/me/dev/python/django/myapp/mylog.txt should show the unix/linux perms. Can you paste the results of this command? (update it in your question above if possible)
Apache2 user on your system (depending on which linux distro of if you use Mac) are most likely 'www-data' or 'http'. You will need to make sure that mylog.txt has the correct unix/linux owner and the correct permissions mode so that apache2 can write into this log file.
I also met this problem in Webpy+Apache. And I changed the Apache logs directory owner to Apache user then the problem solved.