Skip to content

Walid branch #4

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

Open
wants to merge 70 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
65f0e30
first
Aug 25, 2024
d485718
first
Aug 25, 2024
ef4cf99
ckeditor added
Aug 26, 2024
eef0634
new theme
Aug 26, 2024
04afcd3
0
tej589 Sep 1, 2024
daac6fe
gitignore added
Oct 26, 2024
1fcbba8
fixed requirements
Oct 26, 2024
d87bb95
removing cache
Nov 1, 2024
5f27854
fixed requirements
Nov 1, 2024
5157593
updating readme
Nov 1, 2024
a29e529
updating readme
Nov 1, 2024
33ce4ef
updating readme
Nov 1, 2024
74da225
some changes
Nov 9, 2024
8e4164a
some to do s
Nov 9, 2024
caf47e6
Ajout
hajriislem01 Nov 13, 2024
b8c53f4
admin_change
hajriislem01 Nov 14, 2024
49bdacb
modif 1.0
hajriislem01 Nov 15, 2024
1bcb53d
modif_1.1
hajriislem01 Nov 15, 2024
ae81499
modif_1.2
hajriislem01 Nov 16, 2024
be864f9
to prod
Nov 16, 2024
1bc6b80
added dockerfile
Nov 16, 2024
33dc81d
adding gunicorn
Nov 16, 2024
28d9ae6
prod deployment
Nov 16, 2024
fb6317b
working on prod
Nov 18, 2024
db50ac3
env var config
Nov 18, 2024
63bea5e
testing
Nov 18, 2024
a8b98b4
merging env var
Nov 18, 2024
e86ce50
fixing home
Nov 18, 2024
328ef13
removing db
Nov 18, 2024
5cda05e
fixing db
Nov 18, 2024
7468a0d
delete db from git
Nov 18, 2024
b38c2c4
merging env var
Nov 18, 2024
f75b0a2
adding all posts
Nov 19, 2024
b11d552
ajout_posts
hajriislem01 Nov 20, 2024
7226383
modif1.5
hajriislem01 Nov 22, 2024
4b0a039
modif1.5
hajriislem01 Nov 28, 2024
4117c04
comments, homepage & post-details UI
WeslatiWalid Nov 29, 2024
46549b1
modif1.6
hajriislem01 Nov 29, 2024
db96b30
ok
hajriislem01 Nov 29, 2024
492d393
add_comment
hajriislem01 Dec 19, 2024
b096733
add_profile
hajriislem01 Dec 23, 2024
3300218
adding Replys to Comments
WeslatiWalid Dec 23, 2024
c87b61d
merege
WeslatiWalid Dec 23, 2024
0ce6d6a
login
hajriislem01 Dec 24, 2024
1eee5a2
removing sqlite
Dec 24, 2024
7da7a59
profile
hajriislem01 Dec 24, 2024
84c5159
fixing reply & comments
WeslatiWalid Dec 25, 2024
b979c94
rm db
WeslatiWalid Dec 25, 2024
e0cd4c3
auteur_de_mois
hajriislem01 Dec 27, 2024
ed22940
sql remove
hajriislem01 Dec 27, 2024
fc3906d
Merge branch 'islem_branch' into fix_reply
mmby85 Dec 27, 2024
5d31ee5
Merge pull request #1 from mmby85/fix_reply
mmby85 Dec 27, 2024
36448e2
Merge pull request #2 from mmby85/islem_branch
mmby85 Dec 27, 2024
ddf3437
Merge remote-tracking branch 'origin/fix_reply'
Dec 27, 2024
4a32a12
fixed merged
Dec 27, 2024
7b2286c
change category
Dec 27, 2024
fd397d5
rm migrations
Dec 27, 2024
d11d4db
Merge branch 'main' of github.com:mmby85/bizz2goo
Dec 27, 2024
d4d28b1
images & author bugs
WeslatiWalid Feb 11, 2025
05a3189
latest updates
WeslatiWalid Feb 25, 2025
884709f
latest changes
WeslatiWalid Apr 4, 2025
e710782
UI & Typo updates
WeslatiWalid Apr 24, 2025
6672db6
UI Updates
WeslatiWalid Apr 28, 2025
1be9287
latest updates
WeslatiWalid May 12, 2025
688b2d9
Include static files
WeslatiWalid Jun 8, 2025
d392adc
Include static filess
WeslatiWalid Jun 8, 2025
354e493
Include static files and update .gitignore
WeslatiWalid Jun 8, 2025
6499b04
UI tweeks & adding email forms
WeslatiWalid Jun 20, 2025
84ba8fe
fix email settings
WeslatiWalid Jun 20, 2025
922e605
UI mobile Responsive Tweeks & adding newslettre functionality
WeslatiWalid Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
168 changes: 168 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# 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
*.sqlite3

# 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/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

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

env.py
collectstatic
migrations/*
media/*
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#dockerfile for django app
FROM python:3.10-slim

RUN apt-get update
RUN apt-get install -y --no-install-recommends \
libatlas-base-dev gfortran supervisor \
nano


WORKDIR /app

COPY . .

RUN pip install -r requirements.txt

RUN python3 manage.py makemigrations

RUN python3 manage.py migrate

RUN python manage.py collectstatic --noinput

# CMD ["gunicorn", "--bind", "0.0.0.0:8000", "myproject.wsgi:application"]
CMD ["gunicorn", "-c", "gunicorn_config.py", "myproject.wsgi:application"]

# CMD ["python", "manage.py", "runserver"]
Binary file removed PREVIEW/IMG1.png
Binary file not shown.
Binary file removed PREVIEW/IMG2.png
Binary file not shown.
Binary file removed PREVIEW/IMG3.png
Binary file not shown.
Binary file removed PREVIEW/IMG4.png
Binary file not shown.
Binary file removed PREVIEW/IMG5.png
Binary file not shown.
Binary file removed db.sqlite3
Binary file not shown.
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.3'

services:
bizz2goo:
build:
context: ./
dockerfile: Dockerfile
ports:
- "3080:8000"
volumes:
- ./:/app
- /var/www/html/blogStatic/:/var/www/html/blogStatic/
7 changes: 7 additions & 0 deletions gunicorn_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bind = "0.0.0.0:8000"
workers = 3 # Adjust the number of workers based on your needs
worker_class = "sync" # You can change this to "gevent" or "eventlet" if needed
timeout = 30 # Timeout for workers
loglevel = "info" # Logging level
accesslog = "./access.log" # Log to stdout
errorlog = "./error.log" # Log to stderr
16 changes: 16 additions & 0 deletions links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#UI

https://demos.creative-tim.com/paper-kit-pro-react/#/profile-page

https://demos.creative-tim.com/paper-kit-pro-react/#/presentation

https://demos.creative-tim.com/nextjs-tailwind-blog-posts-page/?_ga=2.127420553.582448555.1730303848-180642451.1724699074#

https://demos.creative-tim.com/material-kit/index.html?_ga=2.72870167.582448555.1730303848-180642451.1724699074

For Articles :
https://demos.creative-tim.com/paper-kit-pro-react/#/blog-post

#Django

https://django-ckeditor.readthedocs.io/en/latest/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 media/images/posts/Florence-840x276.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 media/images/posts/dsd-ecarteur.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 media/images/posts/foto-6-jpg.webp
Binary file not shown.
Binary file added media/images/posts/foto-6-jpg_gehcJdW.webp
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 media/images/posts/téléchargement.jpg
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 media/images/posts/téléchargement_QKjuVw6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed myapp/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file removed myapp/__pycache__/views.cpython-38.pyc
Binary file not shown.
125 changes: 117 additions & 8 deletions myapp/admin.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,122 @@
# blog/admin.py

from django.contrib import admin
from .models import Post,Comment,Contact
# Register your models here.
from django import forms
from .models import Post, Comment, Contact, AuthorProfile, CKPost, SubCategory, Category, Advertisement
from ckeditor.widgets import CKEditorWidget
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.utils.html import format_html # For custom JS in admin form

admin.site.register(Post)
admin.site.register(Comment)
admin.site.register(Contact)
class PostAdminForm(forms.ModelForm):
content = forms.CharField(widget=CKEditorWidget())

class Meta:
model = CKPost
fields = '__all__'

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['title'].widget.attrs.update({'class': 'form-control'})
self.fields['category'].widget.attrs.update({'class': 'form-control'})
self.fields['sub_category'].widget.attrs.update({'class': 'form-control'})
self.fields['content'].widget.attrs.update({'class': 'form-control'}) # content already uses CKEditorWidget
self.fields['image'].widget.attrs.update({'class': 'form-control-file'})
self.fields['slug'].widget.attrs.update({'class': 'form-control'})

class PostAdmin(admin.ModelAdmin):
form = PostAdminForm
list_display = ('title', 'user', 'category', 'time')
list_filter = ('category', 'time', 'user')
search_fields = ('title', 'content', 'user__username', 'user__email')
prepopulated_fields = {'slug': ('title',)} # Auto-populate slug from title

class AuthorProfileInline(admin.StackedInline):
model = AuthorProfile
can_delete = False
verbose_name_plural = 'Author Profile'
fk_name = 'user'

class AdvertisementAdminForm(forms.ModelForm):
class Meta:
model = Advertisement
fields = '__all__'

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# JavaScript to show/hide category based on position
# This makes 'category' field more prominent when needed
self.fields['position'].widget.attrs['onchange'] = (
"var categoryRow = document.querySelector('.field-category');"
"if (this.value === 'bottom_banner_category' || this.value === 'sidebar') {"
" categoryRow.style.display = '';"
"} else {"
" categoryRow.style.display = 'none';"
"}"
)

# Include the script in the form's media
class Media:
js = ('admin/js/jquery.init.js', 'admin/js/dynamic_form_fields.js') # Example, ensure these paths are correct or provide inline script

@admin.register(Advertisement)
class AdvertisementAdmin(admin.ModelAdmin):
form = AdvertisementAdminForm
list_display = ('title', 'position', 'link_type', 'category', 'is_active', 'display_order', 'created_at')
list_filter = ('is_active', 'position', 'category', 'link_type')
search_fields = ('title',)
fieldsets = (
(None, {
'fields': ('title', 'image', 'is_active', 'position', 'display_order')
}),
('Lien de l\'annonce', {
'fields': ('link_type', 'external_url'),
'description': ("Si un type de 'Formulaire Interne' est choisi, l'URL externe sera ignorée. " # Updated description
"Si 'Lien Externe' est choisi, l'URL externe est requise.")
}),
('Ciblage par Catégorie', {
'fields': ('category',),
'description': ("Requis pour 'Bottom Banner Category'. Optionnel pour 'Sidebar Ad' "
"pour cibler une catégorie spécifique. Laisser vide pour les 'Sidebar Ad' généraux.")
}),
)
list_editable = ('is_active', 'display_order')

class CustomUserAdmin(UserAdmin):
inlines = (AuthorProfileInline,)
list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff', 'is_active', 'get_is_author') # Renamed for consistency
list_filter = ('is_staff', 'is_active', 'authorprofile__is_author')
fieldsets = UserAdmin.fieldsets # Use default UserAdmin fieldsets
add_fieldsets = UserAdmin.add_fieldsets # Use default UserAdmin add_fieldsets


def get_is_author(self, obj):
if hasattr(obj, 'authorprofile'):
return obj.authorprofile.is_author
return False
get_is_author.boolean = True
get_is_author.short_description = 'Is Author'

@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
list_display = ('name', 'slug', 'description')
prepopulated_fields = {'slug': ('name',)}

@admin.register(SubCategory)
class SubCategoryAdmin(admin.ModelAdmin):
list_display = ('name', 'category')
list_filter = ('category',)

# --- Registration ---
admin.site.unregister(User) # Unregister default User admin
admin.site.register(User, CustomUserAdmin) # Register with custom admin

admin.site.register(CKPost, PostAdmin)
admin.site.register(Post) # Assuming this is your old Post model, keep if needed, otherwise remove
admin.site.register(Comment)
admin.site.register(Contact)
# admin.site.register(AuthorProfile) # This is handled by the inline in CustomUserAdmin

admin.site.site_header = 'BLOGSPOT | ADMIN PANEL'
admin.site.site_title = 'BLOGSPOT | BLOGGING WEBSITE'
admin.site.index_title= 'BlogSpot Site Administration'
admin.site.site_header = 'GOZONE | ADMIN PANEL' # Updated name
admin.site.site_title = 'GOZONE | Content Management' # Updated name
admin.site.index_title = 'GoZone Site Administration' # Updated name
Loading