Skip to content

Instantly share code, notes, and snippets.

@0x46616c6b
Forked from enko/urls.py
Created January 13, 2011 21:56
Show Gist options
  • Save 0x46616c6b/778697 to your computer and use it in GitHub Desktop.
Save 0x46616c6b/778697 to your computer and use it in GitHub Desktop.
def new_entry(request):
format = "json"
if ('format' in request.POST):
format = request.POST['format']
if ('submit' in request.POST):
# gives us a json: { "text" : "Dies ist eine Meldung", "isPublic" : 1 }
# entry_text =
# entry_isPublic =
# entry_published = datetime.now()
# -> save
def new_pin(request):
format = "json"
if ('format' in request.POST):
format = request.POST['format']
if ('submit' in request.POST):
# { "pin" : "123456" }
# pin_value =
# coding=utf-8
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^Ticker/', include('Ticker.foo.urls')),
(r'^$', 'Ticker.frontend.views.index'),
(r'^(?P<pin>\d+)/$', 'Ticker.frontend.views.index'),
(r'^manage/$', 'Ticker.frontend.views.manage'),
# dont know if this works but I have someting like this wuold be cool:
(r'^manage/(?P<action>)/$', 'Ticker.frontend.views.manage', { "action" : action }),
(r'^accounts/login/$', 'Ticker.frontend.views.login'),
(r'^accounts/logout/$', 'Ticker.frontend.views.logout'),
# 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)),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment