Update README.md

This commit is contained in:
2018-09-18 21:46:27 -04:00
parent 8054c497ef
commit bad5515ec0

View File

@@ -21,7 +21,7 @@ Done!
## A more detailed explanation
### vars
```bash
# django project settings
# Django project settings
user="centos"
projectname="mysite"
hostname="centos.duco.net"
@@ -43,7 +43,7 @@ djamsg="See $djalogloc for more info."
gunicornlogloc=$logdir"gunicorn.log"
nginxlogloc=$logdir"nginx.log"
# python settings
# Python settings
pylink="https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz"
```
These variables can (and should) be changed to match your configuration needs. For example: any of the "logloc" log location variables can be changed to log somewhere else. The "logmsg" log message variables can be changed to reflect different log locations or output a custom message.
@@ -55,7 +55,7 @@ The Django Project Settings variables should be changed to match your configurat
My recommendation is to use nginx as the user. The installer takes care of creating a home directory for nginx and setting permissions. Of course there is no problem with specifying another user. The installer will automatically add a user and assign permissions. Setting the user to the primary sudo account is risky but the installer won't complain if you do it quietly.
The projectname variable can be whatever you want. When django starts the project it will use this name.
The projectname variable can be whatever you want. When Django starts the project it will use this name.
The hostname will be inserted into "ALLOWED_HOSTS" in your app settings. Multiple hosts are not supported at the moment so set this to the address you'll test with. You can add additional hosts by manually editing ```settings.py```.
@@ -63,7 +63,7 @@ The hostname will be inserted into "ALLOWED_HOSTS" in your app settings. Multipl
If you are installing this on a system with the minimal CentOS build you'll need install_epel_release to be True. ```epel_release``` installs nginx. Kinda hard to run the site without that.
## install
## Install
### Dependencies
In order for this script to work its magic you'll need a few packages provided by Yum. This part is likely to break due to Yum's inconsistency accross distributions, firewall and proxy configurations, and whether CentOS had its morning coffee.
@@ -87,7 +87,7 @@ if [ $install_epel_release = True ] ; then
fi
```
The first part of the script is fairly straight forward. If you aren't root, the installer can't use yum and won't work. After checking if you are the root user it creates the necessary directories to prevent future complaints and installs the aforementioned epel-release package if you want it.
The first part of the script is fairly straight forward. If you aren't root user, the installer can't use yum and won't work. After checking if you are the root user it creates the necessary directories to prevent future complaints and installs the aforementioned epel-release package if you want it.
```bash
# install dependencies
@@ -136,7 +136,7 @@ fi
The firewall commands are specific to a CentOS 7 minimal install. You may not need them. The installer doesn't really care if they fail because they aren't mission critical. It'll yell at you and that's about it.
The semanage command fixes an issue where the websocket would be inaccessible after an install.
The **semanage** command fixes an issue where the websocket would be inaccessible after an install.
### Python
```bash
@@ -146,7 +146,7 @@ if [ $? -ne 0 ] ; then
exit 1
fi
```
After configuring the firewall the script will fetch python from the link provided.
After configuring the firewall the script will fetch Python from the link provided.
```bash
echo -e "\tConfigure"
@@ -169,11 +169,11 @@ if [ $? -ne 0 ] ; then
fi
```
If you've ever installed Python from source this part should look familiar. The script uses wget to download the version of python provided by ```$pylink```. It uses alt install to prevent conflict with previous versions of python (I've been told CentOS will break if it can't find python 2, a real problem if you use make install).
If you've ever installed Python from source this part should look familiar. The script uses wget to download the version of python provided by ```$pylink```. It uses alt install to prevent conflict with previous versions of Python (I've been told CentOS will break if it can't find Python 2, a real problem if you use make install).
You could get rid of this section and do it yourself with another version of python. As long as python can be found at ```$pyinstalldir``` and it has django support the installer will continue to chug along happily.
You could get rid of this section and do it yourself with another version of Python. As long as Python can be found at ```$pyinstalldir``` and it has Django support the installer will continue to chug along happily.
The script will automatically update pip and install virtualenv.
The script will automatically update **pip** and install **virtualenv**.
### Django
```bash
@@ -208,7 +208,7 @@ if [ $? -ne 0 ] ; then
exit 1
fi
```
The next part of the script creates a virtual environment based on your python install.
The next part of the script creates a virtual environment based on your Python install.
```bash
# pip installs
@@ -223,7 +223,7 @@ do
fi
done
```
The script then installs the necessary pip packages.
The script then installs the necessary **pip** packages.
```bash
# start django project
@@ -235,7 +235,7 @@ if [ $? -ne 0 ] ; then
exit 1
fi
```
Next the script starts the django project. You'll notice that the project structure looks like this:
Next the script starts the Django project. You'll notice that the project structure looks like this:
```
[projectname]/
├── [projectname]/