Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Modifs pierre #14

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2363a9e
Bump urllib3 from 2.0.4 to 2.0.7 in /stays
dependabot[bot] Dec 9, 2023
15be684
Bump pillow from 10.0.0 to 10.0.1 in /stays
dependabot[bot] Dec 9, 2023
ae9bb4e
Bump django from 4.2.4 to 4.2.7 in /stays
dependabot[bot] Dec 9, 2023
a8abecf
Bump cryptography from 41.0.3 to 41.0.6 in /stays
dependabot[bot] Dec 9, 2023
59da89a
Merge pull request #4 from nojoven/dependabot/pip/stays/cryptography-…
nojoven Dec 9, 2023
6aa9d67
Merge pull request #3 from nojoven/dependabot/pip/stays/django-4.2.7
nojoven Dec 9, 2023
b6c3aa2
Disable Django Debug Mode
pixeebot Dec 9, 2023
e50094e
Merge branch 'main' into dependabot/pip/stays/pillow-10.0.1
nojoven Dec 9, 2023
d8e97ce
Merge pull request #2 from nojoven/dependabot/pip/stays/pillow-10.0.1
nojoven Dec 9, 2023
1c985ea
Merge pull request #5 from nojoven/pixeebot/drip-2023-12-09-pixee-pyt…
nojoven Dec 9, 2023
298bce5
Merge pull request #1 from nojoven/dependabot/pip/stays/urllib3-2.0.7
nojoven Dec 9, 2023
3665b7e
Secure Setting for Django `SESSION_COOKIE_SECURE` flag
pixeebot Dec 19, 2023
9cf67b8
Merge pull request #6 from nojoven/pixeebot/drip-2023-12-19-pixee-pyt…
nojoven Dec 28, 2023
78976c0
Bump the pip group across 1 directories with 2 updates
dependabot[bot] Feb 21, 2024
12a8b39
Bump the pip group group in /stays with 3 updates
dependabot[bot] Feb 26, 2024
3ab8079
Merge pull request #11 from nojoven/dependabot/pip/stays/pip-security…
nojoven Mar 1, 2024
eb4b822
Merge pull request #12 from nojoven/dependabot/pip/stays/pip-security…
nojoven Mar 1, 2024
3951810
Stupide jeu de maux
pierrechtux Mar 3, 2024
6b47443
Gros mergier
pierrechtux Mar 3, 2024
b4321bc
Gros mergier, pas fini de nettoyer
pierrechtux Mar 3, 2024
3ec2af2
Corrections
pierrechtux Mar 3, 2024
7ee8271
Added shebang line and set execution right
pierrechtux Mar 4, 2024
be787b7
Converted requirements.txt to UTF8
pierrechtux Mar 4, 2024
4d323f3
Started scripting Stays install process within the documentation; thi…
pierrechtux Mar 5, 2024
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
93 changes: 93 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,82 @@ P13 2023
# STAYS
## STAYS is a web social media for people who like to tell and share their stories.

<!--
<<<<<<< HEAD
Ceci est pour une démo
Armagnac.
=======


+
+Cd vers répertoire où il y a manage.py
+
-->

There are two ways to install Stays: manually or automatically.
<!--
Scripter tout ça

-->
### Automated installation

Start a terminal,go to your typical development working directory, and copy/paste the following lines:

```bash

# Repository definition:

# URL originale:
repo_name="P013"
git_url="github.com/nojoven/${repo_name}.git"

# URL de mon clone:
repo_name="cjo_p013"
git_url="github.com:pchg/${repo_name}.git"

# Reference branch:
git_branch="develop"
git_branch="modifs_pierre"




# Clone the Stays' repository (depth 1 is useful for persons with poor Internet connection, since the complete .git is quite heavy (185M, as of 2024_03_03__23_48_25)):
git clone https://${git_url} --depth

# Get to the reference branch (useful during debug phase):
git checkout "${git_branch}"

# Move to project directory and to subdirectory where manage.py is located:
cd ${repo_name}/stays/

# Make a Python virtual environment, and activate it:
if [[ ! -d .venv ]]; then
echo "Creation of Python virtual environment..."
python3 -m venv .venv
echo "Install required Python packages into the virtual environment.."
pip install ../requirements.txt
fi
source .venv/bin/activate

# Get environment variables:
source .env


# python manage.py collection_static
python manage.py collectstatic
# __________***_JEANSUILA_***__________

python manage.py make migrations
python manage.py migrate
python manage.py runserver
```


## Database user

Create postgresql user with the name "staydmin"

```
GRANT ALL PRIVILEGES ON DATABASE defaultdb TO staydmin;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO staydmin;
Expand All @@ -14,6 +88,7 @@ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO staydmin;


## Install this project manually:

- Clone the repository
- Checkout to branch develop
- ```cd stays/stays``` to open the file of the pyproject.toml
Expand All @@ -24,10 +99,12 @@ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO staydmin;
- Install Postgresql 15

## Configurations

- Rename conf.js to confs.js
- Add the missing values

## Migrations

- ```python manage.py makemigrations users```
- ```python manage.py migrate users```
- ```python manage.py makemigrations core```
Expand All @@ -38,25 +115,31 @@ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO staydmin;


## Populate cities_light

``` python manage.py cities_light```

## Set the root of static files

```python manage.py collectstatic```

## Start the project

### Run the command

- ```cd P013/stays```
- ```poetry shell```
- ```python manage.py runserver 8001```
- ```python manage.py migrate```

### Create an administrator

- In another terminal ```python manage.py createsuperuser```
- You can connect at ```localhost:5000/admin```

### Create a publication

### Configure the Queue manager

- ```python manage.py qcluster```
- Add these lines to pyproject.toml (or tox.ini ?):
[Unit]
Expand All @@ -74,12 +157,20 @@ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO staydmin;
WantedBy=multi-user.target

### Automated installation

<!--
+
+Cd vers répertoire où il y a manage.py
+
-->
```python manage.py setupstays```

### Run tests:

```python manage.py runtests```

#### Install mailpit

- https://github.com/axllent/mailpit/releases/tag/v1.13.1

- Start it manually from your terminal
Expand All @@ -88,8 +179,10 @@ GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO staydmin;


## Credits:

- https://www.drlinkcheck.com/blog/free-http-error-images
- https://freefrontend.com/403-forbidden-html-templates
- https://freefrontend.com/500-error-page-html-templates
- A Pen created on CodePen.io. Original URL: [https://codepen.io/shubniggurath/pen/NLYzLj](https://codepen.io/shubniggurath/pen/NLYzLj).
- [https://codepen.io/jsonyeung/pen/ZMxdPg](https://codepen.io/jsonyeung/pen/ZMxdPg)

1 change: 1 addition & 0 deletions project_tree.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import os
from icecream import ic
from directory_tree import display_tree
Expand Down
1 change: 1 addition & 0 deletions stays/public_key_staydmin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AAAAB3NzaC1yc2EAAAADAQABAAABAQDdPWzbDqdw+YBaN6O7pE+Yda5K5jkFYHbcvWuKzxJWro5Hh9y1cnNf/afrYUXH/T4fORBp66ZUANcZkgI6NdcZh0evS10m2PVVkrnv1yvcakxWdFa358SlshBbS/A4asqD/A/j3i0kZN8H3Sml1ktCEYdTXy9pX9ak/yYDju+MXNk5XLKyBMPuO0T9YiLuTvLdLHAigDALGHzxDsq33zSDnlk8FSyX8oHTD/1UU9+39XygcXxqp9uu88jJTWC8qXJRTrAuYKI44kXhMXQ9D2EwMW2fYg5GGwjw6yKEz0XFz3+EcKqkSknyQC6t8ekKL7gFkvKQ7itOsnXanueWKw5d Megaport@Adyga
85 changes: 85 additions & 0 deletions stays/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
aiohttp==3.9.3
aiosignal==1.3.1
annotated-types==0.6.0
anyio==4.3.0
asgiref==3.7.2
asttokens==2.4.1
async-timeout==4.0.3
attrs==23.2.0
autobahn==23.6.2
Automat==22.10.0
certifi==2024.2.2
cffi==1.16.0
channels==4.0.0
charset-normalizer==3.3.2
cleantext==1.1.4
click==8.1.7
colorama==0.4.6
constantly==23.10.4
contextlib2==21.6.0
cryptography==42.0.5
daphne==4.1.0
Django==4.2.4
django-auto-logout==0.5.1
django-autoslug==1.9.9
django-cities-light==3.10.1
django-cool-pagination==0.3.0
django-countries==7.5.1
django-defender==0.9.8
django-friendship==1.9.6
django-htmx==1.17.3
django-ninja==1.1.0
django-ninja-extra==0.20.4
django-pagination-py3==2.0.0
django-picklefield==3.1
django-q2==1.6.1
django-redis==5.4.0
django-throttle-requests==0.7.0
executing==2.0.1
fontawesomefree==6.5.1
frozenlist==1.4.1
geoip2==4.8.0
h11==0.14.0
httpcore==1.0.4
httpx==0.27.0
hyperlink==21.0.0
icecream==2.1.3
idna==3.6
incremental==22.10.0
injector==0.21.0
joblib==1.3.2
maxminddb==2.5.2
multidict==6.0.5
neattext==0.1.3
nltk==3.8.1
pillow==10.2.0
progressbar2==4.4.1
psycopg==3.1.18
psycopg-binary==3.1.18
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
pydantic==2.6.3
pydantic_core==2.16.3
Pygments==2.17.2
pyOpenSSL==24.0.0
python-dotenv==1.0.1
python-utils==3.8.2
pytz==2024.1
redis==5.0.2
regex==2023.12.25
requests==2.31.0
sentry-sdk==1.40.6
service-identity==24.1.0
six==1.16.0
sniffio==1.3.1
sqlparse==0.4.4
tqdm==4.66.2
Twisted==24.3.0
txaio==23.1.1
typing_extensions==4.10.0
Unidecode==1.3.8
urllib3==2.2.1
yarl==1.9.4
zope.interface==6.2