Ejemplo n.º 1
0
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. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.sitemaps.views import sitemap
from django.contrib.staticfiles.urls import staticfiles_urlpatterns, static
from rollyourown.seo.admin import register_seo_admin
from main.seopy import MyMetadata
from main import views

register_seo_admin(admin.site, MyMetadata)

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^main/', include("main.urls")),
    url(r'^$', views.index, name="name"),
    url(r'^blog', include("pinax.blog.urls", namespace="pinax_blog")),
    #url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'),
]

urlpatterns += staticfiles_urlpatterns()
#urlpatterns  += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Ejemplo n.º 2
0
# -*- coding:utf-8 -*-

from django.conf.urls.defaults import *
from django.contrib import admin

from rollyourown.seo.admin import register_seo_admin
from .seo import CarShopMetadata

import settings

from .views import *

admin.autodiscover()
register_seo_admin(admin.site, CarShopMetadata)

urlpatterns = patterns(
    '',
    # Example:
    # (r'^carshop/', include('carshop.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^medias/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_PATH}),
    (r'^admin/', include(admin.site.urls)),
    (r'^search$', search),

    (r'^customer/', include('carshop.customer.urls')),
    (r'^product/', include('carshop.product.urls')),
    (r'^cart/', include('carshop.cart.urls')),
Ejemplo n.º 3
0
# -*- coding: UTF-8 -*-
from django.contrib import admin

from rollyourown.seo.admin import register_seo_admin, get_inline, auto_register_inlines
from userapp.seo import Coverage, WithSites, WithSEOModels
from userapp.models import Product, Page, Category, Tag, NoPath


class WithMetadataAdmin(admin.ModelAdmin):
    inlines = [get_inline(Coverage), get_inline(WithSites)]


register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)

try:
    admin.site.register(Product, admin.ModelAdmin)
except admin.sites.AlreadyRegistered:
    pass
try:
    admin.site.register(Page, admin.ModelAdmin)
except admin.sites.AlreadyRegistered:
    pass
try:
    admin.site.register(Tag, WithMetadataAdmin)
except admin.sites.AlreadyRegistered:
    pass
try:
    admin.site.register(NoPath, WithMetadataAdmin)
except admin.sites.AlreadyRegistered:
    pass
Ejemplo n.º 4
0
import os.path
from rollyourown.seo.admin import register_seo_admin
from django.conf.urls import patterns, include, url

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from condition.seo.seo import SEOMetadata
register_seo_admin(admin.site, SEOMetadata)
admin.autodiscover()

urlpatterns = patterns('',
    #('^$', search),
    (r'^ckeditor/', include('ckeditor.urls')),
    (r'^static/(?P<path>.*)$', 'django.views.static.serve',
    {'document_root': os.path.join(os.path.dirname(__file__), 'static')}),
    (r'^media/(?P<path>.*)$', 'django.views.static.serve',
    {'document_root': os.path.join(os.path.dirname(__file__), 'media')}),
    (r'^images/(?P<path>.*)$', 'django.views.static.serve', 
    {'document_root': os.path.join(os.path.dirname(__file__), 'images')}),
    (r'^uploads/(?P<path>.*)$', 'django.views.static.serve',
    {'document_root': os.path.join(os.path.dirname(__file__), 'uploads')}),
    # Examples:
    #url(r'^$', 'condition.views.index', name='index'),
    url(r'', include('condition.catalog.urls')),
    url(r'', include('condition.thermal.urls')),
    url(r'', include('condition.purifier.urls')),
    url(r'', include('condition.ventilation.urls')),
    url(r'', include('condition.services.urls')),
    url(r'', include('condition.prepared.urls')),
    url(r'', include('condition.news.urls')),
    # Uncomment the admin/doc line below to enable admin documentation:
Ejemplo n.º 5
0
from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin

from rollyourown.seo.admin import register_seo_admin
from django.contrib import admin
from market.seo import SiteMetadata

register_seo_admin(admin.site, SiteMetadata)

admin.autodiscover()

urlpatterns = patterns(
    '',
    (r'^', include('market.urls')),
    (r'^buy/', include('market_buy.urls')),
    (r'^sell/', include('market_sell.urls')),
    (r'^community/', include('market_community.urls')),
    (r'^admin/reports/', include('reports.urls')),
    (r'^admin/support/', include('support.urls')),
    url(r'^admin/', include(admin.site.urls), name="admin"),
    url(r'^logout/$', 'auth.views.logout', name='logout'),
    url(r'^map/([\d]+)/$', 'bidding.views.bidding_map', name='bidding_map'),
    url(r'^sitemap_index.xml$',
        'market.views.sitemap_index',
        name='market_sitemap'),
    url(r'^sitemap_products.xml$',
        'market.views.sitemap_products',
        name='market_sitemap_products'),
    url(r'^sitemap(?P<sitemap_id>\w*)\.xml$',
        'market.views.sitemap',
Ejemplo n.º 6
0
from django.core.urlresolvers import reverse

from django.contrib import admin
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage

from testtinymce.testapp.models import TestPage
from tinymce.widgets import TinyMCE
from comics.models import Comic, CustomFlatPage
from comics.seo import MyMetadata

from django.contrib.sites.models import Site


from rollyourown.seo.admin import register_seo_admin, get_inline
register_seo_admin(admin.site, MyMetadata)

class ComicAdmin(admin.ModelAdmin):
#    inlines = [ get_inline(MyMetadata) ]
    prepopulated_fields = {"slug": ("title",)}

admin.site.register(Comic, ComicAdmin)

class TinyMCEFlatPageAdmin(FlatPageAdmin):
    inlines = [ get_inline(MyMetadata) ]
    def formfield_for_manytomany(self, db_field, request=None, **kwargs):
        if db_field.name == "sites": 
            kwargs["initial"] = [Site.objects.get_current()]
        return super(TinyMCEFlatPageAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)

    def formfield_for_dbfield(self, db_field, **kwargs):
Ejemplo n.º 7
0
Archivo: urls.py Proyecto: zvadim/vox
from django.conf.urls import patterns, url
from rollyourown.seo.admin import register_seo_admin
from django.contrib import admin
from .seo import VoxMetadata

register_seo_admin(admin.site, VoxMetadata)

urlpatterns = patterns('apps.site.views',
    url(r'^$', 'main', name='main'),
    url(r'^get/(?P<type>[a-z]+)/(?P<slug>.*)/$', 'generic_page', name='site_page'),
)
Ejemplo n.º 8
0
import re

from django.conf import settings
from django.conf.urls import include, patterns, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin

from framebuzz.apps.api.seo import FbzMetadata
# DjangoSEO
from rollyourown.seo.admin import register_seo_admin

admin.autodiscover()

register_seo_admin(admin.site, FbzMetadata)


handler503 = 'maintenancemode.views.defaults.temporary_unavailable'
handler500 = "framebuzz.apps.marketing.views.server_error"
handler404 = "framebuzz.apps.marketing.views.server_404"


urlpatterns = patterns(
    '',
    # Admin:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^grappelli/', include('grappelli.urls')),
    url(r'^admin/', include(admin.site.urls)),

    # Player API:
    url(r'^v/', include('framebuzz.apps.api.urls')),
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

from rollyourown.seo.admin import register_seo_admin, get_inline
from django.contrib import admin
from userapp.seo import Coverage, WithSites, WithSEOModels

register_seo_admin(admin.site, Coverage)
register_seo_admin(admin.site, WithSites)

from userapp.models import Product, Page, Category, Tag, NoPath


class WithMetadataAdmin(admin.ModelAdmin):
    inlines = [get_inline(Coverage), get_inline(WithSites)]


admin.site.register(Product, admin.ModelAdmin)
admin.site.register(Page, admin.ModelAdmin)
admin.site.register(Tag, WithMetadataAdmin)
admin.site.register(NoPath, WithMetadataAdmin)

# Register alternative site here to avoid double import
alternative_site = admin.AdminSite()
from rollyourown.seo.admin import auto_register_inlines
#from userapp.models import Tag, Page, Product
#from userapp.seo import Coverage, WithSites, WithSEOModels
alternative_site.register(Tag)
auto_register_inlines(alternative_site, Coverage)
alternative_site.register(Page)
auto_register_inlines(alternative_site, WithSites)
Ejemplo n.º 10
0
from articles import views
from orders import views as orders

from django.conf.urls.static import static
from django.contrib import admin
import grappelli
from filebrowser.sites import site
from orders.views import save_order
# from django.views.generic.simple import direct_to_template
from django.conf.urls import patterns, include, url
from django.views.generic.base import TemplateView
from rollyourown.seo.admin import register_seo_admin
from django.contrib import admin
from articles.seo import EuroCardMetadata

register_seo_admin(admin.site, EuroCardMetadata)
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', views.home, name='home'),
    url(r'^prod/$', views.prod, name='prod'),
    #url(r'^clients/$', views.clients, name='clients'),
    #url(r'^article/(?P<slug>[\S\-]+?)/$', views.newsitem, name='newsitem'),

    url(r'^news/(?P<slug>[\S\-]+?)/$', views.newsitem, name='newsitem'),
    url(r'^news/$', views.news, name='news'),
    #url(r'^cards/', views.cards, name='cards'),
    url(r'^cards/(?P<slug>[\S\-]+?)/$', views.card, name='card'),
    url(r'^cards/$', views.cards, name='cards'),

    url(r'^price/$', views.price, name='price'),