Skip to content

Commit

Permalink
Merge pull request #7 from moviepediafilms/feature/events
Browse files Browse the repository at this point in the history
upgraded dependecies, added events seo
  • Loading branch information
zkhan93 authored Jan 2, 2024
2 parents 2545f76 + de7f4d5 commit 76b86c3
Show file tree
Hide file tree
Showing 9 changed files with 500 additions and 13 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM python:3.8
FROM python:3.10 as base

RUN pip install --upgrade pip
RUN pip install --upgrade pip pipenv

WORKDIR /app

COPY requirements.txt requirements.txt
COPY Pipfile Pipfile.lock ./

RUN pip install -r requirements.txt
RUN pipenv install --system --deploy --ignore-pipfile

FROM base as dev
RUN pipenv install --system --deploy --ignore-pipfile --dev

FROM base as prod
COPY . .

EXPOSE 80
ENTRYPOINT ["/app/run.sh"]
CMD ["/app/run.sh"]
17 changes: 17 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "*"
gunicorn = "*"
flask-sqlalchemy = "*"
mysqlclient = "*"

[dev-packages]
black = "*"
flake8 = "*"

[requires]
python_version = "3.10"
424 changes: 424 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions requirements-dev.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

6 changes: 6 additions & 0 deletions run-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Start server
echo "Starting server"
flask run --host=0.0.0.0 --port=8082 --reload

2 changes: 2 additions & 0 deletions share/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ def add_movie_variables():
from share.views.movie import app as movie_app
from share.views.movie_list import app as movie_list_app
from share.views.catch_all import app as catch_all_app
from share.views.event import app as event_app

app.register_blueprint(movie_app)
app.register_blueprint(movie_list_app)
app.register_blueprint(event_app)
app.register_blueprint(catch_all_app)

return app
20 changes: 20 additions & 0 deletions share/templates/events.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends 'base.html' %} {% block head %}
<title>{{ meta.title | default("Moviepedia Films") }}</title>
<meta name="description" content="{{meta.about}}" />
<meta itemprop="description" content="{{meta.about}}" />
<meta name="keywords" content="{{meta.keywords}}" />
<meta name="author" content="Moviepedia Films" />
<meta itemprop="author" content="Moviepedia Films" />
<meta itemprop="image" content="{{base_url}}/{{meta.image}}" />
<meta property="og:site_name" content="Moviepedia Films" />
<meta property="og:title" content="Moviepedia Films | {{meta.title}}" />
<meta itemprop="og:title" content="Moviepedia Films | {{meta.title}}" />
<meta property="og:description" content="{{meta.about}}" />
<meta itemprop="og:description" content="{{meta.about}}" />
<meta property="og:url" content="{{base_url}}/events/{{meta.slug}}" />
<meta itemprop="og:url" content="{{base_url}}/events/{{meta.slug}}" />
<meta property="og:image" content="{{base_url}}/{{ meta.poster or '' }}" />
<meta itemprop="og:image" content="{{base_url}}/{{ meta.poster or '' }}" />
<meta property="twitter:card" content="summary_large_image" />
<meta name="twitter:image:alt" content="{{meta.title}}" />
{% endblock %}
22 changes: 22 additions & 0 deletions share/views/event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from flask import Blueprint, render_template, Response
from share.models import Movie

app = Blueprint("event_app", __name__, url_prefix="/events")


@app.route("/<string:slug>")
def movie_detail(slug):
events = {
"iim-rohtak-2024": {
"title": "IIM Rohtak 2024",
"keywords": "IIM Rohtak 2024, IIM Rohtak, Moviepedia, Moviepediafilms, Moviepedia 2024",
"about": "IIM Rohtak 2024 is a movie event organized by Moviepediafilms. It is a movie event for the students across the country.",
"image": "img/events/iim-rohtak-2024.png",
"slug": slug,
"poster": "img/events/iim-rohtak-2024.png",
}
}
meta = events.get(slug, None)
if not meta:
return Response("Not found", status=404)
return render_template("events.html", meta=meta)

0 comments on commit 76b86c3

Please sign in to comment.