DIRECTORIES & FILES

directory image

Use the following instructions to install the Python package manager (pip), create and activate the environment and install necessary pip packages.

01

Create required root files

Use the following command to create the required root files. Located in the root directory of the application

Create root files

pagesprouts@linux-server:~$ touch main.py forms.py contact_form.php
File Purpose
main.py execution, routes, start application
forms.py validate form data
contact_form.php send form data

02

Create required root directories

Use the following command to create the required root directories. Located in the root directory of the application. These will be used to hold the HTML templates and CSS files for the application.

Create root directories

pagesprouts@linux-server:~$ mkdir templates static
Directory Purpose
templates location of HTML files
static location of css files and media

03

Create required static directories

Use the following command to create the required static directories. Located in the static directory of the application

Create static directories

pagesprouts@linux-server:~$ cd static/
pagesprouts@linux-server:~$ mkdir css fonts images audio video
Directory Purpose
css location of CSS files
fonts location of download fonts
images location of image files
audio location of audio files
video location of video files

If you plan on using an external drive to host files on the application, a symlink will need to be created to said drive. The following command can be used. In the example below, the directory drive_name will be synced with the storage directory called storage on the external drive.

Create symlink

pagesprouts@linux-server:~$ ln -s /media/user_name/drive_name /home/user_name/Websites/flask_app/static/storage
ln -s create symlink
/media/user_name/drive_name location of storage drive
/home/user_name/Websites/flask_app/static/storage location of symlink

04

Create required css files

Use the following commands to create the required css files. Located in the static/css directory of the application. styles.css will be used to style the HTML, quries.css to alter the HTML to suit various screen sizes and animations.css will be used to add animations to the application.

Create required CSS files

pagesprouts@linux-server:~$ cd static/css/
pagesprouts@linux-server:~$ touch styles.css quries.css animations.css fonts.css
File Description
styles.css styles sheets
quries.css media quries
animations.css media animations

05

Create HTML templates

Use the following commands to create the required HTML files. Located in the templates directory of the application. These files will provide the content.

Create required HTML files

pagesprouts@linux-server:~$ cd templates/
pagesprouts@linux-server:~$ touch layout.html index.html services.html contact.html form_error.html form_passed.html
File Description
layout.html main HTML template
index.html home page
services.html services page
contact.html contact page
form_error.html error sending data
form_passed.html data successfully sent