1

I'm attempting to integrate social signon into a project, and am following along this tutorial: http://www.artandlogic.com/blog/2014/04/tutorial-adding-facebooktwittergoogle-authentication-to-a-django-application/.

Step #4 shows that the project requires a 'real url'. It appears you used to be able to specify a url when running manage.py runserver example.com (https://code.djangoproject.com/ticket/14928)

However, on Django 1.6.5 this results in CommandError: "example.com" is not a valid port number or address:port pair.

What is the easiest way to run a local webserver so that my django project appears at whateverurl.com?

1 Answer 1

5

If you are using a unix-like OS, edit /etc/hosts and include:

127.0.0.1    example.com

If you are on windows, look for %WINDIR%\system32\drivers\etc\hosts.

Then you can use python manage.py runserver example.com:80

Note that external servers will not be able to call example.com, if the API you are testing requires the provider server to call this URL directly, you can only use this to test against a local provider.

Sign up to request clarification or add additional context in comments.

2 Comments

This worked. Though, port 80 results in: Error: You don't have permission to access that port. Port 8000 worked beautifully.
Glad to hear that it worked. Only root can bind to ports below 1024, I guess that is why you got the error. Also, if you are running a local webserver, it is already bound to TCP/80.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.