Steps to deploy OpenCheckin to PythonAnywhere and confirm the deployment:
It is encouraged that you pause the video at any time during setup and configuration so that you can follow along more easily, or watch to the end first and then begin. To begin, create your own free PythonAnywhere account at pythonanywhere.com. Email confirmation will be required with your own email provider. After logging in with your account, follow these steps: Step 1: Clone software into PythonAnywhere 1: Click on the Dashboard tab in PythonAnywhere 2: Open up a new Bash console. 3: Confirm current working directory by using the "pwd" command. 4: Press the enter key to run the command. 5: Working environment should be /home/yourusername. 6: Paste the code "git clone https://github.com/ezst036/OpenCheckIn" into the console. Press enter. 7: Keep Bash console open, do not close. For free accounts, PythonAnywhere only allows two Bash consoles. You can re-use existing Bash consoles by using another browser tab to access other parts of the PythonAnywhere administrator site. Step 2: Create virtual working environment and install dependencies 1: Paste the command "mkvirtualenv --python=/usr/bin/python3.9 myenv" 2: Notice that the Bash window changed and now says "(myenv)". This means that the virtual environment is active. Myenv should only be used for evaluation or testing purposes. 3: Paste the command "pip install -r /home/yourusername/OpenCheckIn/requirements.txt". Pip is a built in program for use with Django that will find all of the requirements you need to get OpenCheckIn working properly. The included requirements document tells Pip where to begin and there will be a lot to do in this first install. It should take 4-5 minutes to complete. 4: At the top right of the screen, open the menu and right click the option for Dashboard. Open in a new tab. Step 3: Add a new web app 1: Click on the Web tab in PythonAnywhere 2: Click "Add a new web app" 3: Use the built-in domain name supplied by PythonAnywhere for free accounts, which will be yourusername.pythonanywhere.com. If you are a paying customer, this section of the instructions will be re-visited at a later time. 4: Click Next. 5: Select manual configuration as the Python Web framework. 6: Select python 3.9 as the version. Step 4: Configure web app tab so that OpenCheckIn functions 1: In PythonAnywhere, go to the Web tab. 2: Scroll down to the Virtualenv section of the settings and type in "myenv". This will link OpenCheckIn with the virtual environment. 3: Confirm that the virtual environment is found, which should look like: /home/yourusername/.virtualenvs/myenv 4: Above the section for the Virtualenv is a code section with a link to PythonAnywhere's WSGI configuration file. 4: Edit the WSGI file. Large sections of this file need to be deleted. As shown in the video, remove the FLASK section of the file and the HELLO WORLD section of the file. 5: Remove comments from the file as specified in the video. This will now be working code for launching OpenCheckIn. 6: Update the path so that PythonAnywhere knows where your copy of OpenCheckIn lives. It will be the directory where the manage.py file is located at and it should be /home/yourusername/OpenCheckIn/ 7: Update the environment module. Change the module from mysite.settings to open_check_in.settings. 8: Save the wsgi.py file. Optional Step: Reload the website settings 1: In PythonAnywhere, go to the Web tab. 2: At the top of the Web tab, there is Reload section with a green button that says "Reload yourusername.pythonanywhere.com" 3: Press this button, and it will begin using the new settings that have been completed. 4: Open your website yourusername.pythonanywhere.com 5: There should be a DisallowedHost message. This message is telling you that OpenCheckIn is properly configured up until this point. You did everything correctly. PythonAnywhere is successfully finding and launching OpenCheckIn. OpenCheckIn is now working and telling you "I do not recognize PythonAnywhere." Step 5: Enable PythonAnywhere in OpenCheckIn 1: In PythonAnywhere, go to the Files tab. 2: As shown in the video, the settings file should be found at /home/yourusername/OpenCheckIn/open_check_in 3: Open the file settings.py 4: The settings file has line numbers on the left side. Find line number 24, and paste in the proper allowed hosts: "['yourusername.pythonanywhere.com']" Notes: You do not need to keep http or the backslashes. 5: Before saving and closing the settings.py file, confirm that the DEBUG setting is set to False. Also take a note of the SECRET_KEY setting that is here. This current secret key is for evaluation purposes only and you must not use this key in a production environment. Another video will be made later showing how to easily create new custom secret keys for Django apps to increase your security. 6: If you do reload and go to OpenCheckIn, it will refuse to load because the table that holds the account user interface preferences is not created yet.(account_uiprefs) We will create that next. Step 6: Create database file 1: In PythonAnywhere, go to the Dashboard tab. 2: In a Bash console, cut and paste the command "python /home/yourusername/OpenCheckIn/manage.py makemigrations". This command looks at the functions within OpenCheckIn and sets up the files that will create the database as needed. 3: Cut and paste the command "python /home/yourusername/OpenCheckIn/manage.py migrate". The database file will now appear and be ready for use. 4: Note: Previous commands are saved for a certain time, press the up and down key on your keyboard to access them. 5: OpenCheckIn is heavily dependent upon its database, and I do not supply a database file. This is for security reasons. Step 7: Use OpenCheckIn properly configured on your own web space 1: In PythonAnywhere, go to the Web tab. 2: At the top of the Web tab, there is Reload section with a green button that says "Reload yourusername.pythonanywhere.com" 3: Press this button, and it will begin using the new settings that have been completed. 4: Open the website yourusername.pythonanywhere.com and now it will work! Step 8: Collect static dependency files 1: In PythonAnywhere, go to the Dashboard tab. 2: In a Bash console, cut and paste the command "python /home/yourusername/OpenCheckIn/manage.py collectstatic" - This will run a process automatically for the necessary site resources. 3: Type in yes to continue 4: In PythonAnywhere, go to the Web tab. 5: Scroll down to the PythonAnywhere Static files section. 6: Enter the URL: "/static/" 7: Enter the path: "/home/yourusername/OpenCheckIn/static" 8: Reload the page again using the green button on the Web tab so that the static files are used. Step 9: Create administrator 1: In PythonAnywhere, go to the Dashboard tab. 2: Cut and paste the command "python /home/yourusername/OpenCheckIn/manage.py createsuperuser" in a Bash console. 3: Follow the prompts on screen. For testing, any email address will work but for production purposes please use an email address that is not widely known. 4: Close the console window. Step 10: Create OpenCheckIn preferences 1: Open your website yourusername.pythonanywhere.com/admin 2: Log in with your credentials. 3: Go to the preferences on the right side. 4: Create new preferences. 5: Go to your homepage yourusername.pythonanywhere.com 6: Now you should see a background image. 6: It is strongly advised not to stay logged in as administrator unless necessary. 7: OpenCheckIn is now fully configured on the server and all administrative functionality is ready for use. Note: If your administrator console is not properly showing colors and styling, confirm the section Static files under the Web tab.
0 Comments
Leave a Reply. |
EasySeatsEasySeats is open source software developed to bring ease to users who choose to go multi-seat. It supports video cards for seat creation as well as external USB docks. Archives
April 2019
Categories |