I finished my project in the development server and now I worked it using Apache in the localhost. The project worked good. Now, I got an apache sever. can you please clarify some of my doubts;
1. Need to upload the Django installation files, mod_wsgi and any other files to the server?
2. Can I maintain the same folder directory as I did with the local host Apache?
3. what is httpd.conf, and where can I find it in my server?
I am using Linux ubuntu OS, Python 2.7, Django 1.6 and my server got its first level of directories like:
.cpanel, .htpasswords, cpmove.psql, etc, logs, mail, public_ftp, ssl, tmp, www, access-logs and some more .conf and other type files.
Among above directories, I can't open the www folder.
Please suggest any tutorial or some other way to resolve things. It will be very helpful for me and my team.
Thanks in advance
Related
I am trying to deploy a django project using POSTGIS on my windows 11 PC with Apache 2.4.
The web page is working as long as I am not using 'django.contrib.gis'.
When I add 'django.contrib.gis' to my INSTALLED_APPS and define GDAL_LIBRARY_PATH to point to my gdal installation things stop working.
Specifically, trying to access the web app ends up in infinitely loading the page. Weird enough there are no errors in the apache error log. The apache service starts fine.
As far as I can see gdal install is correct as the app is working fine on the same machine with the same python environment with the django development server.
Actually, I have the same issue with other python libraries that need some dlls, like opencv.
So my guess is that it is a security related issue, but I do not find any clues on how to solve it.
Any ideas?
I tried also to grant rights to the directory where gdal is install in apache conf. But no luck.
I am learning python and Django now. I have a question related to deploying Django project on windows 7. I know how to start the test server in django and see the project. But I have to do start the server manually every time I restart the PC. Also I have to keep the terminal window open.
Consider the below scenario for php projects.
We copy and paste the php files in htdocs or www folder in apache server and access them using the respected url. Web Server is running in the background. We dont have to start the server on windows restart.
Is something similar possible with Django on apache or any other server?
If yes, how should I go about it?
Thanks in advance.
For anyone stumbling around for an answer to a similar problem with deploying Django on a Windows server, here is a guide
Deploy Django with Apache and mod_wsgi on Windows Server 2019
To have Apache24 service automatically run on startup, make the changes in Windows Services dialog.
I'm in a university and I'm provided with a public_html folder where I can put my CGI scripts. For eg. when I put PHP scripts and visit them from my browser, it works correctly and the PHP is properly interpreted.
I wish to run Django apps in this environment and I know that the university runs an apache server and had mod_php and mod_python installed, although I think I'm not allowed to modify the httpd.conf etc.
All the tutorials that I've read about Django on mod_python ask me to modify the httpd.conf, is there any way I can get my Django site running by making non-sudo changes only?
You can try to put your directives in a .htaccess file in your directory. Dependent on the server config, it might work.
I am brand new to web app development and thought I would try django as I am familiar with python. I followed the following guide: http://www.lennu.net/2012/05/14/django-deployement-installation-to-ubuntu-12-dot-04-server/ to deploy a django page to the letter. However, I now realize that this guide was for the server version of the OD and i'm running the desktop version. When I try to open my site in chrome (amitash.r) it fails with a page not found. Now when I open localhost, I get an internal server 500 error. All my config files are exactly as stated in the guide. Any fixes?
Can you post your mod_wsgi script and Apache VirtualHost file?
Following the instructions from the link you gave, the mod_wsgi script should be in:
/srv/my_project/app/conf/apache/django.wsgi
The VirtualHost file location from the link should be:
/etc/apache2/sites-available/DOMAIN
Make sure you enabled your site. If you named your file DOMAIN, like the instructions, you should enable the site using:
a2ensite DOMAIN
I've got a ubuntu vps and apache mod wsgi installed and serving my django sites.
however i have to restart all of apache rather than the site i have amended and its going to be a bit shonky if i tell clients that i have restarted their site cos i updated another site.
is there a tutorial somewhere to teach me how to configure this? i couldnt find one in googles keywords soup.
I'm already using virtualenvs if it helps.
Assuming you use mod_wsgi in daemon mode on UNIX/Apache 2.X system to run Django and have shell access to your machine all you need to do is touch the wsgi configuration for your project.
touch your_project.wsgi
See mod_wsgi documentation on Reloading Source Code and Django - mod_wsgi wiki for more references.