pytask/urls.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 28 Jan 2011 02:27:40 +0530
changeset 519 84709567f47a
parent 472 f9011a1dfe1c
permissions -rwxr-xr-x
Use the release version of South than the latest version. South is very critical for our application. So don't take any risk with the users data. Use the release version.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
396
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
     1
from django.conf import settings
307
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     2
from django.conf.urls.defaults import *
415
c631194cec2a Modify the home page URL mapper to be consistent with other mappers.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 397
diff changeset
     3
from django.contrib import admin
307
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     4
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     5
from registration.views import register
314
f920dd4599df Added the import to connect the signal
Nishanth Amuluru <nishanth@fossee.in>
parents: 307
diff changeset
     6
307
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     7
from pytask.profile.forms import CustomRegistrationForm
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
     8
472
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
     9
# This import is not used anywhere else, but is very important to register
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    10
# the user registered signal receiver. So please don't remove it. Although
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    11
# it against style to put any imports in the end of the file, this is
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    12
# intentional so that this import may not be removed accidentally when
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    13
# cleaning up other unused imports.
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    14
# Although this import is not directly used in this module, but it is
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    15
# imported here so that it executes the code which connects the
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    16
# user_registered signal sent by the django-registration app. Also, to
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    17
# avoid cyclic imports, there is no better place than here.
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    18
import pytask.profile.regbackend
f9011a1dfe1c Move the regbackend import to urls.py.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 415
diff changeset
    19
307
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    20
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    21
admin.autodiscover()
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    22
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    23
urlpatterns = patterns('',
415
c631194cec2a Modify the home page URL mapper to be consistent with other mappers.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 397
diff changeset
    24
    url(r'^$', 'pytask.views.home_page', name='home_page'),
307
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    25
    (r'^admin/', include(admin.site.urls)),
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    26
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    27
    url(r'^accounts/register/$', register,
397
68759310b1f3 Adjusted the styling of the urls.py file.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 396
diff changeset
    28
        {'form_class': CustomRegistrationForm,
307
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    29
         'backend': 'registration.backends.default.DefaultBackend'},
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    30
        name='registration_register'),
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    31
    (r'^accounts/', include('registration.urls')),
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    32
    (r'^profile/', include('pytask.profile.urls')),
340
0f9d485609ac fixed a few bugs
Nishanth Amuluru <nishanth@fossee.in>
parents: 334
diff changeset
    33
    (r'^task/', include('pytask.taskapp.urls')),
307
c6bca38c1cbf Added buildout stuff and made changes accordingly
Nishanth Amuluru <nishanth@fossee.in>
parents:
diff changeset
    34
)
396
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    35
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    36
# Serve static files in DEVELOPMENT = True mode
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    37
if settings.DEVELOPMENT:
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    38
    urlpatterns += patterns('',
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    39
        (r'^pytask/media/(?P<path>.*)$', 'django.views.static.serve',
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    40
         {'document_root': settings.MEDIA_ROOT}),
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    41
        (r'^pytask/static/(?P<path>.*)$', 'django.views.static.serve',
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    42
         {'document_root': settings.STATIC_ROOT}),
08893f05cc3d Add a DEVELOPMENT settings for URL mapping for static and media files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 363
diff changeset
    43
    )