Created
September 8, 2017 04:27
-
-
Save alisonamerico/8729347a402effdb38132b0c3759687d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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