Skip to content

JBthePenguin/PoilAuNezWebApp

Repository files navigation

Build Status

Poil au Nez Web Application Django

This is a website like a blog with an interface admin to manage it. It's a Django Web application for the company of clown theater 'Poil au Nez'. It use GoogleDriveAPI to store the medias, so you have to create, in the folder poilaunezdjango, a file gdriveapikey.json with your private API Key. (see readme.txt in the folder uploads for a local storage)

Create a PostgreSQL database for the application and a new user

!!! maybe you have to install PostgreSQL !!! Connect to PostgreSQL client, create database and new user with privileges:

$ sudo su - postgres
postgres@somewhere:~$ psql
postgres=# CREATE USER "poilaunez";
postgres=# ALTER USER poilaunez WITH PASSWORD 'cool';
postgres=# CREATE DATABASE "db_poilaunez";
postgres=# GRANT ALL PRIVILEGES ON DATABASE db_poilaunez TO poilaunez;
postgres=# \q
postgres@somewhere:~$ exit

Clone the application and install the necessary requirements

Clone the folder, go inside, create a virtual environment for Python with virtualenv (!!! maybe you have to install virtualenv !!!), use it, and install all necessary dependencies (django, django-debug-toolbar, django-fixture-magic, django-multi-captcha-admin, django-simple-captcha, django-googledrive-storage, psycopg2, psycopg2-binary, Pillow, selenium ):

$ git clone https://github.com/JBthePenguin/PoilAuNezWebApp.git
$ cd PoilAuNezWebApp
$ virtualenv -p python3 env
$ source env/bin/activate
(env)$ pip install -r requirements.txt

Create tables

(env)$ python manage.py makemigrations
(env)$ python manage.py migrate

Create a "superuser"

(env)$ python manage.py createsuperuser

Start and use the Application

(env)$ python manage.py runserver

NOW, with your favorite browser, go to this url http://127.0.0.1:8000/ and for login to the admin site go to http://127.0.0.1:8000/admin/ for managing actus, galery (photos and videos) and messages. Here you can create a manager and if you want to use the custom admin site (manager), go to http://127.0.0.1:8000/manager/ and login.

Tests

The tests use selenium and maybe you have to install GreckoWebdriver to use firefox. During the tests, a temporary database is creating, so you need to update the role of application:

$ sudo su - postgres
postgres@somewhere:~$ psql
postgres=# ALTER USER poilaunez CREATEDB;
postgres=# \q
postgres@somewhere:~$ exit

Run the tests:

(env)$ python manage.py test -v 2

If you want to use Chrome, install ChromeWebDriver and update in all app's tests.py line 2:

from selenium.webdriver.chrome.webdriver import WebDriver
🤘 If you want access to the custom 'error 404' page, you have to set DEBUG = False in settings.py line 26, and run the server in insecure mode:
DEBUG = False
(env)$ python manage.py runserver --insecure

About

Django Web application for the company of clown theater 'Poil au Nez'

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published