Skip to content

Commit

Permalink
Integrate activity into django
Browse files Browse the repository at this point in the history
Use templates for static content, including
new basic front page.

Also remove unnecessary auth processor.

Related to coala#27
  • Loading branch information
jayvdb committed Dec 10, 2017
1 parent 66b7505 commit 6a835c9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ after_success:
- python activity/scraper.py
- python manage.py collectstatic --noinput
- python manage.py distill-local public --force
- mkdir public/activity
- cp activity/index.html public/activity/
- ./.ci/deploy.sh
5 changes: 3 additions & 2 deletions community/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
Expand Down
20 changes: 17 additions & 3 deletions community/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from django_distill import distill_url
from django.conf.urls.static import static
from django.conf import settings
from gci.views import index
from django.views.generic import TemplateView

from gci.views import index as gci_index


def get_index():
Expand All @@ -16,9 +18,21 @@ def get_index():

urlpatterns = [
distill_url(
r'^$', index,
name='community-gci',
r'^$', TemplateView.as_view(template_name='index.html'),
name='index',
distill_func=get_index,
distill_file='index.html',
),
distill_url(
r'activity/', TemplateView.as_view(template_name='activity.html'),
name='activity',
distill_func=get_index,
distill_file='activity/index.html',
),
distill_url(
r'gci/', gci_index,
name='community-gci',
distill_func=get_index,
distill_file='gci/index.html',
),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
File renamed without changes.
7 changes: 7 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<title>Community website</title>
<body>
<ul>
<li><a href="/gci/">Google Code-in</a>
<li><a href="/activity/">GitHub activity</a>
</ul>
</body>

0 comments on commit 6a835c9

Please sign in to comment.