Пример #1
0
Файл: utils.py Проект: hda1/smyt
def test():
    app_name = __name__.split('.')[0]
    print 'app_name = ', app_name, type(app_name)
    
    print 'rel = ', os.path.dirname(rel())
    
    path = os.path.join(os.path.dirname(rel()), 'manage.py').replace('Aptana Studio 3 Workspace', "'Aptana Studio 3 Workspace'")
    print 'path = ', path
    
    if app_name in commands.getoutput(path+ ' migrate --list'):
        print commands.getoutput(path+ ' migrate --list')
    else:
        print commands.getoutput(path+ ' syncdb')
        print commands.getoutput(path+ ' schemamigration ' + app_name + ' --initial')
        print commands.getoutput(path+ ' migrate --fake')
    def handle(self, *args, **options):
        force_update = options.get('force_update')
        verbosity = int(options.get('verbosity'))

        for item in args:
            print '=====', item, '====='
            try:
                f = open(rel(item))
                tree = objectify.parse(f)
                self.save(tree, force_update, verbosity)
                f.close()
            except UnicodeEncodeError, e:
                print type(e).__name__, ':', e
                print 'Text: ', e.args[1]
Пример #3
0
    def handle(self, *args, **options):
        force_update = options.get('force_update')
        verbosity = int(options.get('verbosity'))

        for item in args:
            print '=====', item, '====='
            try:
                f = open(rel(item))
                tree = objectify.parse(f)
                self.save(tree, force_update, verbosity)
                f.close()
            except UnicodeEncodeError, e:
                print type(e).__name__, ':', e
                print 'Text: ', e.args[1]
Пример #4
0
from django.conf.urls.defaults import *

from django.contrib import admin
from settings import rel
admin.autodiscover()

urlpatterns = patterns(
    '',
    (r'^', include('myproject.website.urls')),
    (r'^admin/', include(admin.site.urls)),
    (r'^media/(?P<path>.*)$', 'django.views.static.serve', {
        'document_root': rel('media')
    }),
)
Пример #5
0
	url(r'^panel/archive/delete/$', 'archive.views.delete_archive'),
	url(r'^panel/archive/edit/edit-archive/$', 'archive.views.update_archive'),
	url(r'^panel/archive/edit/delete-episode/$', 'archive.views.delete_episode_from_archive'),
	url(r'^panel/archive/edit/add-episode/$', 'archive.views.add_episode_to_archive'),
	url(r'^panel/archive/add/send/$', 'archive.views.create_archive'),
	
	url(r'^panel/schedule/add/send/$', 'schedule.views.create_program'),
	url(r'^panel/schedule/delete/$', 'schedule.views.delete_program'),
	url(r'^panel/schedule/edit/send/$', 'schedule.views.update_program'),
	url(r'^panel/schedule/local-add/send/$', 'schedule.views.create_localprogram'),
	url(r'^panel/schedule/local-edit/send/$', 'schedule.views.update_localprogram'),
	
	url(r'^panel/pages/add/send/$', 'staticpages.views.create_page'),
	url(r'^panel/pages/delete/$', 'staticpages.views.delete_page'),
	url(r'^panel/pages/edit/send/$', 'staticpages.views.update_page'),
	
	url(r'^panel/regions/add/send/$', 'geolocation.views.add_location'),
	url(r'^panel/regions/delete/$', 'geolocation.views.delete_location'),
	
	url(r'^styles/', include('styles.urls')),
	url(r'^scripts/', include('scripts.urls')),
    
	url(r'^static_files/(?P<path>.*)$',  'django.views.static.serve', {'document_root': rel('static/') }),
	url(r'^media_files/(?P<path>.*)$', 'django.views.static.serve', {'document_root': rel('media/') }),
    
    url(r'^geoip/', include('django_geoip.urls')),
    
	url(r'^django-admin/', include(admin.site.urls)),
	url(r'', include('pages.urls')),
)
Пример #6
0
from django.conf.urls.defaults import *

from django.contrib import admin
from settings import rel
admin.autodiscover()

urlpatterns = patterns('',
    (r'^', include('myproject.website.urls')),

    (r'^admin/', include(admin.site.urls)),
    
    (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': rel('media')}),
)
Пример #7
0
urlpatterns = patterns('',
    # Example:
    # (r'^sonya/', include('sonya.foo.urls')),

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

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),

    (r'^get-photo-list/(?P<photo_list_type>[\w\d]+)/(?P<id>\d+)/$', get_photo_list),
    (r'^login/$', 'django.contrib.auth.views.login'),
    (r'^logout/$', 'django.contrib.auth.views.logout', { 'next_page': '/' }),

    (r'^add-photos/$', add_photos),
    (r'^save-photo/(?P<photo_id>\d+)/$', save_photo),
    (r'^upload-photo/$', upload_photo),
    (r'^delete-photo/(?P<photo_id>\d+)/$', delete_photo),
    (r'^move-photo/(?P<photo_id>\d+)/(?P<to>(left|right))/$', move_photo),
    (r'^get-photo-form/(?P<photo_id>\d+)/$', get_photo_form),

    (r'^show/(?P<show_type>(years|galleries|reports))/$', show),
    (r'^report/(?P<report_id>\d+)/', show_report),
    (r'^$', index),

	(r'^static/(?P<path>.*)$', 'django.views.static.serve',
		{'document_root': settings.rel('static')}),
)
Пример #8
0
    (r'uploadify/', include('uploadify.urls')),
    (r'^test/$', direct_to_template, {'template':'test.html'}),

    # Modules
    (r'account/', include('account.urls')),
    #(r'console/', include('console.urls')), # deprecated!

    # Query returns JSON
    (r'json/', include('query_json.urls')),

    # For DEBUG Only
    (r'success/', direct_to_template, {'template':'debug/success.html'}),
    (r'fail/', direct_to_template, {'template':'debug/fail.html'}),
    
    # Static
    (r'static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': rel('static')}),
    
    # Public
    url(r'^$', views.index, name='index-url'),
    url(r'about/$', views.about,name='about-url'),
    url(r'plan/$', views.plan, {'city':''},name='plan-url'),
    url(r'plan/(.+)/$', views.plan),
    url(r'blog/$', views.blog, name='blog-url'),

    # Admin
    (r'^admin/', include(admin.site.urls)),
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Share
    (r'^share/$', share_views.upload_and_download, {'relative_path':''}),
    (r'^share/(.+)/$', share_views.upload_and_download),