Categories
Mastering Development

Django + React Able to create new user in database, but token-auth returns 400 bad request

So I have an app that I’m writing. It’s working, for the most part, so far. I only currently have a login and signup setup, with a ‘homepage’ that just has a logout button and some text on it so I can test. When I do signup, it posts the user to the database, but […]

Categories
Mastering Development

django-cors-headers not work in for patch method

INSTALLED_APPS = [ # default django apps ‘jazzmin’, ‘django.contrib.admin’, ‘django.contrib.auth’, ‘django.contrib.contenttypes’, ‘django.contrib.sessions’, ‘django.contrib.messages’, ‘django.contrib.staticfiles’, # Optional: Django admin theme (must be before django.contrib.admin) ‘rest_framework’, ‘rest_framework_simplejwt.token_blacklist’, ‘corsheaders’, ‘treebeard’, ‘UserAccount.apps.UseraccountConfig’, ‘CompanyInfo.apps.CompanyInfoConfig’, ‘Backup.apps.BackupConfig’, ‘FinancialPeriod’, ‘Inventory.apps.InventoryConfig’, ‘Product.apps.ProductConfig’, ] MIDDLEWARE = [ ‘corsheaders.middleware.CorsMiddleware’, ‘django.middleware.security.SecurityMiddleware’, ‘django.contrib.sessions.middleware.SessionMiddleware’, ‘django.middleware.common.CommonMiddleware’, ‘django.middleware.csrf.CsrfViewMiddleware’, ‘django.contrib.auth.middleware.AuthenticationMiddleware’, ‘django.contrib.messages.middleware.MessageMiddleware’, ‘django.middleware.clickjacking.XFrameOptionsMiddleware’, ] CORS_ORIGIN_ALLOW_ALL = True CORS_ALLOW_CREDENTIALS = False default_headers = ( […]

Categories
Mastering Development

Meteor Galaxy deploy error requesting archive Phantomjs

I am receiving the following error when deploying to Meteor Galaxy. v0096 2020-08-18 09:56:00+10:00> node npm-rebuild.jsv0096 2020-08-18 09:56:00+10:00v0096 2020-08-18 09:56:04+10:00v0096 2020-08-18 09:56:04+10:00> phantomjs@1.9.17 install /app/bundle/programs/server/npm/node_modules/meteor/rajit_bootstrap3-datepicker/lib/bootstrap-datepicker/node_modules/phantomjsv0096 2020-08-18 09:56:04+10:00> node install.jsv0096 2020-08-18 09:56:04+10:00v0096 2020-08-18 09:56:05+10:00PhantomJS detected, but wrong version 1.9.0 @ /usr/bin/phantomjs.v0096 2020-08-18 09:56:05+10:00Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2v0096 2020-08-18 09:56:05+10:00Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2v0096 2020-08-18 09:56:05+10:00Receiving…v0096 2020-08-18 09:56:07+10:00v0096 2020-08-18 09:56:07+10:00Error requesting archive.v0096 […]

Categories
Mastering Development

Post custom HANDLER URL reCAPTCHA

I am trying to implement reCAPTCHA validation via Marketing Cloud – cloud page. I have used this guide to do that: https://ampscript.xyz/how-tos/how-to-implement-google-recaptcha-on-marketing-cloud-forms/ What I want to do is to create a post request instead of use the action form property. My Clint side script: <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <meta name="description" content=""> <meta […]

Categories
Mastering Development System & Network

cors header wasn’t set in request although apache server was configured

can anyone point me why my request header wasn’t set with cors header although in apache httpd.conf was configured just to do that. Am I missing something here ?? Thanks in advance. <Directory "${SRVROOT}/htdocs"> Header set Access-Control-Allow-Origin "some url" Header set Access-Control-Allow-Headers "Accept, Accept-Charset, Accept-Encoding, Accept-Language, Connection, Content-Type, Cookie, DNT, Host, Keep-Alive, Origin, Referer, User-Agent, […]

Categories
Development

Firebase Cloud functions: Typescript does not compile to JavaScript

Cloud function on my computer works with Javascript, but when I try it using TypeScript it does not compile to Javascript. It does not event create lib/index.js When I run firebase deploy, it shows the error that Error: There was an error reading functions/package.json: firebase deploy –debug shows the following log: APPLEs-MacBook-Air:functions abbasi$ firebase deploy […]

Categories
Development

django & javascript fetch(): CORS policy: No ‘Access-Control-Allow-Origin’ header is present

I am trying to make an ajax call. I am using django 2.2.5 and cors 3.1.0, but getting the following error messages in the browser console: Access to fetch at ‘http://my.domain.com/‘ from origin ‘http://127.0.0.1:8000‘ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your […]

Categories
Development HTTP

Verify SSL Error with Golang http server? [duplicate]

This question already has an answer here: How to set up HTTPS on golang web server? 4 answers I have a golang project that provides some REST API endpoints over SSL. I serve things over https with this line of code: router := mux.NewRouter() // mux is from the gorilla mux library headersOk := handlers.AllowedHeaders([]string{“Accept”,”Accept-Encoding”,”Content-Length”,”Content-Type”, […]