Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
adega
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odair M.
adega
Commits
a5fecaaf
Commit
a5fecaaf
authored
Mar 24, 2018
by
Jomaro Rodrigues
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teste configuração
parent
8d228342
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
120 additions
and
9 deletions
+120
-9
Pipfile
Pipfile
+2
-0
Pipfile.lock
Pipfile.lock
+37
-1
postgres/config_db.sql
postgres/config_db.sql
+8
-0
src/adega/models.py
src/adega/models.py
+21
-0
src/adega/settings.py
src/adega/settings.py
+21
-2
src/adega/templates/base.html
src/adega/templates/base.html
+1
-1
src/adega/wsgi.py
src/adega/wsgi.py
+1
-1
src/uploads/models.py
src/uploads/models.py
+29
-4
No files found.
Pipfile
View file @
a5fecaaf
...
...
@@ -20,3 +20,5 @@ pandas = "==0.22"
xlrd
=
"*"
django-extensions
=
"*"
ujson
=
"*"
eventlet
=
"*"
gunicorn
=
"*"
Pipfile.lock
View file @
a5fecaaf
{
"_meta"
:
{
"hash"
:
{
"sha256"
:
"
36924d8179f463a93a6998ff08f3840a6e3125ae52f0dbf7a2a82a3563d8e337
"
"sha256"
:
"
2b51b796db79b08a70f4bd79d2c02e9da78e85ff73af01b3a00fa06a7ae901d6
"
},
"host-environment-markers"
:
{
"implementation_name"
:
"cpython"
,
...
...
@@ -48,6 +48,42 @@
],
"version"
:
"==1.4.1"
},
"eventlet"
:
{
"hashes"
:
[
"sha256:87b2afb22fb7601f77e9cb9481e3e8c557e8cac9df69b5b2dc0b38ec5c23d67a"
,
"sha256:46b7e565aaa06b5d1ba435cb355e09cf3002e34dc269671c93c960f9879d30e0"
],
"version"
:
"==0.22.1"
},
"greenlet"
:
{
"hashes"
:
[
"sha256:50643fd6d54fd919f9a0a577c5f7b71f5d21f0959ab48767bd4bb73ae0839500"
,
"sha256:c7b04a6dc74087b1598de8d713198de4718fa30ec6cbb84959b26426c198e041"
,
"sha256:b6ef0cabaf5a6ecb5ac122e689d25ba12433a90c7b067b12e5f28bdb7fb78254"
,
"sha256:fcfadaf4bf68a27e5dc2f42cbb2f4b4ceea9f05d1d0b8f7787e640bed2801634"
,
"sha256:b417bb7ff680d43e7bd7a13e2e08956fa6acb11fd432f74c97b7664f8bdb6ec1"
,
"sha256:769b740aeebd584cd59232be84fdcaf6270b8adc356596cdea5b2152c82caaac"
,
"sha256:c2de19c88bdb0366c976cc125dca1002ec1b346989d59524178adfd395e62421"
,
"sha256:5b49b3049697aeae17ef7bf21267e69972d9e04917658b4e788986ea5cc518e8"
,
"sha256:09ef2636ea35782364c830f07127d6c7a70542b178268714a9a9ba16318e7e8b"
,
"sha256:f8f2a0ae8de0b49c7b5b2daca4f150fdd9c1173e854df2cce3b04123244f9f45"
,
"sha256:1b7df09c6598f5cfb40f843ade14ed1eb40596e75cd79b6fa2efc750ba01bb01"
,
"sha256:75c413551a436b462d5929255b6dc9c0c3c2b25cbeaee5271a56c7fda8ca49c0"
,
"sha256:58798b5d30054bb4f6cf0f712f08e6092df23a718b69000786634a265e8911a9"
,
"sha256:42118bf608e0288e35304b449a2d87e2ba77d1e373e8aa221ccdea073de026fa"
,
"sha256:ad2383d39f13534f3ca5c48fe1fc0975676846dc39c2cece78c0f1f9891418e0"
,
"sha256:1fff21a2da5f9e03ddc5bd99131a6b8edf3d7f9d6bc29ba21784323d17806ed7"
,
"sha256:0fef83d43bf87a5196c91e73cb9772f945a4caaff91242766c5916d1dd1381e4"
],
"version"
:
"==0.4.13"
},
"gunicorn"
:
{
"hashes"
:
[
"sha256:75af03c99389535f218cc596c7de74df4763803f7b63eb09d77e92b3956b36c6"
,
"sha256:eee1169f0ca667be05db3351a0960765620dad53f53434262ff8901b68a1b622"
],
"version"
:
"==19.7.1"
},
"numpy"
:
{
"hashes"
:
[
"sha256:719d914f564f35cce4dc103808f8297c807c9f0297ac183ed81ae8b5650e698e"
,
...
...
postgres/config_db.sql
0 → 100644
View file @
a5fecaaf
CREATE
DATABASE
adega
;
CREATE
USER
adega
WITH
PASSWORD
'adega'
;
ALTER
ROLE
myprojectuser
SET
client_encoding
TO
'utf8'
;
ALTER
ROLE
myprojectuser
SET
default_transaction_isolation
TO
'read committed'
;
ALTER
ROLE
myprojectuser
SET
timezone
TO
'UTC-3'
;
GRANT
ALL
PRIVILEGES
ON
DATABASE
adega
TO
adega
;
src/adega/models.py
0 → 100644
View file @
a5fecaaf
from
django.db
import
models
from
django.contrib.auth.models
import
User
from
django.core.exceptions
import
ValidationError
class
Course
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
40
)
code
=
models
.
CharField
(
max_length
=
40
)
manager
=
models
.
ForeignKey
(
User
)
def
clean_code
(
self
):
if
'/'
in
self
.
code
:
raise
ValidationError
(
'Valor inválido: O código não pode conter "/"'
)
class
Professor
(
models
.
Model
):
user
=
models
.
OneToOneField
(
User
)
src/adega/settings.py
View file @
a5fecaaf
...
...
@@ -62,7 +62,7 @@ ROOT_URLCONF = 'adega.urls'
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[],
#[os.path.join(BASE_DIR, 'uploads/templates'),],
'DIRS'
:
[],
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'context_processors'
:
[
...
...
@@ -89,6 +89,18 @@ DATABASES = {
}
}
if
not
DEBUG
:
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.postgresql_psycopg2'
,
'NAME'
:
'adega'
,
'USER'
:
'adega'
,
'PASSWORD'
:
'adega'
,
'HOST'
:
'localhost'
,
'PORT'
:
''
,
}
}
AUTHENTICATION_BACKENDS
=
[
'public.auth.EmailBackend'
]
...
...
@@ -136,7 +148,14 @@ MESSAGE_TAGS = {
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL
=
'/static/'
if
not
DEBUG
:
FORCE_SCRIPT_NAME
=
'/adega/'
STATIC_URL
=
'/adega/static/'
else
:
STATIC_URL
=
'/static/'
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'static'
)
MEDIA_URL
=
'/script/base/'
...
...
src/adega/templates/base.html
View file @
a5fecaaf
...
...
@@ -59,7 +59,7 @@
<div
class=
"col-md-4 offset-md-4"
>
<h3>
Mantido por
</h3>
<a
href=
"http://pet.inf.ufpr.br"
>
<img
src=
"
/static/pet/logo_preto.png
"
width=
"75%"
>
<img
src=
"
{% static 'pet/logo_preto.png' %}
"
width=
"75%"
>
</a>
</div>
</div>
...
...
src/adega/wsgi.py
View file @
a5fecaaf
...
...
@@ -11,6 +11,6 @@ import os
from
django.core.wsgi
import
get_wsgi_application
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"
uploads
.settings"
)
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"
adega
.settings"
)
application
=
get_wsgi_application
()
src/uploads/models.py
View file @
a5fecaaf
...
...
@@ -5,18 +5,28 @@ from django.utils import timezone
from
os
import
path
from
django.conf
import
settings
from
adega.models
import
Course
def
get_path
(
instance
,
filename
):
return
'{}/{}/{}'
.
format
(
instance
.
course
,
instance
.
id
,
filename
)
class
Submission
(
models
.
Model
):
STATUS_ONGOING
=
0
STATUS_FINISHED
=
1
STATUS
=
(
(
STATUS_ONGOING
,
'Em andamento'
),
(
STATUS_FINISHED
,
'Terminado'
),
)
author
=
models
.
ForeignKey
(
User
)
historico
=
models
.
FileField
(
upload_to
=
get_path
)
matricula
=
models
.
FileField
(
upload_to
=
get_path
)
course
=
models
.
CharField
(
max_length
=
10
,
default
=
'21A'
)
course
=
models
.
ForeignKey
(
Course
)
timestamp
=
models
.
DateTimeField
(
default
=
timezone
.
now
)
...
...
@@ -26,10 +36,25 @@ class Submission(models.Model):
process_time
=
models
.
IntegerField
(
null
=
True
)
relative_year
=
models
.
IntegerField
(
null
=
True
)
relative_semester
=
models
.
IntegerField
(
null
=
True
)
semester_status
=
models
.
IntegerField
(
null
=
True
,
choices
=
STATUS
)
done_in
=
models
.
DateTimeField
(
null
=
True
)
def
path
(
self
):
return
path
.
join
(
settings
.
MEDIA_ROOT
,
self
.
course
,
str
(
self
.
id
))
return
path
.
join
(
settings
.
MEDIA_ROOT
,
self
.
course
.
code
,
str
(
self
.
id
))
def
__str__
(
self
):
return
'Submission (from: {}, to: {}, on: {})'
.
format
(
self
.
author
.
first_name
,
self
.
course
,
self
.
timestamp
)
\ No newline at end of file
self
.
course
.
name
,
self
.
timestamp
)
def
set_done
(
self
,
time
):
self
.
processed
=
True
self
.
process_time
=
time
self
.
done_in
=
timezone
.
now
()
self
.
save
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment