Compare commits
3 commits
9815aa4c73
...
bb1b1a8ebf
| Author | SHA1 | Date | |
|---|---|---|---|
| bb1b1a8ebf | |||
| 672e26c89d | |||
| 21e76f8f55 |
5 changed files with 81 additions and 291 deletions
294
.gitignore
vendored
294
.gitignore
vendored
|
|
@ -1,142 +1,12 @@
|
||||||
.idea
|
|
||||||
|
|
||||||
# Created by https://www.toptal.com/developers/gitignore/api/django,python,virtualenv
|
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=django,python,virtualenv
|
|
||||||
|
|
||||||
### Django ###
|
|
||||||
*.log
|
|
||||||
*.pot
|
|
||||||
*.pyc
|
|
||||||
__pycache__/
|
|
||||||
local_settings.py
|
|
||||||
#*.sqlite3
|
|
||||||
#db.sqlite3
|
|
||||||
db.sqlite3-journal
|
|
||||||
media
|
|
||||||
#static
|
|
||||||
staticfiles
|
|
||||||
profile_images
|
|
||||||
|
|
||||||
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
|
|
||||||
# in your Git repository. Update and uncomment the following line accordingly.
|
|
||||||
# <django-project-name>/staticfiles/
|
|
||||||
|
|
||||||
# db.sqlite3
|
|
||||||
### Django.Python Stack ###
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
|
||||||
|
|
||||||
# C extensions
|
|
||||||
*.so
|
|
||||||
|
|
||||||
# Distribution / packaging
|
|
||||||
.Python
|
|
||||||
build/
|
|
||||||
develop-eggs/
|
|
||||||
#dist/
|
|
||||||
downloads/
|
|
||||||
eggs/
|
|
||||||
.eggs/
|
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
parts/
|
|
||||||
sdist/
|
|
||||||
var/
|
|
||||||
wheels/
|
|
||||||
share/python-wheels/
|
|
||||||
*.egg-info/
|
|
||||||
.installed.cfg
|
|
||||||
*.egg
|
|
||||||
MANIFEST
|
|
||||||
|
|
||||||
# PyInstaller
|
|
||||||
# Usually these files are written by a python script from a template
|
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
||||||
*.manifest
|
|
||||||
*.spec
|
|
||||||
|
|
||||||
# Installer logs
|
|
||||||
pip-log.txt
|
|
||||||
pip-delete-this-directory.txt
|
|
||||||
|
|
||||||
# Unit test / coverage reports
|
|
||||||
htmlcov/
|
|
||||||
.tox/
|
|
||||||
.nox/
|
|
||||||
.coverage
|
|
||||||
.coverage.*
|
|
||||||
.cache
|
|
||||||
nosetests.xml
|
|
||||||
coverage.xml
|
|
||||||
*.cover
|
|
||||||
*.py,cover
|
|
||||||
.hypothesis/
|
|
||||||
.pytest_cache/
|
|
||||||
cover/
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
*.mo
|
|
||||||
|
|
||||||
# Django stuff:
|
# Django stuff:
|
||||||
|
*.log
|
||||||
# Flask stuff:
|
local_settings.py
|
||||||
instance/
|
db.sqlite3
|
||||||
.webassets-cache
|
db.sqlite3-journal
|
||||||
|
|
||||||
# Scrapy stuff:
|
|
||||||
.scrapy
|
|
||||||
|
|
||||||
# Sphinx documentation
|
|
||||||
docs/_build/
|
|
||||||
|
|
||||||
# PyBuilder
|
|
||||||
.pybuilder/
|
|
||||||
target/
|
|
||||||
|
|
||||||
# Jupyter Notebook
|
|
||||||
.ipynb_checkpoints
|
|
||||||
|
|
||||||
# IPython
|
|
||||||
profile_default/
|
|
||||||
ipython_config.py
|
|
||||||
|
|
||||||
# pyenv
|
|
||||||
# For a library or package, you might want to ignore these files since the code is
|
|
||||||
# intended to run in multiple environments; otherwise, check them in:
|
|
||||||
# .python-version
|
|
||||||
|
|
||||||
# pipenv
|
|
||||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
||||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
||||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
||||||
# install all needed dependencies.
|
|
||||||
#Pipfile.lock
|
|
||||||
|
|
||||||
# poetry
|
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
||||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
||||||
# commonly ignored for libraries.
|
|
||||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
||||||
#poetry.lock
|
|
||||||
|
|
||||||
# pdm
|
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
||||||
#pdm.lock
|
|
||||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
||||||
# in version control.
|
|
||||||
# https://pdm.fming.dev/#use-with-ide
|
|
||||||
.pdm.toml
|
|
||||||
|
|
||||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
||||||
__pypackages__/
|
|
||||||
|
|
||||||
# Celery stuff
|
|
||||||
celerybeat-schedule
|
|
||||||
celerybeat.pid
|
|
||||||
|
|
||||||
# SageMath parsed files
|
|
||||||
*.sage.py
|
|
||||||
|
|
||||||
# Environments
|
# Environments
|
||||||
.env
|
.env
|
||||||
|
|
@ -147,141 +17,29 @@ ENV/
|
||||||
env.bak/
|
env.bak/
|
||||||
venv.bak/
|
venv.bak/
|
||||||
|
|
||||||
# Spyder project settings
|
# Media & Static Files
|
||||||
.spyderproject
|
/media/*
|
||||||
.spyproject
|
/staticfiles/*
|
||||||
|
|
||||||
# Rope project settings
|
|
||||||
.ropeproject
|
|
||||||
|
|
||||||
# mkdocs documentation
|
# Cache & Temporary Files
|
||||||
/site
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*.swn
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
|
||||||
# mypy
|
# Editor-specific files
|
||||||
.mypy_cache/
|
*.kate-swp
|
||||||
.dmypy.json
|
*.backup
|
||||||
dmypy.json
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
.DS_Store
|
||||||
|
._*
|
||||||
|
|
||||||
# Pyre type checker
|
# migrations
|
||||||
.pyre/
|
# */migrations/0*.py
|
||||||
|
!*/migrations/__init__.py
|
||||||
|
|
||||||
# pytype static type analyzer
|
# cursor
|
||||||
.pytype/
|
.cursor/*
|
||||||
|
|
||||||
# Cython debug symbols
|
|
||||||
cython_debug/
|
|
||||||
|
|
||||||
# PyCharm
|
|
||||||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
||||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
||||||
#.idea/
|
|
||||||
|
|
||||||
### Python ###
|
|
||||||
# Byte-compiled / optimized / DLL files
|
|
||||||
|
|
||||||
# C extensions
|
|
||||||
|
|
||||||
# Distribution / packaging
|
|
||||||
|
|
||||||
# PyInstaller
|
|
||||||
# Usually these files are written by a python script from a template
|
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
||||||
|
|
||||||
# Installer logs
|
|
||||||
|
|
||||||
# Unit test / coverage reports
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
|
|
||||||
# Django stuff:
|
|
||||||
|
|
||||||
# Flask stuff:
|
|
||||||
|
|
||||||
# Scrapy stuff:
|
|
||||||
|
|
||||||
# Sphinx documentation
|
|
||||||
|
|
||||||
# PyBuilder
|
|
||||||
|
|
||||||
# Jupyter Notebook
|
|
||||||
|
|
||||||
# IPython
|
|
||||||
|
|
||||||
# pyenv
|
|
||||||
# For a library or package, you might want to ignore these files since the code is
|
|
||||||
# intended to run in multiple environments; otherwise, check them in:
|
|
||||||
# .python-version
|
|
||||||
|
|
||||||
# pipenv
|
|
||||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
||||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
||||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
||||||
# install all needed dependencies.
|
|
||||||
|
|
||||||
# poetry
|
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
||||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
||||||
# commonly ignored for libraries.
|
|
||||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
||||||
|
|
||||||
# pdm
|
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
||||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
||||||
# in version control.
|
|
||||||
# https://pdm.fming.dev/#use-with-ide
|
|
||||||
|
|
||||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
||||||
|
|
||||||
# Celery stuff
|
|
||||||
|
|
||||||
# SageMath parsed files
|
|
||||||
|
|
||||||
# Environments
|
|
||||||
|
|
||||||
# Spyder project settings
|
|
||||||
|
|
||||||
# Rope project settings
|
|
||||||
|
|
||||||
# mkdocs documentation
|
|
||||||
|
|
||||||
# mypy
|
|
||||||
|
|
||||||
# Pyre type checker
|
|
||||||
|
|
||||||
# pytype static type analyzer
|
|
||||||
|
|
||||||
# Cython debug symbols
|
|
||||||
|
|
||||||
# PyCharm
|
|
||||||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
||||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
||||||
|
|
||||||
### Python Patch ###
|
|
||||||
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
|
||||||
poetry.toml
|
|
||||||
|
|
||||||
# ruff
|
|
||||||
.ruff_cache/
|
|
||||||
|
|
||||||
# LSP config files
|
|
||||||
pyrightconfig.json
|
|
||||||
|
|
||||||
### VirtualEnv ###
|
|
||||||
# Virtualenv
|
|
||||||
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
|
|
||||||
[Bb]in
|
|
||||||
[Ii]nclude
|
|
||||||
[Ll]ib
|
|
||||||
[Ll]ib64
|
|
||||||
[Ll]ocal
|
|
||||||
[Ss]cripts
|
|
||||||
pyvenv.cfg
|
|
||||||
pip-selfcheck.json
|
|
||||||
|
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/django,python,virtualenv
|
|
||||||
|
|
||||||
.cursor
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/5.2/ref/settings/
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from decouple import config
|
||||||
|
import dj_database_url
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
@ -20,16 +22,28 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = 'django-insecure-h!2hx$h=f6ktgdks!g2_*pg_s1nnuyk+j2yd*_x8r+3+3iyfy*'
|
SECRET_KEY = config('DJANGO_SECRET_KEY', default="unsecure-secretkey-kjhsgfjsfgjsfgjsg")
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = config('DEBUG', cast=bool, default=True)
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
# Allowed hosts
|
||||||
|
ALLOWED_HOSTS = [host for host in config("DJANGO_ALLOWED_HOSTS", default="").split() if host]
|
||||||
|
|
||||||
|
# URL scheme (http or https)
|
||||||
|
URL_SCHEME = config("URL_SCHEME", default="http")
|
||||||
|
|
||||||
|
|
||||||
|
# CSRF trusted origins (add both with and without port if you use a non-standard port)
|
||||||
|
CSRF_TRUSTED_ORIGINS = []
|
||||||
|
for host in ALLOWED_HOSTS:
|
||||||
|
if host not in ("localhost", "127.0.0.1"):
|
||||||
|
CSRF_TRUSTED_ORIGINS.append(f"{URL_SCHEME}://{host}")
|
||||||
|
|
||||||
|
# Generate base URL for absolute URLs (use first allowed host)
|
||||||
|
BASE_URL = f"{URL_SCHEME}://{ALLOWED_HOSTS[0]}" if ALLOWED_HOSTS else "http://localhost"
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
# ------ theme ------ #
|
# ------ theme ------ #
|
||||||
'jazzmin',
|
'jazzmin',
|
||||||
|
|
@ -45,6 +59,7 @@ INSTALLED_APPS = [
|
||||||
|
|
||||||
# ------- third party apps ------- #
|
# ------- third party apps ------- #
|
||||||
'simple_history',
|
'simple_history',
|
||||||
|
'django_extensions',
|
||||||
# -------------------------------- #
|
# -------------------------------- #
|
||||||
|
|
||||||
# ------- my apps ------- #
|
# ------- my apps ------- #
|
||||||
|
|
@ -96,13 +111,20 @@ WSGI_APPLICATION = '_base.wsgi.application'
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||||
|
|
||||||
DATABASES = {
|
DB_TYPE = config('DB_TYPE', default='sqlite').lower()
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': BASE_DIR / 'db.sqlite3',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if DB_TYPE == 'postgres':
|
||||||
|
DATABASES = {
|
||||||
|
'default': dj_database_url.config(default=config('DATABASE_URL'))
|
||||||
|
}
|
||||||
|
|
||||||
|
else:
|
||||||
|
DATABASES = {
|
||||||
|
"default": {
|
||||||
|
"ENGINE": "django.db.backends.sqlite3",
|
||||||
|
"NAME": BASE_DIR/"db.sqlite3",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
||||||
|
|
@ -139,15 +161,15 @@ USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/5.2/howto/static-files/
|
STATIC_URL = '/static/'
|
||||||
STATIC_ROOT = 'ss'
|
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
|
||||||
STATIC_URL = 'static/'
|
|
||||||
STATICFILES_DIRS = [
|
STATICFILES_DIRS = [
|
||||||
os.path.join(BASE_DIR, 'static')
|
os.path.join(BASE_DIR, 'static'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Media files
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
MEDIA_ROOT = BASE_DIR / 'media'
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
||||||
|
|
|
||||||
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
21
liara.json
21
liara.json
|
|
@ -1,9 +1,14 @@
|
||||||
{
|
{
|
||||||
"app": "shafafiyat",
|
"app": "meterplus",
|
||||||
"port": 80,
|
"port": 80,
|
||||||
"team-id": "68822f40f04e5bc3027fc2b7",
|
"team-id": "68822f40f04e5bc3027fc2b7",
|
||||||
"build": {
|
"build": {
|
||||||
"location": "iran"
|
"location": "iran"
|
||||||
},
|
},
|
||||||
"disks": []
|
"disks": [
|
||||||
}
|
{
|
||||||
|
"name": "media",
|
||||||
|
"mountTo": "/usr/src/app/media"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,15 @@
|
||||||
asgiref==3.9.1
|
asgiref==3.9.1
|
||||||
|
dj-database-url==3.0.1
|
||||||
Django==5.2.5
|
Django==5.2.5
|
||||||
|
django-extensions==4.1
|
||||||
django-jazzmin==3.0.1
|
django-jazzmin==3.0.1
|
||||||
django-simple-history==3.10.1
|
django-simple-history==3.10.1
|
||||||
et_xmlfile==2.0.0
|
et_xmlfile==2.0.0
|
||||||
openpyxl==3.1.5
|
openpyxl==3.1.5
|
||||||
pillow==11.3.0
|
pillow==11.3.0
|
||||||
|
psycopg2==2.9.10
|
||||||
|
psycopg2-binary==2.9.10
|
||||||
|
python-decouple==3.8
|
||||||
sqlparse==0.5.3
|
sqlparse==0.5.3
|
||||||
typing_extensions==4.15.0
|
typing_extensions==4.15.0
|
||||||
utm==0.8.1
|
utm==0.8.1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue