Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pédagogies Multimodales
Phonographe
Commits
48a5061b
Commit
48a5061b
authored
Aug 07, 2022
by
Sylvain Coulange
🌼
Browse files
update addstat agent
parent
ed9ce26e
Changes
2
Hide whitespace changes
Inline
Side-by-side
users/models.py
View file @
48a5061b
...
...
@@ -58,4 +58,5 @@ class appstats(models.Model):
app
=
models
.
CharField
(
max_length
=
30
)
module
=
models
.
CharField
(
max_length
=
30
)
ip
=
models
.
CharField
(
max_length
=
30
)
agent
=
models
.
CharField
(
max_length
=
200
,
default
=
'Anonymous'
)
lang
=
models
.
CharField
(
max_length
=
10
)
users/views.py
View file @
48a5061b
...
...
@@ -610,6 +610,7 @@ def addStat(request):
newStat
.
app
=
app
newStat
.
module
=
module
newStat
.
ip
=
get_client_ip
(
request
)
newStat
.
agent
=
parse
(
request
.
META
[
'HTTP_USER_AGENT'
])
newStat
.
lang
=
lang
if
newStat
.
ip
!=
"127.0.0.1"
:
newStat
.
save
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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