Use the following instructions to install the Python package manager (pip), create and activate the environment and install necessary pip packages.
Use the following command to create the required root files. Located in the root directory of the application
Create root files
File | Purpose |
---|---|
main.py | execution, routes, start application |
forms.py | validate form data |
contact_form.php | send form data |
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
Directory | Purpose |
---|---|
templates | location of HTML files |
static | location of css files and media |
Use the following command to create the required static directories. Located in the static directory of the application
Create static directories
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
ln -s | create symlink |
/media/user_name/drive_name | location of storage drive |
/home/user_name/Websites/flask_app/static/storage | location of symlink |
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
File | Description |
---|---|
styles.css | styles sheets |
quries.css | media quries |
animations.css | media animations |
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
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 |