<commit_before>from django.shortcuts import render
from django.views.generic import View
import oeplatform.securitysettings as sec
from django.core.mail import send_mail
from base.forms import ContactForm
import markdown2
import os
import re
# Create your views here.

class Welcome(View):
   
    def get(self, request):
        version_expr = r'^(?P<major>\d+)\.(?P<minor>\d+)+\.(?P<patch>\d+)$'
        markdowner = markdown2.Markdown()
        with open('VERSION') as version_file:
            match = re.match(version_expr, version_file.read())
            major, minor, patch = match.groups()
        with open('versions/changelogs/%s_%s_%s.md'%(major, minor, patch)) as change_file:
            changes = markdowner.convert(
                '\n'.join(line for line in change_file.readlines()))
        return render(request,<commit_msg>Calculate relative path for production<commit_after>from django.shortcuts import render
from django.views.generic import View
import oeplatform.securitysettings as sec
from django.core.mail import send_mail
from base.forms import ContactForm
import markdown2
import os
import re
# Create your views here.

SITE_ROOT = os.path.dirname(os.path.realpath(__file__))

class Welcome(View):
   
    def get(self, request):
        os.path.dirname(os.path.realpath(__file__))
        version_expr = r'^(?P<major>\d+)\.(?P<minor>\d+)+\.(?P<patch>\d+)$'
        markdowner = markdown2.Markdown()
        with open(os.path.join(SITE_ROOT,'..', 'VERSION')) as version_file:
            match = re.match(version_expr, version_file.read())
            major, minor, patch = match.groups()
        with open(os.path.join(SITE_ROOT, '..',
                               'versions/changelogs/%s_%s_%s.md'%(major, minor, patch))) as change_file:
            changes = markdowner.convert(
                '\n'.join(line for line in change_file.readlines()))
        return render(request,
{'fraction_non_alphanumeric': 0.12813807531380753, 'fraction_numerical': 0.0020920502092050207, 'mean_word_length': 3.1406926406926408, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '859637', 'n_tokens_mistral': 585, 'n_tokens_neox': 572, 'n_words': 138}