Renamed project to gergelypolonkaiweb

This commit is contained in:
2013-10-01 23:49:18 +02:00
parent 50cf51e60e
commit 6b073006d2
28 changed files with 12 additions and 9 deletions

View File

View File

@@ -0,0 +1,34 @@
from django.db.models import Count
from taggit.models import Tag
from math import floor
from operator import itemgetter
from django.conf import settings
import os
from random import choice
def randomheader(request):
header_file = choice(filter(lambda x: os.path.isfile(settings.HEADER_DIR + os.path.sep + x), os.listdir(settings.HEADER_DIR)))
return {'header': header_file}
def tagcloud(request):
tagcloudlist = Tag.objects.annotate(ct=Count('taggit_taggeditem_items')).order_by('-ct')
if (len(tagcloudlist) > 0):
tmax = tagcloudlist[0].ct
tmin = 1
if (tmax == tmin):
tmax += 1
tagcloud = []
for cloudelement in tagcloudlist:
tagcount = cloudelement.ct
if (tagcount >= tmin):
size = int(floor((5.0 * (tagcount - tmin)) / (tmax - tmin)))
tagcloud.append({'name': cloudelement.name, 'slug': cloudelement.slug, 'size': size})
tagcloud.sort(key=itemgetter('name'))
return {'tagcloud': tagcloud}

View File

@@ -0,0 +1,178 @@
import os, os.path
# Django settings for gergelypolonkaiweb project.
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'gergelypolonkai', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'gergelypolonkai',
'PASSWORD': 'the8dooM',
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
}
}
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'Europe/Budapest'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-gb'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
SITE_ROOT + os.path.sep + "static",
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'ol#oly77qotgh%47ylflf3wwtr^(b5@=nhd8&@9=!q@*r34w#l'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'gergelypolonkaiweb.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'gergelypolonkaiweb.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
SITE_ROOT + os.path.sep + "templates"
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'compressor',
'taggit',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'blog',
'basics',
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages",
'gergelypolonkaiweb.helper.tagcloud',
'gergelypolonkaiweb.helper.randomheader',
)
HEADER_DIR = SITE_ROOT + os.path.sep + "static" + os.path.sep + "images" + os.path.sep + "header"

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,244 @@
* {
font-family: sans-serif;
}
body {
background-color: #333333;
margin: 0;
}
#content-wrapper {
background-color: #ffffff;
width: 960px;
margin-left: auto;
margin-right: auto;
padding-top: 14px;
}
#header {
height: 120px;
background-color: #4d4d4d;
color: #ffffff;
position: absolute;
width: 960px;
height: 190px;
}
#header #picture {
background-color: white;
position: relative;
width: 170px;
height: 170px;
display: inline;
float: left;
top: 40px;
left: 20px;
}
#header #picture img {
margin: 10px;
}
#header h1 {
text-align: right;
margin: 40px 10px 0 0;
font-size: 41px;
font-weight: bold;
padding-top: 45px;
}
#header h1 a {
color: #ffffff;
text-decoration: none;
}
#header h2 {
text-align: right;
margin: 0 10px 0 0;
font-size: 12px;
font-weight: normal;
padding-top: 5px;
}
#contact-list {
position: absolute;
right: -22px;
width: 20px;
}
#contact-list a {
display: block;
}
#menu {
background-color: #f18137;
height: 39px;
margin-top: 15px;
}
#tagcloud-button {
float: left;
padding-top: 2px;
padding-left: 6px;
cursor: pointer;
}
#menu ul {
margin: 8px;
padding: 0;
list-style-type: none;
float: right;
}
#menu ul li {
float: right;
margin-top: 1px;
margin-bottom: 10px;
margin-left: 1em;
height: 30px;
}
#menu ul li.active {
background-image: url('../images/arrow-up.png');
background-repeat: no-repeat;
background-position: center bottom;
}
#menu ul li a {
color: white;
font-weight: bold;
text-decoration: none;
font-size: 12px;
}
#content {
clear: both;
padding: 8px;
}
#content-padding {
height: 200px;
}
#content h3 {
margin: .5em 0 .2em 0;
}
#content p {
margin: .6em 0;
text-indent: 1.5em;
text-align: justify;
font-size: 80%;
}
#content a {
color: black;
text-decoration: underline;
}
dt {
font-weight: normal;
text-decoration: underline;
}
dd p {
text-indent: 0 !important;
margin-top: .5em !important;
}
#page-disclaimer {
margin-top: 2em;
text-align: right;
font-size: 80%;
color: #7f7f7f;
}
#page-disclaimer a {
color: #7f7f7f;
text-decoration: underline;
}
#bottombar-wrapper {
display: block;
}
#bottombar-padding {
clear: both;
height: 35px;
}
#bottombar {
position: fixed;
background-color: #4d4d4d;
bottom: 0;
left: 0;
margin: 0;
z-index: 70000;
width: 100%;
padding: 1em;
text-align: center;
vertical-align: center;
color: #b3b3b3;
font-size: 10px;
border-top: 1px solid black;
}
#bottombar a {
color: #b3b3b3;
text-decoration: underline;
}
#more-posts {
margin-top: 1em;
text-align: right;
}
#tag-cloud {
position: absolute;
width: 600px;
padding: 8px;
border: 1px solid black;
background-color: #303030;
margin-left: 5px;
margin-top: 2px;
display: none;
}
#tag-cloud a {
color: #b3b3b3;
text-decoration: none;
padding: 8px;
}
#tag-cloud .size0 {
font-size: 80%;
}
#tag-cloud .size1 {
font-size: 90%;
}
#tag-cloud .size2 {
font-size: 100%;
}
#tag-cloud .size3 {
font-size: 110%;
}
#tag-cloud .size4 {
font-size: 130%;
}
#tag-cloud .size5 {
font-size: 150%;
}
.clear {
clear: both;
}
pre {
font-family: monospace;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

View File

@@ -0,0 +1,113 @@
{% load static from staticfiles %}
{% load compress %}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gergely Polonkai{% block title %}{% endblock %}</title>
<link rel="icon" type="image/x-icon" href="{% static "favicon.ico" %}" />
{% compress css %}
{% block css %}
<link rel="stylesheet" type="text/css" href="{% static "css/front.css" %}" media="screen" />
<link rel="stylesheet" type="text/css" href="{% static "css/blog.css" %}" media="screen" />
{% endblock %}
{% endcompress %}
<link rel="alternate" type="application/rss+xml" title="Gergely Polonkai's Blog - RSS Feed" href="{{ app.request.scheme }}://{{ app.request.host }}{% url 'blog:feed' %}" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<div id="content-wrapper">
<div id="header" style="background-image: url('{% static "images/header/"|add:header %}');">
<div id="picture">
<img src="{% static "images/profile.png" %}" alt="" />
</div>
<h1><a href="{% url 'home' %}">Gergely Polonkai</a></h1>
<h2>developer, systems engineer and administrator</h2>
<div id="contact-list">
<a href="mailto:gergely@polonkai.eu" target="_blank"><img src="{% static "images/email_16.png" %}" alt="E-mail" /></a>
<a href="http://www.linkedin.com/in/gergelypolonkai" target="_blank"><img src="{% static "images/linkedin_16.png" %}" alt="LinkedIn profile" /></a>
<a href="skype:w00dhun" target="_blank"><img src="{% static "images/skype_16.png" %}" alt="Skype" /></a>
<a href="http://facebook.com/Polesz" target="_blank"><img src="{% static "images/facebook_16.png" %}" alt="Facebook profile" /></a>
<a href="https://plus.google.com/u/1/105740970718293884702/about" target="_blank"><img src="{% static "images/google_plus_16.png" %}" alt="Google+ profile" /></a>
<a href="gtalk:chat?jid=gergely@polonkai.eu" target="_blank"><img src="{% static "images/googletalk_16.png" %}" alt="Google Talk" /></a>
<a href="http://twitter.com/W00d5t0ck" target="_blank"><img src="{% static "images/twitter_16.png" %}" alt="Twitter" /></a>
<a href="http://tumblr.w00d5t0ck.info" target="_blank"><img src="{% static "images/tumblr_16.png" %}" alt="Tumblr" /></a>
<a href="msnim:chat?contact=polesz@w00d5t0ck.info" target="_blank"><img src="{% static "images/windows_16.png" %}" alt="Windows Live" /></a>
<a href="http://w00d5t0ck.deviantart.com" target="_blank"><img src="{% static "images/deviantart_16.png" %}" alt="deviantArt" /></a>
<a href="{% url 'blog:feed' %}"><img src="{% static "images/rss_16.png" %}" alt="RSS Feed" /></a>
</div>
</div>
<div id="content-padding"></div>
<div id="menu">
<div id="tagcloud-button"><img alt="" src="{% static "images/tagcloud.png" %}" /></div>
<ul>
<li {% if currentMenu == 'resume' %} class="active"{% endif %}><a href="{% url 'basics:resume' %}">Resume</a></li>
<li {% if currentMenu == 'blog' %} class="active"{% endif %}><a href="{% url 'blog:index' %}">Blog</a></li>
<li {% if currentMenu == 'about' %} class="active"{% endif %}><a href="{% url 'basics:about' %}">About me</a></li>
</ul>
<br class="clear" />
</div>
{% if tagcloud|length > 0 %}
<div id="tag-cloud">
{% for cloudItem in tagcloud %}
<a href="{% url 'blog:taglist' cloudItem.slug %}" class="size{{ cloudItem.size }}">{{ cloudItem.name }}</a>{% if not loop.last %} | {% endif %}
{% endfor %}
</div>
{% endif %}
<div id="content">
{% block content %}{% endblock content %}
</div>
</div>
<div id="bottombar-wrapper">
<div id="bottombar-padding"></div>
<div id="bottombar"{% if app.environment == 'dev' %} style="bottom: 40px;"{% endif %}>
:: Copyright &copy; 2012, Gergely Polonkai :: <a href="{% url 'basics:disclaimer' %}">Disclaimer</a> ::
</div>
</div>
<a href="https://github.com/gergelypolonkai" id="github-ribbon" target="_blank"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png" alt="Fork me on GitHub"></a>
<iframe src="http://githubbadge.appspot.com/badge/gergelypolonkai?s=1&a=0" style="border: 0; height: 142px; width: 200px; overflow: hidden; display: none; position: absolute; top: 100px; left: 100px;" frameBorder="0" id="github-badge"></iframe>
<script type="text/javascript">
$(document).ready(function() {
$('.at-obfuscation').html('@');
$('#tagcloud-button').click(function() {
$('#tag-cloud').toggle('slow');
});
$('#github-ribbon').mouseover(function() {
$('#github-badge').fadeIn();
});
$('#github-ribbon').mouseout(function() {
$('#github-badge').fadeOut();
});
$(document).mousemove(function(e) {
$('#github-badge').css({
top: e.pageY + 5,
left: e.pageX + 5
});
});
});
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-43569023-1', 'polonkai.eu');
ga('send', 'pageview');
</script>
</body>
</html>

View File

@@ -0,0 +1,14 @@
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'blog.views.mainpage', name='home'),
url(r'^blog/', include('blog.urls', namespace='blog')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('basics.urls', namespace='basics')),
)

View File

@@ -0,0 +1,32 @@
"""
WSGI config for gergelypolonkaiweb project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "gergelypolonkaiweb.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gergelypolonkaiweb.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)