Rewriting login to JS

This commit is contained in:
Pengwius 2021-01-06 00:41:20 +01:00
parent 3661ddef7a
commit 4d36b5864c
54 changed files with 377 additions and 239 deletions

View file

@ -1,2 +1,4 @@
# Wulkanowy-web
🌋 Przeglądarkowy klient dzienniczka VULCAN UONET+ dla ucznia i rodzica
[![Discord](https://img.shields.io/discord/390889354199040011.svg?style=flat-square)](https://discord.gg/vccAQBr)

View file

@ -2,13 +2,21 @@ import requests
import json
def get_attendance(register_id, register_r, oun, s, date):
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
else:
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
attendance_lessons = s.post(oun+'/FrekwencjaStatystykiPrzedmioty.mvc/Get', headers={"User-Agent": "Wulkanowy-web :)"}, cookies=cookies)
attendance_json_id = attendance_lessons.json()['data'][0]['Id']

View file

@ -2,13 +2,21 @@ import json
import requests
def get_exams(register_id, register_r, oun, s, date, school_year):
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
else:
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
exams = s.post(oun+'/Sprawdziany.mvc/Get', headers={"User-Agent": "Wulkanowy-web :)"}, cookies=cookies, json={'data': date, 'rokSzkolny': school_year})

View file

@ -2,13 +2,21 @@ import json
import requests
def get_grades(register_id, register_r, oun, s):
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
else:
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
grades = s.post(oun+'/Oceny.mvc/Get', headers={"User-Agent": "Wulkanowy-web :)"}, cookies=cookies, json={'okres': register_id})

View file

@ -3,13 +3,21 @@ import json
import datetime
def get_homework(register_id, register_r, oun, s, school_year):
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
else:
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
now = datetime.datetime.now()
weekday = now.weekday()

View file

@ -34,7 +34,6 @@ def get_messages(register_id, register_r, oun, s, date, school_year, symbol):
'Id': j['Id']
})
messages = s.get(f'https://uonetplus-uzytkownik.vulcan.net.pl/{symbol}/Wiadomosc.mvc/GetTrashboxMessages?_dc={now}&dataOd=&dataDo=&page=1&start=0&limit=25')
for j in messages.json()['data']:
deleted_messages.append({
@ -45,8 +44,6 @@ def get_messages(register_id, register_r, oun, s, date, school_year, symbol):
'Id': j['Id']
})
print(sent_messages)
return received_messages, sent_messages, deleted_messages
def get_recipients(j):

View file

@ -2,13 +2,21 @@ import json
import requests
def get_notes(register_id, register_r, oun, s):
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
else:
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
notes = s.post(oun+'/UwagiIOsiagniecia.mvc/Get', headers={"User-Agent": "Wulkanowy-web :)"}, cookies=cookies)

View file

@ -3,13 +3,21 @@ import requests
from bs4 import BeautifulSoup
def get_timetable(register_id, register_r, oun, s, date):
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
if oun != 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458':
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyDziennikWychowankowie": f"{register_r.json()['data'][0]['IdWychowankowieDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
else:
cookies = {
"biezacyRokSzkolny": f"{register_r.json()['data'][0]['DziennikRokSzkolny']}",
"idBiezacyDziennik": f"{register_r.json()['data'][0]['IdDziennik']}",
"idBiezacyDziennikPrzedszkole": f"{register_r.json()['data'][0]['IdPrzedszkoleDziennik']}",
"idBiezacyUczen": f"{register_r.json()['data'][0]['IdUczen']}"
}
timetable = s.post(oun+'/PlanZajec.mvc/Get', headers={"User-Agent": "Wulkanowy-web :)"}, cookies=cookies, json={'data': date})

2
app/forms.py Normal file
View file

@ -0,0 +1,2 @@
from django import forms

View file

@ -14,7 +14,7 @@ oun = ''
s = requests.Session()
symbol = ''
def sender(url, loginName, Password, params_names, fail_phrase, sym):
def sender(url, loginName, Password, params_names, fail_phrase, sym, diary_url):
global symbol
data = []
data.append((params_names[0], loginName, params_names[1], Password))
@ -22,38 +22,49 @@ def sender(url, loginName, Password, params_names, fail_phrase, sym):
for index, single_data in enumerate(data):
index += 1
if send(url, single_data, fail_phrase):
if send(url, single_data, fail_phrase, diary_url):
return True
else:
return False
def send(url, data, fail):
def send(url, data, fail, diary_url):
ready_data = {data[0]: data[1], data[2]: data[3]}
r = s.post(url=url, data=ready_data)
if fail in r.text:
page = s.post(url=url, data=ready_data)
print(page.text)
if fail in page.text:
return False
else:
global symbol
page = r
if diary_url == 'http://cufs.fakelog.cf/':
page = s.get('http://cufs.fakelog.cf/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx')
bs = BeautifulSoup(page.text, 'html.parser')
wa = bs.find('input', {'name': 'wa'})['value']
cert = bs.find('input', {'name': 'wresult'})['value']
wctx = bs.find('input', {'name': 'wctx'})['value']
cert_url = 'https://uonetplus.vulcan.net.pl/'+symbol+'/LoginEndpoint.aspx'
crtr = s.post(url=cert_url, headers={"User-Agent": "Wulkanowy-web :)"}, data={"wa": wa, "wresult": cert, "wctx": wctx})
print(wa)
print('------------------------------------------------------------')
print(cert)
print('------------------------------------------------------------')
print(wctx)
print('------------------------------------------------------------')
crtr = s.post(url=wctx, headers={"User-Agent": "Wulkanowy-web :)"}, data={"wa": wa, "wresult": cert, "wctx": wctx})
bs = BeautifulSoup(crtr.content, 'html.parser')
global oun
for a in bs.find_all('a', title='Uczeń'):
global oun
oun = a['href']
break
#GetMesseges(register_id, register_r, oun, s, date)
if diary_url == 'http://cufs.fakelog.cf/':
oun = 'http://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123458'
return True
def get_cookies():
global symbol
global oun
register_r = s.post(oun+'/UczenDziennik.mvc/Get')
register_id = register_r.json()['data'][0]['Okresy'][0]['Id']

View file

@ -1,7 +1,7 @@
from django import template
from django.utils.safestring import mark_safe
from Wulkanowy.login import get_cookies
from Wulkanowy.API.homework import prepare_homework_for_display
from app.login import get_cookies
from app.API.homework import prepare_homework_for_display
register = template.Library()

View file

@ -1,8 +1,8 @@
from requests import get
from django.http import HttpResponse
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
import json
from .login import sender, get_cookies
from .forms import loginForm
from django.shortcuts import redirect
from django.contrib.sessions.models import Session
from .API.grades import prepare_grades_for_display
@ -13,40 +13,8 @@ from .API.attendance import prepare_attendance_for_display
from .API.messages import get_messages
def default_view(request, *args, **kwargs):
sender_return = None
new_form = loginForm()
if request.method == "POST":
new_form = loginForm(request.POST)
if new_form.is_valid():
symbol = new_form.cleaned_data['Symbol']
link = 'https://cufs.vulcan.net.pl/'+symbol+'/Account/LogOn?ReturnUrl=%2F'+symbol+'%2FFS%2FLS%3Fwa%3Dwsignin1.0%26wtrealm%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f'+symbol+'%252fLoginEndpoint.aspx%26wctx%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f'+symbol+'%252fLoginEndpoint.aspx'
sender_return = sender(link, new_form.cleaned_data['loginName'], new_form.cleaned_data['Password'], ('loginName', 'Password'), 'Zła nazwa użytkownika lub hasło', symbol)
context = {'form' : new_form}
if sender_return == False:
return redirect('/error/')
elif sender_return == True:
request.session['is_logged'] = True
return redirect('/oceny/')
else:
return render(request, 'index.html', context)
return render(request, 'index.html')
def error_view(request, *args, **kwargs):
sender_return = None
new_form = loginForm()
if request.method == "POST":
new_form = loginForm(request.POST)
if new_form.is_valid():
symbol = new_form.cleaned_data['Symbol']
link = 'https://cufs.vulcan.net.pl/'+symbol+'/Account/LogOn?ReturnUrl=%2F'+symbol+'%2FFS%2FLS%3Fwa%3Dwsignin1.0%26wtrealm%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f'+symbol+'%252fLoginEndpoint.aspx%26wctx%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f'+symbol+'%252fLoginEndpoint.aspx'
sender_return = sender(link, new_form.cleaned_data['loginName'], new_form.cleaned_data['Password'], ('loginName', 'Password'), 'Zła nazwa użytkownika lub hasło', symbol)
context = {'form' : new_form, 'error' : 'Niepoprawny e-mail lub hasło'}
if sender_return == False:
return redirect('/error/')
elif sender_return == True:
request.session['is_logged'] = True
return redirect('/oceny/')
else:
return render(request, 'form_error.html', context)
def grades_view(request, *args, **kwargs):
if request.session.has_key('is_logged'):
@ -163,4 +131,29 @@ def change_messages_content(request, *args, **kwargs):
content = {'messages': messages[2]}
return render(request, 'messages_content.html', content)
else:
return redirect(default_view)
return redirect(default_view)
#API
def login(request, *args, **kwargs):
sender_return = None
data = json.loads(request.body)
loginName = data['loginName']
Password = data['Password']
symbol = data['Symbol']
diary_url = data['diaryUrl']
if diary_url != 'http://cufs.fakelog.cf/':
link = f'{diary_url}{symbol}/Account/LogOn?ReturnUrl=%2F{symbol}%2FFS%2FLS%3Fwa%3Dwsignin1.0%26wtrealm%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f{symbol}%252fLoginEndpoint.aspx%26wctx%3Dhttps%253a%252f%252fuonetplus.vulcan.net.pl%252f{symbol}%252fLoginEndpoint.aspx'
else:
link = 'http://cufs.fakelog.cf/powiatwulkanowy/FS/LS?wa=wsignin1.0&wtrealm=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx&wctx=http://uonetplus.fakelog.localhost:300/powiatwulkanowy/LoginEndpoint.aspx'
sender_return = sender(link, loginName, Password, ('loginName', 'Password'), 'Zła nazwa użytkownika lub hasło', symbol, diary_url)
print(sender_return)
if sender_return == False:
data = {
'success': False
}
elif sender_return == True:
request.session['is_logged'] = True
data = {
'success': True
}
return JsonResponse(data)

View file

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 896 B

After

Width:  |  Height:  |  Size: 896 B

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 203 KiB

After

Width:  |  Height:  |  Size: 203 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

59
files/js/login.js Normal file
View file

@ -0,0 +1,59 @@
const button = document.querySelector('#button');
const login = () => {
const loginName = document.querySelector('#id_loginName').value;
const Password = document.querySelector('#id_Password').value;
const symbol = document.querySelector('#id_Symbol').value;
const diary = document.querySelector('#id_diary').value;
if(loginName != '' && Password != '' && symbol != ''){
switch(diary){
case 'Fakelog':
var diaryUrl = 'http://cufs.fakelog.cf/';
break;
case 'Vulcan UONET+':
var diaryUrl = 'https://cufs.vulcan.net.pl/';
break;
}
data = {
'loginName': loginName,
'Password': Password,
'Symbol': symbol,
'diaryUrl': diaryUrl
}
fetch(url = 'api/login', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrfcookie()
},
body: JSON.stringify(data)
}).then(response => response.json()).then(data => {
if(data['success']){
window.location.href = "/oceny/"
}
else{
document.querySelector('#error').innerHTML = 'Nieprawidłowy login, hasło lub symbol'
}
});
}
};
var csrfcookie = function() {
var cookieValue = null,
name = 'csrftoken';
if (document.cookie && document.cookie !== '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i].trim();
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
};
button.addEventListener('click', login);

View file

@ -1,8 +1,8 @@
body {
padding: 0 !important;
height: 100vh;
background: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.3)),to(rgba(0,0,0,.3))),url(../img/wallpaper.b24bba72.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(img/wallpaper.jpg);
background: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.3)),to(rgba(0,0,0,.3))),url(../images/wallpaper.b24bba72.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(images/wallpaper.jpg);
background-size: cover;
background-position: 50%;
background-attachment: fixed;

View file

@ -17,8 +17,8 @@
}
body {
height: 100vh;
background: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.3)),to(rgba(0,0,0,.3))),url(../img/wallpaper.b24bba72.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(img/wallpaper.jpg);
background: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.3)),to(rgba(0,0,0,.3))),url(../images/wallpaper.b24bba72.jpg);
background: linear-gradient(rgba(0,0,0,.3),rgba(0,0,0,.3)),url(images/wallpaper.jpg);
background-size: cover;
background-position: 50%;
background-attachment: fixed;
@ -96,7 +96,7 @@ img{
border:0;
background: none;
display: block;
margin: 20px auto;
margin: 10px auto;
text-align: center;
border: 2px solid #565656;
padding: 14px 18px;
@ -110,7 +110,7 @@ img{
width: 90%;
border-color: #2ecc71;
}
.box input[type = "submit"]{
.box button{
border:0;
background: none;
display: block;
@ -124,9 +124,23 @@ img{
transition: 0.25s;
cursor: pointer;
}
.box input[type = "submit"]:hover{
.box button:hover{
background: #2ecc71;
}
.box select{
border:0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #565656;
padding: 14px 18px;
width: 75%;
outline: none;
color: black;
border-radius: 24px;
transition: 0.25s;
}
.icon {
width: 50px;
margin: 0px;
@ -178,4 +192,8 @@ label{
#imgsym{
margin-top: 1%;
max-width: 100vh;
}
#error{
color: red;
font-size: 130%;
}

View file

@ -6,7 +6,7 @@ import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mypage.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wulkanowy.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:

View file

@ -1,6 +0,0 @@
from django import forms
class loginForm(forms.Form):
loginName = forms.CharField()
Password = forms.CharField(widget=forms.PasswordInput)
Symbol = forms.CharField()

View file

@ -1,6 +0,0 @@
function plchol()
{
document.getElementById("id_loginName").placeholder = "E-mail";
document.getElementById("id_Password").placeholder = "Password";
document.getElementById("id_Symbol").placeholder = "Symbol";
}

View file

@ -1,47 +0,0 @@
{% load static %}
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="{% static 'main.js' %}"></script>
<link rel="stylesheet" href="{% static 'error.css' %}" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<link rel="stylesheet" media="min-width: 768px" href="{% static 'error.css' %}" />
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
</head>
<body onload="plchol()">
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="form">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
</h1>
<form action='' method="POST" class="box">{% csrf_token %}
<h1>Zaloguj się na konto rodzica lub ucznia</h1>
{{ form.as_p }}
<div id="con"></div>
<h2>{{ error }}</h2>
<a href="/pomoc/">Gdzie mogę znaleźć symbol?</a>
<input id="button" type="submit" value="Login">
</div>
<div id="icons">
<a href="mailto:wulkanowyinc@gmail.com" style="text-decoration: none;">
<img src="{% static 'img/email.ce588d18.svg' %}" class="icon" style="width: 55px;" alt="E-mail">
</a>
<a href="https://discord.com/invite/vccAQBr" style="text-decoration: none;">
<img src="{% static 'img/discord.e9241a54.svg' %}" class="icon" alt="Discord">
</a>
<a href="https://github.com/wulkanowy/" style="text-decoration: none;">
<img src="{% static 'img/github.9c30fa5a.svg' %}" class="icon" style="width: 55px;" alt="Github">
</a>
<a href="https://www.paypal.com/paypalme/wulkanowy" style="text-decoration: none;">
<img src="{% static 'img/paypal.9fd1b9bc.svg' %}" class="icon" alt="Paypal">
</a>
</div>
</div>
</div>
</body>
</html>

View file

@ -1,47 +0,0 @@
{% load static %}
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="{% static 'main.js' %}"></script>
<link rel="stylesheet" href="{% static 'style.css' %}" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" media="min-width: 768px" href="{% static 'style.css' %}" />
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
</head>
<body onload="plchol()">
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="form">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
</h1>
<form action='' method="POST" class="box">{% csrf_token %}
<h1 style="font-family: Roboto,sans-serif;">Zaloguj się na konto rodzica lub ucznia</h1>
{{ form.as_p }}
<div id="con"></div>
<a href="https://wulkanowy.github.io/czesto-zadawane-pytania/co-to-jest-symbol" style="font-family: Roboto,sans-serif;">Gdzie mogę znaleźć symbol?</a>
<input id="button" type="submit" value="Login">
</div>
<div id="icons">
<a href="mailto:wulkanowyinc@gmail.com" style="text-decoration: none;">
<img src="{% static 'img/email.ce588d18.svg' %}" class="icon" style="width: 55px;" alt="E-mail">
</a>
<a href="https://discord.com/invite/vccAQBr" style="text-decoration: none;">
<img src="{% static 'img/discord.e9241a54.svg' %}" class="icon" alt="Discord">
</a>
<a href="https://github.com/wulkanowy/" style="text-decoration: none;">
<img src="{% static 'img/github.9c30fa5a.svg' %}" class="icon" style="width: 55px;" alt="Github">
</a>
<a href="https://www.paypal.com/paypalme/wulkanowy" style="text-decoration: none;">
<img src="{% static 'img/paypal.9fd1b9bc.svg' %}" class="icon" alt="Paypal">
</a>
</div>
</div>
</div>
</body>
</html>

5
requirements.txt Normal file
View file

@ -0,0 +1,5 @@
beautifulsoup4==4.9.3
bs4==0.0.1
Django==3.1.3
python-dotenv==0.15.0
requests==2.24.0

View file

@ -8,10 +8,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{% static 'start.css' %}" type="text/css" />
<link rel="stylesheet" media="min-width: 768px" href="{% static 'start.css' %}" />
<script src="{% static 'start.js' %}"></script>
<script src="{% static 'js/start.js' %}"></script>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&family=Quicksand:wght@300&display=swap" rel="stylesheet">
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
</head>
@ -19,7 +19,7 @@
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="menu">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<a href="/uwagi/"><div id="uwagi" class="option">Uwagi</div></a>
<a href="/wiadomosci/"><div id="wiadomosci" class="option">Wiadomości</div></a>
<a href="/frekwencja/"><div id="frekwencja" class="option">Frekwencja</div></a>

59
templates/index.html Normal file
View file

@ -0,0 +1,59 @@
{% load static %}
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="{% static 'js/login.js' %}" defer></script>
<link rel="stylesheet" href="{% static 'style.css' %}" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" media="min-width: 768px" href="{% static 'style.css' %}" />
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
</head>
<body>
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="form">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
</h1>
<form action="javascript:void(0);" class="box" id="form">{% csrf_token %}
<h1 style="font-family: Roboto,sans-serif;">Zaloguj się na konto rodzica lub ucznia</h1>
<input type="text" name="loginName" required="" id="id_loginName" placeholder="E-mail">
<input type="password" name="Password" required="" id="id_Password" placeholder="Password">
<input type="text" name="Symbol" required="" id="id_Symbol" placeholder="Symbol">
<select id="id_diary">
<option>Vulcan UONET+</option>
<option>Fakelog</option>
</select>
<div id='error'></div>
<a href="https://wulkanowy.github.io/czesto-zadawane-pytania/co-to-jest-symbol" style="font-family: Roboto,sans-serif;">Gdzie mogę znaleźć symbol?</a>
<button id="button">LOGIN</button>
</form>
</div>
<div id="icons">
<a href="mailto:wulkanowyinc@gmail.com" style="text-decoration: none;">
<img src="{% static 'images/email.ce588d18.svg' %}" class="icon" style="width: 55px;" alt="E-mail">
</a>
<a href="https://discord.com/invite/vccAQBr" style="text-decoration: none;">
<img src="{% static 'images/discord.e9241a54.svg' %}" class="icon" alt="Discord">
</a>
<a href="https://github.com/wulkanowy/" style="text-decoration: none;">
<img src="{% static 'images/github.9c30fa5a.svg' %}" class="icon" style="width: 55px;" alt="Github">
</a>
<a href="https://www.paypal.com/paypalme/wulkanowy" style="text-decoration: none;">
<img src="{% static 'images/paypal.9fd1b9bc.svg' %}" class="icon" alt="Paypal">
</a>
<a href="https://www.paypal.com/paypalme/wulkanowy" style="text-decoration: none;">
<img data-v-cec09316="" class='icon' src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANkAAADaCAYAAAArKufYAAAACXBIWXMAABcRAAAXEQHKJvM/AAAL8ElEQVR4nO3d/VEjRxrH8d6r/R9dBCtHgBwB2ghWGwHaCIwjOIjgcARGEZyIwCiCQxEYZbCKgKtZP1Mnq2dG06/TL99PFYVrFjAS+unp7umXD+/v7wpAOP/guQXCImRAYIQMCIyQAYF95AmexEwptTj53Fie/CI3lr/UUSn1Kv/9/eS/X84+IyJGF8NqQ9QEaC4ftgHypQ3i+QcCIWR+tYFqP3/K6HffSehe5POb9hWwQsjczCVMK/l8lfODOXNQSm0ldC/S/IQFQmauqVJrCdV1br+8g2cJ25YqZ4aQjdMGa5VZEzCUvVLqicCNQ8j6zSVUdwRr0LOE7Wnoi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eQKXnCFzQfi3aUVkv01cw+5RwyddJ8ZPSxPDt5E83+qOTcQ9baynAuVS1/bfWaZKuAEEoJmTqravTV8lRM9TpVUshaW/lDsVlPPg7y5lhM9TpVYsjUyUHxP3GOdfIe5E0x6alRLkoNWetN3h0/04RMzkbeBL0egp6i0kPWepGBkW+EbXI7edNbl9g07FJLyFpPhG0ybbiWsQ56SEVtIWsRtnieaw1Xq9aQtdqwfWWAxLu2z7WqNVyt2kPWapfS/CwvDmaP2DnIjeR/1tTnuuTD+/v7hS+p0kzegZtNWa49PgG7RI6P8v1H38gbVbHD8C4I2WVzCVsTuk+OP6ukkO2kub0tfQjeFSEzs5BmkG3gcg/Zs/SvtjQFxyNk9uYStiY0X0b+lNxCdjgJ1QsVyw4h82d58tFUvKuOn5x6yNpQvZ58hqOU913MzcvZUPXi7OMmscdzkCZfG6ZXmoBhUMmAwLhPBgRGyIDACBkQGCEDAiNkQEhKqf8B3HeeO11S2y8AAAAASUVORK5CYII=" alt="Facebook">
</a>
</div>
</div>
</div>
</body>
</html>

View file

@ -8,8 +8,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{% static 'start.css' %}" type="text/css" />
<link rel="stylesheet" media="min-width: 768px" href="{% static 'start.css' %}" />
<script src="{% static 'start.js' %}"></script>
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<script src="{% static 'js/start.js' %}"></script>
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&family=Quicksand:wght@300&display=swap" rel="stylesheet">
@ -19,7 +19,7 @@
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="menu">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<a href="/uwagi/"><div id="uwagi" class="option">Uwagi</div></a>
<a href="/wiadomosci/"><div id="wiadomosci" class="option">Wiadomości</div></a>
<a href="/frekwencja/"><div id="frekwencja" class="option">Frekwencja</div></a>

View file

@ -7,9 +7,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{% static 'start.css' %}" type="text/css" />
<link rel="stylesheet" media="min-width: 768px" href="{% static 'start.css' %}" />
<script src="{% static 'start.js' %}"></script>
<script src="{% static 'js/start.js' %}"></script>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&family=Quicksand:wght@300&display=swap" rel="stylesheet">
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
@ -18,7 +18,7 @@
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="menu">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<a href="/uwagi/"><div id="uwagi" class="option">Uwagi</div></a>
<a href="/wiadomosci/"><div id="wiadomosci" class="option">Wiadomości</div></a>
<a href="/frekwencja/"><div id="frekwencja" class="option">Frekwencja</div></a>

View file

@ -8,9 +8,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{% static 'start.css' %}" type="text/css" />
<link rel="stylesheet" media="min-width: 768px" href="{% static 'start.css' %}" />
<script src="{% static 'start.js' %}"></script>
<script src="{% static 'js/start.js' %}"></script>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&family=Quicksand:wght@300&display=swap" rel="stylesheet">
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
@ -19,7 +19,7 @@
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="menu">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<a href="/uwagi/"><div id="uwagi" class="option">Uwagi</div></a>
<a href="/wiadomosci/"><div id="wiadomosci" class="option">Wiadomości</div></a>
<a href="/frekwencja/"><div id="frekwencja" class="option">Frekwencja</div></a>

View file

@ -8,9 +8,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{% static 'start.css' %}" type="text/css" />
<link rel="stylesheet" media="min-width: 768px" href="{% static 'start.css' %}" />
<script src="{% static 'start.js' %}"></script>
<script src="{% static 'js/start.js' %}"></script>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&family=Quicksand:wght@300&display=swap" rel="stylesheet">
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
@ -19,7 +19,7 @@
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="menu">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<a href="/uwagi/"><div id="uwagi" class="option">Uwagi</div></a>
<a href="/wiadomosci/"><div id="wiadomosci" class="option">Wiadomości</div></a>
<a href="/frekwencja/"><div id="frekwencja" class="option">Frekwencja</div></a>

View file

@ -8,9 +8,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{% static 'start.css' %}" type="text/css" />
<link rel="stylesheet" media="min-width: 768px" href="{% static 'start.css' %}" />
<script src="{% static 'start.js' %}"></script>
<script src="{% static 'js/start.js' %}"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&family=Quicksand:wght@300&display=swap" rel="stylesheet">
@ -20,7 +20,7 @@
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="menu">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<a href="/uwagi/"><div id="uwagi" class="option">Uwagi</div></a>
<a href="/wiadomosci/"><div id="wiadomosci" class="option">Wiadomości</div></a>
<a href="/frekwencja/"><div id="frekwencja" class="option">Frekwencja</div></a>

View file

@ -8,9 +8,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{% static 'start.css' %}" type="text/css" />
<link rel="stylesheet" media="min-width: 768px" href="{% static 'start.css' %}" />
<script src="{% static 'start.js' %}"></script>
<script src="{% static 'js/start.js' %}"></script>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link rel="shortcut icon" href="{% static 'img/27146352.png' %}">
<link rel="shortcut icon" href="{% static 'images/27146352.png' %}">
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&family=Quicksand:wght@300&display=swap" rel="stylesheet">
<title>Wulkanowy | Aplikacja ucznia i rodzica</title>
@ -19,7 +19,7 @@
<div data-v-cd2b8d62 data-v-09be56d6 id="container">
<div id="menu">
<h1 data-v-cd2b8d62="" class="logo">
<img data-v-cd2b8d62 src="{% static 'img/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<img data-v-cd2b8d62 src="{% static 'images/wulkanowy-full-flat.4ff8222a.svg' %}" alt="Wulkanowy">
<a href="/uwagi/"><div id="uwagi" class="option">Uwagi</div></a>
<a href="/wiadomosci/"><div id="wiadomosci" class="option">Wiadomości</div></a>
<a href="/frekwencja/"><div id="frekwencja" class="option">Frekwencja</div></a>

47
tests/test_urls.py Normal file
View file

@ -0,0 +1,47 @@
from django.test import SimpleTestCase
from django.urls import reverse, resolve
from app.views import default_view, grades_view, timetable_view, exams_view, homework_view, attendance_view, messages_view, notes_view, change_messages_content
from app.views import login
class TestUrls(SimpleTestCase):
#views
def test_home_is_resolved(self):
url = reverse('home')
self.assertEquals(resolve(url).func, default_view)
def test_grades_is_resolved(self):
url = reverse('grades')
self.assertEquals(resolve(url).func, grades_view)
def test_timetable_is_resolved(self):
url = reverse('timetable')
self.assertEquals(resolve(url).func, timetable_view)
def test_exams_is_resolved(self):
url = reverse('exams')
self.assertEquals(resolve(url).func, exams_view)
def test_homework_is_resolved(self):
url = reverse('homework')
self.assertEquals(resolve(url).func, homework_view)
def test_attendance_is_resolved(self):
url = reverse('attendance')
self.assertEquals(resolve(url).func, attendance_view)
def test_messages_is_resolved(self):
url = reverse('messages')
self.assertEquals(resolve(url).func, messages_view)
def test_notes_is_resolved(self):
url = reverse('notes')
self.assertEquals(resolve(url).func, notes_view)
def test_cmc_is_resolved(self):
url = reverse('cmc')
self.assertEquals(resolve(url).func, change_messages_content)
#API
def test_login_is_resolved(self):
url = reverse('login')
self.assertEquals(resolve(url).func, login)

0
wulkanowy/__init__.py Normal file
View file

View file

@ -1,5 +1,5 @@
"""
ASGI config for mypage project.
ASGI config for wulkanowy project.
It exposes the ASGI callable as a module-level variable named ``application``.
@ -11,6 +11,6 @@ import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mypage.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wulkanowy.settings')
application = get_asgi_application()

View file

@ -45,7 +45,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
# My Apps
'Wulkanowy',
'app',
]
MIDDLEWARE = [
@ -61,7 +61,7 @@ MIDDLEWARE = [
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
SESSION_COOKIE_AGE = 1200
ROOT_URLCONF = 'mypage.urls'
ROOT_URLCONF = 'wulkanowy.urls'
TEMPLATES = [
{
@ -79,7 +79,7 @@ TEMPLATES = [
},
]
WSGI_APPLICATION = 'mypage.wsgi.application'
WSGI_APPLICATION = 'wulkanowy.wsgi.application'
# Database

View file

@ -16,19 +16,22 @@ Including another URLconf
from django.urls import path
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from Wulkanowy.views import default_view, error_view, grades_view, timetable_view, exams_view, homework_view, attendance_view, messages_view, notes_view, change_messages_content
from app.views import default_view, grades_view, timetable_view, exams_view, homework_view, attendance_view, messages_view, notes_view, change_messages_content
from app.views import login
urlpatterns = [
#views
path('', default_view, name='home'),
path('error/', error_view, name='error'),
path('oceny/', grades_view, name='grades'),
path('plan/', timetable_view, name='timetable'),
path('sprawdziany/', exams_view, name='exams'),
path('zadania/', homework_view, name='homework'),
path('frekwencja/', attendance_view, name='attendance'),
path('wiadomosci/', messages_view, name='messeges'),
path('wiadomosci/', messages_view, name='messages'),
path('uwagi/', notes_view, name='notes'),
path('change_messages_content/', change_messages_content)
path('change_messages_content/', change_messages_content, name='cmc'),
#api
path('api/login', login, name='login')
]
urlpatterns += staticfiles_urlpatterns()

View file

@ -1,5 +1,5 @@
"""
WSGI config for mypage project.
WSGI config for wulkanowy project.
It exposes the WSGI callable as a module-level variable named ``application``.
@ -11,6 +11,6 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mypage.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wulkanowy.settings')
application = get_wsgi_application()