Compare commits
No commits in common. "bb1b1a8ebfcbd452c775a3697b8be69ec97d1359" and "9815aa4c730d99a2b8ba98c28545572f67c133a5" have entirely different histories.
bb1b1a8ebf
...
9815aa4c73
5 changed files with 290 additions and 80 deletions
294
.gitignore
vendored
294
.gitignore
vendored
|
|
@ -1,12 +1,142 @@
|
||||||
# Byte-compiled / optimized / DLL files
|
.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__/
|
__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
|
||||||
*.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
|
|
||||||
local_settings.py
|
# Flask stuff:
|
||||||
db.sqlite3
|
instance/
|
||||||
db.sqlite3-journal
|
.webassets-cache
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
@ -17,29 +147,141 @@ ENV/
|
||||||
env.bak/
|
env.bak/
|
||||||
venv.bak/
|
venv.bak/
|
||||||
|
|
||||||
# Media & Static Files
|
# Spyder project settings
|
||||||
/media/*
|
.spyderproject
|
||||||
/staticfiles/*
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
# Cache & Temporary Files
|
# mkdocs documentation
|
||||||
*.swp
|
/site
|
||||||
*.swo
|
|
||||||
*.swn
|
|
||||||
*.bak
|
|
||||||
*.tmp
|
|
||||||
|
|
||||||
# Editor-specific files
|
# mypy
|
||||||
*.kate-swp
|
.mypy_cache/
|
||||||
*.backup
|
.dmypy.json
|
||||||
.vscode/
|
dmypy.json
|
||||||
.idea/
|
|
||||||
.DS_Store
|
|
||||||
._*
|
|
||||||
|
|
||||||
# migrations
|
# Pyre type checker
|
||||||
# */migrations/0*.py
|
.pyre/
|
||||||
!*/migrations/__init__.py
|
|
||||||
|
|
||||||
# cursor
|
# pytype static type analyzer
|
||||||
.cursor/*
|
.pytype/
|
||||||
|
|
||||||
|
# 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,8 +11,6 @@ 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
|
||||||
|
|
@ -22,28 +20,16 @@ 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 = config('DJANGO_SECRET_KEY', default="unsecure-secretkey-kjhsgfjsfgjsfgjsg")
|
SECRET_KEY = 'django-insecure-h!2hx$h=f6ktgdks!g2_*pg_s1nnuyk+j2yd*_x8r+3+3iyfy*'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = config('DEBUG', cast=bool, default=True)
|
DEBUG = 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',
|
||||||
|
|
@ -59,7 +45,6 @@ INSTALLED_APPS = [
|
||||||
|
|
||||||
# ------- third party apps ------- #
|
# ------- third party apps ------- #
|
||||||
'simple_history',
|
'simple_history',
|
||||||
'django_extensions',
|
|
||||||
# -------------------------------- #
|
# -------------------------------- #
|
||||||
|
|
||||||
# ------- my apps ------- #
|
# ------- my apps ------- #
|
||||||
|
|
@ -111,20 +96,13 @@ 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
|
||||||
|
|
||||||
DB_TYPE = config('DB_TYPE', default='sqlite').lower()
|
DATABASES = {
|
||||||
|
'default': {
|
||||||
if DB_TYPE == 'postgres':
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
DATABASES = {
|
'NAME': BASE_DIR / 'db.sqlite3',
|
||||||
'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
|
||||||
|
|
@ -161,15 +139,15 @@ USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
STATIC_URL = '/static/'
|
# https://docs.djangoproject.com/en/5.2/howto/static-files/
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
|
STATIC_ROOT = 'ss'
|
||||||
|
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 = os.path.join(BASE_DIR, 'media')
|
MEDIA_ROOT = 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
Normal file
BIN
db.sqlite3
Normal file
Binary file not shown.
19
liara.json
19
liara.json
|
|
@ -1,14 +1,9 @@
|
||||||
{
|
{
|
||||||
"app": "meterplus",
|
"app": "shafafiyat",
|
||||||
"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,15 +1,10 @@
|
||||||
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