Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group7 #18

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fdf88e0
add gitignore
Hessam-Hosseinian Jan 13, 2025
a249e6c
add gitignore
Hessam-Hosseinian Jan 13, 2025
92f599c
add models.py
Hessam-Hosseinian Jan 13, 2025
416388e
add meilisearch commit
Hessam-Hosseinian Jan 13, 2025
dfb34cd
add about section
Hessam-Hosseinian Jan 13, 2025
7f05250
about debug
Hessam-Hosseinian Jan 13, 2025
068a337
save commit
Hessam-Hosseinian Jan 13, 2025
dcafb43
save commit
Hessam-Hosseinian Jan 14, 2025
77bc71f
save commit
Hessam-Hosseinian Jan 14, 2025
16552c5
hamburger menu
sadrashadmehry Jan 14, 2025
5acaf4a
Merge pull request #1 from Hessam-Hosseinian/master
Hessam-Hosseinian Jan 14, 2025
90b1b17
save commit
Hessam-Hosseinian Jan 14, 2025
2944d82
save commit
Hessam-Hosseinian Jan 14, 2025
30f1f03
tamoom shod mobarak kheylia
Hessam-Hosseinian Jan 14, 2025
2fd5b28
tamoom shod mobarak kheylia
Hessam-Hosseinian Jan 14, 2025
1af1f41
finial commit
Hessam-Hosseinian Jan 15, 2025
e4549df
screenshot commit
Hessam-Hosseinian Jan 15, 2025
f6ba022
Update Readme.md
Hessam-Hosseinian Jan 15, 2025
031f7cc
Update Readme.md
Hessam-Hosseinian Jan 15, 2025
f3f98db
Update Readme.md
Hessam-Hosseinian Jan 15, 2025
e1936ce
Update Readme.md
Hessam-Hosseinian Jan 15, 2025
51f65e4
Merge branch 'main' into main
k3rn3lpanicc Jan 15, 2025
17bda4e
move Readme to group folder
k3rn3lpanicc Jan 15, 2025
f8df503
Update requirements.txt
k3rn3lpanicc Jan 15, 2025
f849c4b
Update requirements.txt
k3rn3lpanicc Jan 15, 2025
85791c1
Revert "Update requirements.txt"
k3rn3lpanicc Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,182 @@
### Django template
*.log
*.pot
*.pyc
__pycache__/
local_settings.py
db.sqlite3
db.sqlite3-journal
media

# 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/

### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.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
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.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
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.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/



=======
node_modules
__pycache__
*.pyc
Expand Down
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Use the official Python runtime image
FROM django

# Expose the Django port
EXPOSE 8000

# Create the app directory
RUN mkdir /app

# Set the working directory inside the container
WORKDIR /app



# Set environment variables
# Prevents Python from writing pyc files to disk
ENV PYTHONDONTWRITEBYTECODE=1
#Prevents Python from buffering stdout and stderr
ENV PYTHONUNBUFFERED=1

# Upgrade pip
RUN pip install --upgrade pip

# Copy the Django project and install dependencies
COPY requirements.txt /app/



# run this command to install all dependencies
RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -r requirements.txt

# Copy the Django project to the container
COPY ./src /app/


# Run Django’s development server
CMD ["python", "manage.py", "makemigrations"]
CMD ["python", "manage.py", "migrate"]
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
Binary file added Screenshots/image (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/image (2).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/image (3).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3.9'
services:

django-server:
build:
context: ./
dockerfile: Dockerfile
ports:
- "8000:8000"
depends_on:
meilisearch:
condition: service_healthy




meilisearch:
image: getmeili/meilisearch:latest
ports:
- "7700:7700"
volumes:
- ./data.ms:/data.ms
environment:
- MEILI_DB_PATH=/data.ms
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:7700/health" ]
interval: 10s
timeout: 5s
retries: 5


6 changes: 6 additions & 0 deletions src/requirements.txt → requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ pillow
django-storages
boto3
mysql-connector-python
mysqlclient
pymysql
hazm
parsivar
tqdm
datasets
meilisearch
googletrans
16 changes: 9 additions & 7 deletions src/FarsiAid_website/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
DB_PORT)
import os
import pymysql

pymysql.install_as_MySQLdb()

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

Expand All @@ -36,7 +36,6 @@
ALLOWED_HOSTS = []
CORS_ALLOW_ALL_ORIGINS = True


# Application definition

INSTALLED_APPS = [
Expand Down Expand Up @@ -94,7 +93,6 @@

WSGI_APPLICATION = 'FarsiAid_website.wsgi.application'


# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases

Expand All @@ -113,8 +111,6 @@
}
}



# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators

Expand All @@ -133,7 +129,6 @@
},
]


# Internationalization
# https://docs.djangoproject.com/en/5.0/topics/i18n/

Expand All @@ -145,7 +140,6 @@

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/

Expand All @@ -157,3 +151,11 @@

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')






MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
6 changes: 4 additions & 2 deletions src/FarsiAid_website/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from . import views

urlpatterns = [
path("" , views.base),
path("", views.base, name='home'),
path("admin/", admin.site.urls),
path("registration/", include("registration.urls")),
path("group1/", include("group1.urls")),
Expand All @@ -36,4 +36,6 @@
path("group9/", include("group9.urls")),
path("group10/", include("group10.urls")),

]
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


Loading