use a HTTPS domain as redirect_uri with / included

2018-01-20 Thread Georg Schwienbacher
To link Strava accounts to an Amazon Alexa Skill it is required to redirect 
the authenification to a specific callback URL.
In my case I will be using the callback URL's provided by Amazon
f.e. *https://alexa.amazon.co.jp/api/skill/link/*

How can I enter this domain in the app configuration on 
https://www.strava.com/settings/api ?

As it doesn't allow me to add "/" escaping them with %2F only result in 
*redirect_uri 
: "invalid"*
Furthermore I haven't seen an option to choose between HTTP or HTTPS 
(if I leave it blank HTTP gets entered by default in the autorization URL)

Thank you very much.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a3e22206-6fd6-453c-b2a4-85f61332025e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-20 Thread drone4four
I’ve played with a little Django (v2.0.1) locally. Now I am trying to 
implement a test case on my production Apache web server. I’m running an 
Ubuntu 14.04 DigitalOcean droplet (will upgrade to 18.04 later this year).

I got Django running.

Here it is: http://www.angeles4four.info:8000/

Before I log into my admin panel, I figure it’s best practices to set up 
HTTPS first. But when I visit that URL, Chrome throws this message:


This site can’t provide a secure connection http://www.angeles4four.info 
> sent an invalid response. ERR_SSL_PROTOCOL_ERROR


And my shell on my server shows this message:

[20/Jan/2018 23:54:39] "GET / HTTP/1.1" 200 16559 [21/Jan/2018 00:01:23] 
> code 400, message Bad request syntax 
> ('\x16\x03\x01\x00Ì\x01\x00\x00È\x03\x03&6U\x10µ\x82\x97\x7f´8\x1e«\x0e¿ÿ§\x89æ\x82\r¢G§\x01ç°P%\x80)ÕÃ\x00\x00\x1c
>  
> * À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') [21/Jan/2018 
> 00:01:23] *You're accessing the development server over HTTPS, but it 
> only supports HTTP.*


That’s because SSL isn’t set up. My current SSL Certificate Authority is 
Let’s Encrypt. SSL is running properly for my public_html content but not 
for my recent deployment of Django.

I found some resources elsewhere on SO for setting up SSL with Django.

In an SO post titled, “Configure SSL Certificate on Apache for Django 
Application (mod_wsgi)”, a highly upvoted answer by Alexey Kuleshevich 
suggests a template for 000-default.conf and default-ssl.conf for Apache 
vhosts. See here: Configure SSL Certificate on Apache for Django 
Application (mod_wsgi) 


I did my best to change up the suggested values and entries so that they 
refer to my specific configuration. Here are what these two vhost 
configuration files of mine look like now.

/etc/apache2/sites-available/angeles4four.info-le-ssl.conf:

 

#ServerName http://www.example.com
ServerAdmin coffee.drinker.dan...@gmail.com
ServerName angeles4four.info
ServerAlias http://www.angeles4four.info
DocumentRoot /var/www/html/angeles4four.info/public_html


ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


# Django Application
Alias /static /var/www/html/angeles4four.info/public_html/Cel2FahConversion

Require all granted



Require all granted


WGIDaemonProcess cel 
python-path=/var/www/html/angeles4four.info/public_html/Cel2FahConversion/venv/bin/python3
WSGIProcessGroup cel
WSGIScriptAlias / 
/var/www/html/angeles4four.info/public_html/Cel2FahConversion/Cel2FahConversion/Cel2FahConversion/wsgi.py


SSLCertificateFile /etc/letsencrypt/live/angeles4four.info/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/angeles4four.info/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/angeles4four.info/chain.pem




angeles4four.info.conf:

Quote:



#ServerName http://www.example.com
ServerAdmin coffee.drinker.dan...@gmail.com
ServerName angeles4four.info
ServerAlias http://www.angeles4four.info
DocumentRoot /var/www/html/angeles4four.info/public_html

Options Indexes FollowSymlinks
AllowOverride All
Require all granted



ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


RewriteEngine on
RewriteCond %{SERVER_NAME} =angeles4four.info [OR]
RewriteCond %{SERVER_NAME} =www.angeles4four.info
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]


No dice. I still get the same traceback as I initially shared.

The next SO post I came across suggests modifying settings.py. Here it is: 
Error 
"You're accessing the development server over HTTPS, but it only supports 
HTTP" 


The upvoted suggestion here by YoYo is to modify session cookies and secure 
SSL redirect. YoYo also recommends managing base, local, production 
settings which doesn’t really apply to me. So I tried adding these three 
lines to my settings.py:


SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = True


My python3 manage.py runserver shell traceback still says: *“You're 
accessing the development server over HTTPS, but it only supports HTTP.”*

Any ideas? What else could I try?

Thanks for your attention.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c0592c57-9a5a-4693-b685-80933643eb49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up Django on Google Cloud (basic server)

2018-01-20 Thread Nick Sarbicki
Hi Samuel,

You probably haven't opened access to port 8000 to the public

Try run server on port 80.

Nick.

On Sat, 20 Jan 2018, 14:53 Samuel Muiruri,  wrote:

> I had this issue before with AWS i remember it was just as stressful then
> and actually can't remember what actually fixed it. I basically have a
> clean Ubuntu VM which I followed this guide
> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
> step by step on creating and hosting django on a site.
>
> Every step worked smoothly until this point when I need to run the command
> "python manage.py runserver 0.0.0.0:8000" which starts the service (shown
> on the attached screenshot) (also is the google cloud page showing the
> given external ip) according to this with the server waiting visiting
> http://35.227.49.155:8000/ should bring the site or something but it
> fails to connect i get "
> This site can’t be reached
> " message.
>
> For now I'm taking a break hoping I'll come up with something, also hope
> someone here who might have gone through the same or is a seasoned web dev
> might also help too.
>
> --
>
> Best Regards,
>
> Samuel Muiruri.
>
> Senior Developer @ Revorta.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJZFZXrw9O-x8aV6NynHN9iEiLd%3DMZU8OpHGUeEmHXUSH9wAkw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGuvt92VGZfGjfjKVgDK0b7H%2B%3DoX7ZmfPgFcC_WNVFRMvfuHog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and Oracle12C Connection Error

2018-01-20 Thread Stephen J. Butler
Your Django settings 'NAME' is neither a SID nor a service name. Try:

'NAME': 'testdb',
'USERNAME': 'C##TDBUSER',
'PASSWORD': 'testdb',
'HOST': 'localhost',
'PORT': 1521


On Fri, Jan 19, 2018 at 11:37 PM, Rishab Kumar  wrote:

> https://stackoverflow.com/questions/48352888/connect-django-with-oracle12c
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/51de7b27-425c-4b5b-bf0e-e650b2363e19%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD4ANxXx6ijSDEX_LgJU7CJxyH%2BJkDSGMmCkaXDjP-GSE6MXyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django and Oracle12C Connection Error

2018-01-20 Thread Rishab Kumar
https://stackoverflow.com/questions/48352888/connect-django-with-oracle12c

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/51de7b27-425c-4b5b-bf0e-e650b2363e19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.