-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.py
228 lines (183 loc) · 7.83 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2007 TÜBİTAK UEKAE
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt.
from django.conf.urls.defaults import *
from oi.settings import WEB_URL, DOCUMENT_ROOT, PACKAGE_PER_PAGE, GAME_PER_PAGE, FS_PER_PAGE, NEWS_PER_PAGE, TAG_PER_PAGE, HOWTO_PER_PAGE, WORKSHOP_PER_PAGE
from oi.st.models import Package, Game, FS, News, HowTo, Workshop
from oi.st.tags import Tag
from oi.seminar.models import Seminar
from oi.st.feeds import *
from django.contrib import admin
from oi.st.sitemaps import NewsSitemap, HowToSitemap, PackageSitemap, GameSitemap, FSSitemap, WorkshopSitemap
admin.autodiscover()
rss_dict = {
'': Main_RSS,
'haber': News_RSS,
'ia': FS_RSS,
'oyun': Game_RSS,
'paket': Package_RSS,
'nasil': HowTo_RSS,
'atolye': Workshop_RSS,
}
atom_dict = {
'': Main_Atom,
'haber': News_Atom,
'ia': FS_Atom,
'oyun': Game_Atom,
'paket': Package_Atom,
'nasil': HowTo_Atom,
'atolye': Workshop_Atom,
}
package_dict = {
'queryset': Package.objects.filter(status=True).order_by('title'),
'template_name': 'package/package_main.html',
'paginate_by': PACKAGE_PER_PAGE,
'template_object_name': 'package',
}
game_dict = {
'queryset': Game.objects.filter(status=True).order_by('title'),
'template_name': 'game/game_main.html',
'paginate_by': GAME_PER_PAGE,
'template_object_name': 'game',
}
fs_dict = {
'queryset': FS.objects.filter(status=True).order_by('order'),
'template_name': 'fs/fs_main.html',
'paginate_by': FS_PER_PAGE,
'template_object_name': 'fs',
}
howto_dict = {
'queryset': HowTo.objects.filter(status=True).order_by('title'),
'template_name': 'howto/howto_main.html',
'paginate_by': HOWTO_PER_PAGE,
'template_object_name': 'howto',
'extra_context': {
'firststep': FS.objects.filter(status=True).order_by('order')[:10],
},
}
workshop_dict = {
'queryset': Workshop.objects.filter(status=True).order_by('title'),
'template_name': 'workshop/workshop_main.html',
'paginate_by': WORKSHOP_PER_PAGE,
'template_object_name': 'workshop',
}
news_dict = {
'queryset': News.objects.filter(status=True).order_by('-update'),
'template_name': 'news/news_main.html',
'paginate_by': NEWS_PER_PAGE,
'template_object_name': 'news',
'extra_context': {
'seminar': Seminar.objects.filter(status=True).order_by('start_date'),
}
}
tag_dict = {
'queryset': Tag.objects.all().order_by('name'),
'template_name': 'tag/tag_main.html',
'paginate_by': TAG_PER_PAGE,
'template_object_name': 'tag'
}
sitemaps = {
'news': NewsSitemap,
'howto': HowToSitemap,
'game': GameSitemap,
'package': PackageSitemap,
'firststep': FSSitemap,
'workshop': WorkshopSitemap,
}
urlpatterns = patterns('',
(r'^robots.txt$', 'oi.st.views.robots'),
(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
#News
(r'^haber/$', 'django.views.generic.list_detail.object_list', dict(news_dict)),
(r'^haber/(?P<slug>.*)/yazdir/$', 'oi.st.views.news_printable'),
(r'^haber/(?P<slug>.*)/$', 'oi.st.views.news_detail'),
#Packages
(r'^paket/$', 'django.views.generic.list_detail.object_list', dict(package_dict)),
(r'^paket/(?P<slug>.*)/yazdir/$', 'oi.st.views.pkg_printable'),
(r'^paket/(?P<slug>.*)/$', 'oi.st.views.pkg_detail'),
#User management
(r'^kullanici/', include('oi.profile.urls')),
(r'^accounts/login/$', 'django.views.generic.simple.redirect_to', {'url': "/kullanici/giris/"}),
(r'^accounts/profile/$', 'django.views.generic.simple.redirect_to', {'url': "/kullanici/duzenle/"}),
#First Steps
(r'^ia/$', 'django.views.generic.list_detail.object_list', dict(fs_dict)),
(r'^ia/(?P<slug>.*)/yazdir/$', 'oi.st.views.fs_printable'),
(r'^ia/(?P<slug>.*)/$', 'oi.st.views.fs_detail'),
#How to
(r'^nasil/$', 'django.views.generic.list_detail.object_list', dict(howto_dict)),
(r'^nasil/(?P<slug>.*)/yazdir/$', 'oi.st.views.howto_printable'),
(r'^nasil/(?P<slug>.*)/$', 'oi.st.views.howto_detail'),
#Workshop
(r'^atolye/$', 'django.views.generic.list_detail.object_list', dict(workshop_dict)),
(r'^atolye/(?P<slug>.*)/yazdir/$', 'oi.st.views.workshop_printable'),
(r'^atolye/(?P<slug>.*)/$', 'oi.st.views.workshop_detail'),
#Games
(r'^oyun/$', 'django.views.generic.list_detail.object_list', dict(game_dict)),
(r'^oyun/(?P<slug>.*)/yazdir/$', 'oi.st.views.game_printable'),
(r'^oyun/(?P<slug>.*)/$', 'oi.st.views.game_detail'),
#Tags
(r'^etiket/$', 'django.views.generic.list_detail.object_list', dict(tag_dict)),
(r'^etiket/(?P<tag>.*)/$', 'oi.st.views.tag_detail'),
#Search
(r'^gelismisarama/$', 'oi.st.views.advanced_search'),
#Download
(r'^indir/$', 'oi.st.views.download'),
(r'^indir/(?P<version>.*)/surum_notu/$', 'oi.st.views.download_detail_releasenotes'),
#Video
(r'^video/(?P<video>.*)/$', 'oi.st.views.videobox'),
#Seminar
(r'^seminer/', include('oi.seminar.urls')),
#Forum
(r'^forum/', include('oi.forum.urls')),
#Bug tracker
(r'^hata/', include('oi.bug.urls')),
#Planet
(r'^gezegen/', include('oi.feedjack.urls')),
#Editor
(r'^editor/', include('oi.editor.urls')),
#Tema
(r'^tema/', include('oi.tema.urls')),
#Yeni Fikirler
#(r'^yenifikir/', include('oi.ideas.urls')),
# Shop
(r'^dukkan/', include('oi.shop.urls')),
#Petition
(r'^petition/', include('oi.petition.urls')),
(r'^ooxml/', 'oi.petition.views.petition_sign'),
# Paste
(r'^yapistir/', include('oi.paste.urls')),
# Ezine
(r'^e-dergi/', include('oi.ezine.urls')),
#Shipit
#(r'^dvdgonder/', include('oi.shipit.urls')),
#(r'^cdgonder/', 'oi.shipit.views.redirect_to_new_url'),
#Piyango
(r'^piyango/', include('oi.piyango.urls')),
#Podcast
(r'^podcast/', include('oi.podcast.urls')),
#Webalizer
url(r'^admin/webalizer/', include('webalizer.urls')),
#Beyin2
#(r'^beyin2/',include('oi.beyin2.urls')),
#Django
(r'^$', 'oi.st.views.home'),
(r'^admin/upload_progress/$', 'oi.upload.views.upload_progress'),
(r'^admin/upload/image/tinymce/$', 'oi.upload.views.image_upload'),
(r'^admin/', include(admin.site.urls)),
(r'^admin/filebrowser/', include('filebrowser.urls')),
(r'^media/(.*)$', 'django.views.static.serve', {'document_root': '%s/media' % DOCUMENT_ROOT, 'show_indexes': True}),
#Feeds
(r'^rss/gezegen/$', 'oi.feedjack.views.rssfeed'),
(r'^rss/gezegen/kullanici/(?P<user>\d+)/etiket/(?P<tag>.*)/$', 'oi.feedjack.views.rssfeed'),
(r'^rss/gezegen/kullanici/(?P<user>\d+)/$', 'oi.feedjack.views.rssfeed'),
(r'^rss/gezegen/etiket/(?P<tag>.*)/$', 'oi.feedjack.views.rssfeed'),
(r'^atom/gezegen/$', 'oi.feedjack.views.atomfeed'),
(r'^atom/gezegen/kullanici/(?P<user>\d+)/etiket/(?P<tag>.*)/$', 'oi.feedjack.views.atomfeed'),
(r'^atom/gezegen/kullanici/(?P<user>\d+)/$', 'oi.feedjack.views.atomfeed'),
(r'^atom/gezegen/etiket/(?P<tag>.*)/$', 'oi.feedjack.views.atomfeed'),
(r'^rss/(?P<url>.*)$', 'django.contrib.syndication.views.feed', {'feed_dict': rss_dict}),
(r'^atom/(?P<url>.*)$', 'django.contrib.syndication.views.feed', {'feed_dict': atom_dict}),
)