Template for quick-setup of DRF projects with properly refactored code.
Follow the following steps if you want to set this project up on your own machine.
-
Clone the repository using:
git clone <link.git>
-
Move into the repository directory using:
cd folderName
-
Create a Python virtual environment:
python -m venv env
-
Activate the virtual environment:
source env/scripts/activate
-
Update
PIP
to the specified version:python -m pip install --upgrade pip==22.0.4
-
Install
PIP-Tools
using:pip install pip-tools
-
Compile the
requirements.in
file using:pip-compile
-
Install the dependencies:
pip install -r requirements.txt
-
Install the
spacy
model using:python -m spacy download en_core_web_md
-
Copy the
.env
file to the directory root.-
Create a
PostgreSQL
database in your machine as per theDatabase Settings
in the.env
file. -
Alternatively, you can use Amazon's
RDS
service to create a managed instance of aPostgreSQL
database.If using Amazon's
RDS
, change the following values in your.env
file to reflect the values of theRDS
database.PGHOST
: The host URL of the RDS instance.PGPORT
: The port on the host URL the database is accessed through.PGDATABASE
: The name of the database instance.PGUSER
: The username with which to log into the database.PGPASSWORD
: The password for the username above with which to log into the database.
Alternately, you can also use a
database_URI
in thesettings
page to connect to the database.Eg:
PGUSER
:PGPASSWORD
@PGHOST
:PGPORT
/PGDATABASE
-
-
Create the necessary migrations:
./manage.py makemigrations
-
Migrate the database:
./manage.py migrate
-
Create a new
SuperUser
for the system using:./manage.py createsuperuser
Recommended values for
SuperUser
:- username: admin - email: admin@admin.com - password: password
-
Start the server:
./manage.py runserver
APP_NAME = "Name of the Project you want to have"
# Site Settings:
SECRET_KEY = 'some_random_32_bit__hex_key'
DEBUG = True/False
ENV_TYPE = 'DEV/PROD'
ALLOWED_HOSTS = 'host_01 host_02 host_03 etc'
# Database Settings:
PGDATABASE = 'name_of_db'
PGHOST = 'host/url_of_db'
PGPORT = 'port_of_db'
PGUSER = 'username_for_db'
PGPASSWORD = 'password_for_db'
# Internationalization Settings:
LANGUAGE_CODE = 'language_code'
TIME_ZONE = 'standard_time_location as city/continent'
USE_I18N = True/False
USE_TZ = True/False
## Email Settings:
EMAIL_HOST = ' '
EMAIL_USE_TLS = True/False
EMAIL_USE_SSL = True/False
EMAIL_PORT = int
EMAIL_HOST_USER = " "
EMAIL_HOST_PASSWORD = "Generated App Password"
Post the Postman Documentation here as a markdown hyperlink.