Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ Deploy your django Project

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Deploy your django Project


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

This is the fifth and last part of a tutorial course in which you'll learn and understand the basics of Django by building a clone of the popular website Netflix.

Django and Netflix

In this tutorial, you'll learn how to deploy a Django application easily using fly.io.

Important note: Even though fly.io has a free version, they need your credit card to be set.

1- In the /django_netflix_clone/settings.py file set the ALLOWED_HOSTS configuration to accept all hosts.

# django_netflix_clone/settings.py
# Add this line
ALLOWED_HOSTS = ["*"]  # new

2- Install Gunicorn as our production server.

python -m pip install gunicorn

3- Update the requirements.txt file to list all the packages in the current Python virtual environment.

pip freeze > requirements.txt

The new content of the requirements.txt should now be similar to:

asgiref==3.5.0
backports.zoneinfo==0.2.1
Django==4.0.2
gunicorn==20.1.0
Pillow==9.0.1
sqlparse==0.4.2

Replace backports.zoneinfo==0.2.1 with backports.zoneinfo;python_version<"3.9" if your python version is greater than or equal to 3.9.

4- Install flyctl (the command line utility to deploy on fly.io)

Follow the instructions on the website https://fly.io/docs/hands-on/install-flyctl/ depending on your OS.
For Linux we should run:

curl -L https://fly.io/install.sh | sh

then run

export FLYCTL_INSTALL="/home/horacefayomi/.fly"
export PATH="$FLYCTL_INSTALL/bin:$PATH"

to add flyctl to the path.

5- Create an account on fly.io (skip if you already have one)

Run

flyctl auth signup

Your browser will open up with the Fly sign-up screen.

6- Login to fly.io

Run

flyctl auth login

Your browser will open up with the Fly sign-in screen.

7- Configure the application

To configure and launch the app, run the fly launch command and follow the wizard. You can set a name for the app and choose a default region. You can also choose to launch and attach a Postgresql database and/or a Redis database though we are not using either in this example.

To do that run:

fly launch

Important:

  • Make sure the project name is the same as Django project name. But in our case, the name is django_netflix_clone which contains underscore _ which is not allowed by fly.io. So we leave the project name blank and wait the command execution to finish. A DockerFile will be generated and will modify it. At the end of the file, replace "demo.wsgi" by "the_project_name_with_non_allowed_underscore.wsgi"(in our case "django_netflix_clone.wsgi"
  • Accept by taping y when the prompt asks for database:
? Would you like to set up a Postgresql database now? (y/N)
  • Add the following line into the generated DockerFile:
...
RUN python manage.py collectstatic --noinput 
# Add this line after
RUN python manage.py migrate --noinput
...

8- Deploy your app

Run

fly deploy

If everything goes well, you should a similar output:

Image description
With a link you can click to open the monitoring page:

Image description

9- Open your application

Run

RUN python manage.py migrate --noinput

There we go, your website should be available online now.
Here is the link to the fly.io version of the tutorial:
https://empty-night-7673.fly.dev/

Congratulations again. ๐ŸŽ‰.
We are at the end of this course.
You're a champion for making it to the end.

To conclude this adventure, I want to say first thanks you for choosing this tutorial.
Second, this tutorial just scratches the surface of all Django is capable of. There is much other stuff to learn. So feel free to check out other content to consolidate and become a better Django developer.
Thank you again.
Sincerely, Horace FAYOMI ๐Ÿ˜Š.

...



๐Ÿ“Œ Deploy your django Project


๐Ÿ“ˆ 33.13 Punkte

๐Ÿ“Œ How to Deploy Your Django Project on an EC2 Machine using GitHub Actions


๐Ÿ“ˆ 33.13 Punkte

๐Ÿ“Œ Medium CVE-2019-10682: Django-nopassword project Django-nopassword


๐Ÿ“ˆ 30.95 Punkte

๐Ÿ“Œ Low CVE-2021-21416: Django-registration project Django-registration


๐Ÿ“ˆ 30.95 Punkte

๐Ÿ“Œ Django 1.8.1/1.8.2/1.8.6/1.9 django.utils.http.is_safe_url() Cross Site Scripting


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Vuln: Django 'django.views.static.serve()' Function Open Redirection Vulnerability


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django 1.8.1/1.8.2/1.8.6/1.9 django.utils.http.is_safe_url() Cross Site Scripting


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Vuln: Django 'django.contrib.auth.views.login()' Function Open Redirection Vulnerability


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django up to 1.8.17/1.9.12/1.10.6 django.views.static.serve Open Redirect


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django up to 1.8.17/1.9.12/1.10.6 django.utils.http.is_safe_url cross site scripting


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django up to 2.0.1 django.contrib.auth.forms.AuthenticationForm confirm_login_allowed information disclosure


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django bis 1.8.17/1.9.12/1.10.6 django.views.static.serve() erweiterte Rechte


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django up to 1.11.14/2.0.7 django.middleware.common.CommonMiddleware Open Redirect


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django up to 1.11.18/2.0.10/2.1.5 django.utils.numberformat.format() denial of service


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django up to 2.2.17/3.0.11/3.1.5 Archive django.utils.archive.extract path traversal


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ django-registration up to 3.1.1 on Django User Registration information exposure


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django 1.4 up to 1.7 Redirect django.util.http.is_safe_url input validation


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ CVE-2015-8213 | Django CMS 1.7.10/1.8.6 Date Template Filter django.utils.formats.get_format information disclosure (USN-2816-1 / BID-77750)


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django bis 1.8.17/1.9.12/1.10.6 django.utils.http.is_safe_url() Cross Site Scripting


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Is Django Unchained on Netflix? How to Watch Django Unchained from Anywhere


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ CVE-2016-2512 | Django 1.8.1/1.8.2/1.8.6/1.9 django.utils.http.is_safe_url cross site scripting (USN-2915-1 / BID-83879)


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Migrating From Django to Next.js: Whatโ€™s the Equivalent for Django-Guardian?


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ FullStack Next.js & Django Authentication: Django REST, TypeScript, JWT, Wretch & Djoser


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django bis 2.0.1 django.contrib.auth.forms.AuthenticationForm confirm_login_allowed Information Disclosure


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ CVE-2024-27351 | Django up to 3.2.24/4.2.10/5.0.2 Regular Expression django.utils.text.Truncator.words redos


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django bis 1.11.14/2.0.7 django.middleware.common.CommonMiddleware Open Redirect


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django News #176 - Django 5.x Technical Board Election Registration


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Build a Multivendor E-commerce Website using Django, React & Django Rest Framework


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ Django-Sonar: The Essential Debugging Tool for Django


๐Ÿ“ˆ 24.96 Punkte

๐Ÿ“Œ My Docker stack to deploy a Django + Celery web app


๐Ÿ“ˆ 23.65 Punkte

๐Ÿ“Œ Deploy Django Docker Compose to Heroku


๐Ÿ“ˆ 23.65 Punkte

๐Ÿ“Œ Digital Ocean Tutorial โ€“ Deploy Django and Other Frameworks


๐Ÿ“ˆ 23.65 Punkte

๐Ÿ“Œ CVE-2024-22331 | IBM UrbanCode Deploy/DevOps Deploy Windows Agent Installation information disclosure (XFDB-279971)


๐Ÿ“ˆ 22.34 Punkte

๐Ÿ“Œ Test your django Project


๐Ÿ“ˆ 21.96 Punkte

๐Ÿ“Œ CodeCraze๐Ÿš€ - create your own blog in Django | Part 0 | Project Setup


๐Ÿ“ˆ 21.96 Punkte











matomo