Django cannot run with http - django

After open server, web only run without "http" url
like this127.0.0.1:8000/blog/
and add http with 404 ERROR,where I did wrong?

For now you are developing the Django not deploying it on the server. The http or https will be set with the server configuration file. It don't work now. Simply develop your site and figure this out when you are deploying the app

Related

Django issue with angular

I am trying to deploy my application using below tech stack:
Angular - Frontend
Django - Backend
When I am trying to access over https my app the backend is giving following error
Not Found: /
[05/Jul/2021 00:57:08] "GET / HTTP/1.1" 404 2356
[05/Jul/2021 02:42:50] code 400, message Bad request version ('À\x14À')
[05/Jul/2021 02:42:50] You're accessing the development server over HTTPS, but it only supports HTTP.
You're using the development server to host the application, this is not suggested and does not work with https only http.
Use a production grade server like:
Apache
Nginx
Others
For more information visit the django-depolyment docs
You will also need to generate and sign a https certificate, for that I would suggest using Lets Encrpty

REST API not working and redirecting with https/ssl

I have build and application with angular 5 and REST API with golang and hosted them on aws ec2 instance, I have installed ssl certificate to run the app and api on https. following is my url structure to run app and api ( api is running on 8080 port
app : https://mysite.maindomain.com
api : https://mysite.maindomain.com:8080
When I hit api after setting up the ip in host file on system it works fine but its not working with aws and redirects to https://mysite.maindomain.com:8080 when I hit any api like https://mysite.maindomain.com:8080/signup or https://mysite.maindomain.com:8080/get-user/10
Nor sure what is the issue here but everything else is working fine
I am using gin gonic as go framework and also have used RunTLS as recommended.
Not sure I fully appreciate the issue, but just in case, have you setup CORS on the API server (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
If you run a browser application served from ORIGIN1, and the browser tries to access an API on DESTINATION2, the API server must state to the browser that it is indeed authorized to reply to a browser originating from ORIGIN1.
You can for example use https://github.com/gin-contrib/cors to add CORS support to your API server.
Good luck.

CORS issue though django-corsheaders is set up

I'am getting an error message from Angular whenever I try to make an AJAX call to an endpoint of my backend (on a separate domain, running Django 1.7):
Cross origin requests are only supported for protocol schemes: http,
data, chrome-extension, https, chrome-extension-resource
I do have django-corsheaders installed, CORS_ORIGIN_ALLOW_ALL = True and the middleware set up properly. So what's wrong?
I am not sure if this information is relevant, but I am still testing everything on a single host, meaning there is one XAMPP server running for the Angular frontend at localhost and one Gunicorn instance running at localhost:5000 for the backend.

django-allauth running in SSL

I am able to setup django-allauth with social login using this tutorial.
However I need running all my website in https.
Can django-allauth be successfully and reliably used with django-sslify?
The web server you're hosting Django in handles SSL. If you put Nginx or Apache in front, for example, they will do all the SSL work. Django won't have any concept of being HTTP vs HTTPS.
The django-sslify module doesn't make a site run in SSL, it just redirects any detected non-SSL request to the equivalent SSL URL.
For django-allauth to work with SSL, all you need to do is ensure the configuration of redirect URLs is set to https://... etc.

Disabling HTTPS in Axis2 web service

I have created an Axis2 web service from Netbeans and deployed it successfully in Tomcat 6 on my web server.
When I use for instance SoapUI or Taverna to consume the web service, the server offers both HTTP and HTTPS methods to invoke it. However, using the HTTPS method renders a 404 error. (Probably because there is a server admin panel running on port 8443, but that doesn't matter right now.)
The problem is that my web service clients default to using the HTTPS service. I figured the simplest thing I could do to get the basic service to work, would be to disable the HTTPS endpoint, as the HTTP version runs flawlessly and I don't need the added security. But now I've spent hours on finding out how to do that, without success. The WSDL returned by Axis2 contains entries for HttpsSoap11Endpoint but the WSDL that's bundled in my .AAR file after the build does not.
Does anybody know how to make Axis2 offer just HTTP endpoints?
In axis2.xml, comment out the https transport receiver to disable the HTTPS endpoint.