Media files not showing up after deployment - django

So I just finished deploying a django app to the internet and for some reason media files won't show up.
here's the link I followed
everything works perfectly fine but medias and the weird thing is the media does exist at the exact path it should come from but it won't show up.

try to change root to alias in your nginx setup and after service nginx restart

Related

Django admin misbehaves after adding for django.contrib.sites on server

Django Admin Site was working fine on local server.
But the same thing when deployed on server. Admin CSS misbehaves See Screenshot Admin panel screenshot on server
admin panel site also working fine on mobile responsive view or small screens
On localhost it looks something like this.
I have ran collect static several times on server but nothing happens.
Tried Clearing Cache many time.
Nothing worked
But localhost seems to work fine
I find answer myself.
Initially a old version of site already working on server.
Then i added django.contrib.sites for django.contrib.sites
Upon adding that when update is pushed to server then
python manage.py collectstatic
command does not completely replace old files.And It doesn't work well with old files.
So run collectstatic command on local
upload generated folder to
server to avoid any such issues

404 when multiple dots on url

I´m working on a React project.
When I try to load some local route like '/example.2.2/hello.js`im getting 404, if I do the same changing the folder and the path '/example22/hello.js' it is working additionally if I host it https://example.com/example.2.2/hello.ja it is working.
I'm using apache server to virtualhost, windows 10.
Thanks
Node has problems hosting content with dots(periods) on the folder name on windows platform, I just changed package.json

Django perpetual 404s when visiting project directory URL

I have a very strange problem with Django and OLS. I am using the OpenLitespeed Django one click install droplet on Digital Ocean. In both my custom app and the example app in the droplet, if I visit a URL that matches the django project directory (in the example app, this is /demo/), then any subsequent page visits give a 404 error, no matter what URL you do. To reproduce, I've spun up a completely clean install of the droplet, then do the following steps:
Go to / -> see "Hello world!" as expected
Go to /demo/ -> also see "Hello world!" even though this should be a 404, as this URL is not specified in the urls.py or anywhere else
Go back to / -> 404! It seems to be looking for /demo/demo/ which doesn't exist
Trying any other URL also results in a 404.
The only way to get back to the normal behavior is to restart the OLS process. Everything then functions as expected unless any URL that starts with the project directory name is visited, in which case the whole thing crashes and returns 404s again.
Any help that can be provided to try and further troubleshoot this or possible fixes is greatly appreciated!
Versions:
OLS 1.6.9
Django 2.2 and 3.0
Python 3.6
Thanks for the bug reporting. It's a bug of "virtual context settings for wsgi" and should already fixed on version 1.6.11. If it's not on the repository, you can run the following command to upgrade it.
/usr/local/lsws/admin/misc/lsup.sh -v 1.6.11
Best,
Eric

Files are not found in server, but they are uploaded

I am trying to install opencart TVS on VPS server which is running Centos 7. I have used some tutorials, done everything like they said. Opencart files are uploaded into server but however install/index.php file is not found.
So I tried to upload an image to server and see if it shows or not. Nope, it does not show.
I have installed Centos Panel. Created account over there. Created database there also. The problem that I cannot see uploaded files and I think that install/index.php is not shown due to the same problem.
Apache: Apache version: Apache/2.4.39
MySQL version: 10.1.38-MariaDB
Server IP: http://141.136.44.45
File is listed in Home/USERNAME/public_html/
So as understand the file should be reached like: http://141.136.44.45/1.png (it is uploaded in Home/USERNAME/public_html/1.png

Unable to run deployed application on glassfish server

I have successfully installed Glassfish on a Ubuntu 16.04 instance.
The deployment of my webservice is also succesfull, When I launch the application, I get a page that says
Web Application Links
If the server or listener is not running, the link may not work. In this event, check the status of the server instance. After launching the web application, use the browser's back button to return to this screen.
When I click on a link (both HTTP and HTTPS), I get a 404 error.
I presume that there must be something wrong with my server, but all tutorials about setting up a glassfish server seem to go straight out-of-the-box, so I don't get a clue why it isn't working in my case.
I also can't find where to check the listeners or server instance, and what they should be configured like.
Last thing to mention: I have never used glassfish before, I only need to test if a webservice is working like expected before sending it to a customer who will deploy it himself.
What directory structure do you use in your *.war file? By default static files (like index.html) should be placed in the root folder - not in the WEB-INF. So a typical directory structure would look like this:
myWebApp/
WEB-INF/
web.xml
lib/
MyLib.jar
classes/
mypackage/
MyServlet.class
index.html
index.jsp
I deploy a Web Service using REST and I have the same problem.
My structure is :
MyProject
.idea
lib
out
src
MyApp
Helloworld
web
web.xml
WEB-INF
index.jsp
MyProject.iml
External Librairies
I followed a tuto (https://www.jetbrains.com/help/idea/2017.1/creating-and-running-your-first-restful-web-service-on-glassfish-application-server.html#d76541e113) and I should have a web page on http://localhost:port/appArtefact/helloworld