mirror of
https://github.com/coulisse/spiderweb.git
synced 2024-09-21 07:27:09 +00:00
visitors count: correction taking ip address
This commit is contained in:
parent
2a05d05de4
commit
3dd3813918
@ -52,6 +52,10 @@ $dbpass = "your-password";
|
||||
If you would change some MariaDB parameters, then you can find them in `/etc/mysql/my.cnf` or `/etc/my.cnf`, depending on your distro.
|
||||
If the database will not be created automatically, please see ["DB_ISSUES.md"](docs/DB_ISSUES.md)
|
||||
|
||||
TODO: se installando i moduli python errore:
|
||||
sudo apt-get install libmariadb3 libmariadb-dev
|
||||
TODO: check number ADXO
|
||||
|
||||
**3) Python modules**
|
||||
You could install python modules using automatic or manual way.
|
||||
|
||||
|
@ -190,13 +190,12 @@ def get_nonce():
|
||||
|
||||
#check if it is a unique visitor
|
||||
def visitor_count():
|
||||
user_ip = request.remote_addr
|
||||
user_ip =request.environ.get('HTTP_X_REAL_IP', request.remote_addr)
|
||||
if user_ip not in visits:
|
||||
visits[user_ip] = 1
|
||||
else:
|
||||
visits[user_ip] += 1
|
||||
|
||||
|
||||
@app.route("/", methods=["GET"])
|
||||
@app.route("/index.html", methods=["GET"])
|
||||
def spots():
|
||||
|
Loading…
Reference in New Issue
Block a user