First Thing You Should Do After Install Django, Create Main Page or Redirect It

  • Posted on: 7 April 2015
  • By: oon
First Thing You Should Do After Install Django, Create Main Page or Redirect It

This is something that I repeatly do after finish install Django, add main page (home page) or simply redirect it to another website.

here's simple example of urls.py inside your Django project folder.

from django.views.generic import RedirectView

urlpatterns = [
    url(r'^$', view=RedirectView.as_view(url='https://google.com')),
]

This is how you can avoid others to know your (still on debug mode) urls or URL mapping.

 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.