Django inserts wrong domain to activation email, facebook auth and filebrowserJavascript error when integrating django-tinymce and django-filebrowserIn django-social-auth, can't get the Facebook authentication link to show?Facebook login not working properly using django-social-authdjango-social-auth for Facebook is redirecting home and not logging inAuthFailed with django-social-auth & Facebook authenticationPassword required field on email auth and redundant activation mailpython social auth duplicate entryDjango Social Auth--I Can't Reset Password for User That Signed Up Via FacebookDjango Social Auth Pipeline— Checking for Duplicate EmailsError: Django-Social-Auth LinkedIn Client Error

What is the sum of the reciprocals of the squares of the hypotenuse of all Pythagorean triangles?

How did the T-850 still function after it removed its second battery?

Magento 2.3.3 Fails on magento setup:di:compile with an error mentioning InvoiceFlexFieldProcessorInterface

How do I build a kernel using patches from LKML?

How can I stop this useless empty line popping up in the middle of my lists?

How do Precipitation Reactions behave in the Absence of Gravity?

Hell0 W0rld! scored by ASCII values

Plot problems: vertical lines and letters

Travel with Expired Greek Passport from UK to Greece and Return

What is the difference between Anführer and Führer?

Could an eternal or near-eternal battery exist?

Is Dom based XSS still a valid security concern in modern browsers?

Is velocity a valid measure of team and process improvement?

How replayable is Pandemic Legacy? (Is the game still playable after you have completed it)

VM with Windows Server won't boot after restoring from ghettoVCB backup

Can the Mending cantrip affix any surface to any other surface?

How does AT-AT deploy troops?

Create a program that prints the amount of characters it has, in words

How is warfare affected when armor has (temporarily) outpaced guns? How can guns compete?

Transaction with highest fee, but stuck, what did I do wrong?

What to do with developers who don't follow requirements?

Uncountably many functions coinciding only finitely many values

Mysql - Average price for top 10% cheapest volume (algorithm help)

What game(s) does Michael play in Mind Field S2E4?



Django inserts wrong domain to activation email, facebook auth and filebrowser


Javascript error when integrating django-tinymce and django-filebrowserIn django-social-auth, can't get the Facebook authentication link to show?Facebook login not working properly using django-social-authdjango-social-auth for Facebook is redirecting home and not logging inAuthFailed with django-social-auth & Facebook authenticationPassword required field on email auth and redundant activation mailpython social auth duplicate entryDjango Social Auth--I Can't Reset Password for User That Signed Up Via FacebookDjango Social Auth Pipeline— Checking for Duplicate EmailsError: Django-Social-Auth LinkedIn Client Error






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0

















I've set up a Django project on a nginx server. But..



  1. Django detects request.get_host() in signup and activation views as localhost and sends email (for activation and password reset) with links like http://localhost/....


  2. I've set up Facebook authorization via social-auth-app-django. But Facebook tries to open redirect_uri in localhost
    (...redirect_uri=http:localhost/oauth/complete/facebook...)


  3. Inside django admin TinyMCE editor Filebrowser also refers to localhost..


How to fix these problems? Or it seems one solution can fix all of them.



Thank you for your time and help.










share|improve this question
































    0

















    I've set up a Django project on a nginx server. But..



    1. Django detects request.get_host() in signup and activation views as localhost and sends email (for activation and password reset) with links like http://localhost/....


    2. I've set up Facebook authorization via social-auth-app-django. But Facebook tries to open redirect_uri in localhost
      (...redirect_uri=http:localhost/oauth/complete/facebook...)


    3. Inside django admin TinyMCE editor Filebrowser also refers to localhost..


    How to fix these problems? Or it seems one solution can fix all of them.



    Thank you for your time and help.










    share|improve this question




























      0












      0








      0








      I've set up a Django project on a nginx server. But..



      1. Django detects request.get_host() in signup and activation views as localhost and sends email (for activation and password reset) with links like http://localhost/....


      2. I've set up Facebook authorization via social-auth-app-django. But Facebook tries to open redirect_uri in localhost
        (...redirect_uri=http:localhost/oauth/complete/facebook...)


      3. Inside django admin TinyMCE editor Filebrowser also refers to localhost..


      How to fix these problems? Or it seems one solution can fix all of them.



      Thank you for your time and help.










      share|improve this question















      I've set up a Django project on a nginx server. But..



      1. Django detects request.get_host() in signup and activation views as localhost and sends email (for activation and password reset) with links like http://localhost/....


      2. I've set up Facebook authorization via social-auth-app-django. But Facebook tries to open redirect_uri in localhost
        (...redirect_uri=http:localhost/oauth/complete/facebook...)


      3. Inside django admin TinyMCE editor Filebrowser also refers to localhost..


      How to fix these problems? Or it seems one solution can fix all of them.



      Thank you for your time and help.







      django facebook django-authentication






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 21:35









      Patric HornqvistPatric Hornqvist

      146 bronze badges




      146 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0


















          Did you tried changing your Site.domain and Site.name in admin panel or via shell? from django.contrib.sites.models import Site



          https://docs.djangoproject.com/en/2.1/ref/contrib/sites/



          It's used in many cases such as emails by default.






          share|improve this answer


























          • Changed example.com to my domain. But still not works. Facebook still tries to open redirect_uri in localhost. Both get_current_site(request) and request.get_host() inserts localhost in production.

            – Patric Hornqvist
            Mar 29 at 8:59











          • Add this to your django settings 'USE_X_FORWARDED_HOST = True' it replace it's internal address by external address, it's needed when your backend is called from nginx, which address is localhost.

            – slqq
            Mar 29 at 13:34











          • Thank you so much! it works (with setting proxy_set_header in nginx).

            – Patric Hornqvist
            Mar 29 at 15:09













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407197%2fdjango-inserts-wrong-domain-to-activation-email-facebook-auth-and-filebrowser%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown


























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0


















          Did you tried changing your Site.domain and Site.name in admin panel or via shell? from django.contrib.sites.models import Site



          https://docs.djangoproject.com/en/2.1/ref/contrib/sites/



          It's used in many cases such as emails by default.






          share|improve this answer


























          • Changed example.com to my domain. But still not works. Facebook still tries to open redirect_uri in localhost. Both get_current_site(request) and request.get_host() inserts localhost in production.

            – Patric Hornqvist
            Mar 29 at 8:59











          • Add this to your django settings 'USE_X_FORWARDED_HOST = True' it replace it's internal address by external address, it's needed when your backend is called from nginx, which address is localhost.

            – slqq
            Mar 29 at 13:34











          • Thank you so much! it works (with setting proxy_set_header in nginx).

            – Patric Hornqvist
            Mar 29 at 15:09
















          0


















          Did you tried changing your Site.domain and Site.name in admin panel or via shell? from django.contrib.sites.models import Site



          https://docs.djangoproject.com/en/2.1/ref/contrib/sites/



          It's used in many cases such as emails by default.






          share|improve this answer


























          • Changed example.com to my domain. But still not works. Facebook still tries to open redirect_uri in localhost. Both get_current_site(request) and request.get_host() inserts localhost in production.

            – Patric Hornqvist
            Mar 29 at 8:59











          • Add this to your django settings 'USE_X_FORWARDED_HOST = True' it replace it's internal address by external address, it's needed when your backend is called from nginx, which address is localhost.

            – slqq
            Mar 29 at 13:34











          • Thank you so much! it works (with setting proxy_set_header in nginx).

            – Patric Hornqvist
            Mar 29 at 15:09














          0














          0










          0









          Did you tried changing your Site.domain and Site.name in admin panel or via shell? from django.contrib.sites.models import Site



          https://docs.djangoproject.com/en/2.1/ref/contrib/sites/



          It's used in many cases such as emails by default.






          share|improve this answer














          Did you tried changing your Site.domain and Site.name in admin panel or via shell? from django.contrib.sites.models import Site



          https://docs.djangoproject.com/en/2.1/ref/contrib/sites/



          It's used in many cases such as emails by default.







          share|improve this answer













          share|improve this answer




          share|improve this answer










          answered Mar 28 at 21:48









          slqqslqq

          639 bronze badges




          639 bronze badges















          • Changed example.com to my domain. But still not works. Facebook still tries to open redirect_uri in localhost. Both get_current_site(request) and request.get_host() inserts localhost in production.

            – Patric Hornqvist
            Mar 29 at 8:59











          • Add this to your django settings 'USE_X_FORWARDED_HOST = True' it replace it's internal address by external address, it's needed when your backend is called from nginx, which address is localhost.

            – slqq
            Mar 29 at 13:34











          • Thank you so much! it works (with setting proxy_set_header in nginx).

            – Patric Hornqvist
            Mar 29 at 15:09


















          • Changed example.com to my domain. But still not works. Facebook still tries to open redirect_uri in localhost. Both get_current_site(request) and request.get_host() inserts localhost in production.

            – Patric Hornqvist
            Mar 29 at 8:59











          • Add this to your django settings 'USE_X_FORWARDED_HOST = True' it replace it's internal address by external address, it's needed when your backend is called from nginx, which address is localhost.

            – slqq
            Mar 29 at 13:34











          • Thank you so much! it works (with setting proxy_set_header in nginx).

            – Patric Hornqvist
            Mar 29 at 15:09

















          Changed example.com to my domain. But still not works. Facebook still tries to open redirect_uri in localhost. Both get_current_site(request) and request.get_host() inserts localhost in production.

          – Patric Hornqvist
          Mar 29 at 8:59





          Changed example.com to my domain. But still not works. Facebook still tries to open redirect_uri in localhost. Both get_current_site(request) and request.get_host() inserts localhost in production.

          – Patric Hornqvist
          Mar 29 at 8:59













          Add this to your django settings 'USE_X_FORWARDED_HOST = True' it replace it's internal address by external address, it's needed when your backend is called from nginx, which address is localhost.

          – slqq
          Mar 29 at 13:34





          Add this to your django settings 'USE_X_FORWARDED_HOST = True' it replace it's internal address by external address, it's needed when your backend is called from nginx, which address is localhost.

          – slqq
          Mar 29 at 13:34













          Thank you so much! it works (with setting proxy_set_header in nginx).

          – Patric Hornqvist
          Mar 29 at 15:09






          Thank you so much! it works (with setting proxy_set_header in nginx).

          – Patric Hornqvist
          Mar 29 at 15:09





















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407197%2fdjango-inserts-wrong-domain-to-activation-email-facebook-auth-and-filebrowser%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown









          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript