Skip to content

Instantly share code, notes, and snippets.

@alisonamerico
Created September 8, 2017 04:27
Show Gist options
  • Save alisonamerico/8729347a402effdb38132b0c3759687d to your computer and use it in GitHub Desktop.
Save alisonamerico/8729347a402effdb38132b0c3759687d to your computer and use it in GitHub Desktop.
"""urlshortener URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
# if the URL pattern match /admin/ then open up admin panel
url(r'', include('shortenersite.urls',
namespace='shortenersite')),
# if anything rather then /admin/ then it will look for shortenersite/urls
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment