This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploya hazirliq | |
virtualenv aktiv edirik | |
- ./manage.py dumpdata --natural-foreign \ | |
--exclude auth.permission --exclude contenttypes --exclude django_celery_beat -e admin.Logentry -e auth.group \ | |
--indent 4 > data1.json #(database-i dump edirik) | |
Oz komputerimiz | |
- pip install gunicorn | |
`manage.py` ilə eyni səviyyədə `Dockerfile` və `.dockerignore`(serverə yükləməyini istəmədiyimiz fayllar üçün) adlı fayl yaradırığ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone 'repo url' | |
cd project | |
git checkout -b {new_branch_name} # create and swiching branch | |
git checkout master # swiching branch | |
git branch # show branch list | |
git add . | |
git commit -m 'commit' | |
git push origin {new_branch_name} # to push changes to new branch | |
git checkout master # swiching branch | |
# on master branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker exec {CONTAINER} /usr/bin/mysqldump -u {USER} --password={PASSWORD} {DATABASE} > {BACKUP_FILE_PATH} | |
# For ignoring some tables | |
docker exec {CONTAINER} /usr/bin/mysqldump -u {USER} --password={PASSWORD} --ignore-table={DATABASE}.{TABLE} {DATABASE} > {BACKUP_FILE_PATH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip freeze # packegleri gosterir | |
pip freeze > requirements.txt # packegleri fayla yazir | |
pip install -r requirements.txt #packegleri rekursiv olaraq yukleyir | |
cat requirements.txt # oxumaq ucun | |
nano requirements.txt # yazmaq ucun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.5' | |
services: | |
# mongo: | |
# container_name: mongo | |
# image: mongo:4.0.14-xenial | |
# restart: on-failure | |
environment: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.idea/ | |
media/ | |
.venv | |
db.sqlite3 | |
*.pyc | |
__pycache__/ | |
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python manage.py dumpdata --natural-foreign -e contenttypes -e auth.Permission -e admin.Logentry > data.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.companies-brands li').forEach(e => { | |
e.addEventListener('click', function () { | |
let url = window.location.href; | |
if (url.includes("?")) { | |
if (url.includes("company=")){ | |
let index = url.indexOf('company='); | |
let indexFirst = url.indexOf('=', index); | |
let indexLast = url.indexOf('&', indexFirst); | |
let newUrl = url.slice(0, indexFirst + 1) + this.id; | |
window.location = url.indexOf('&', indexFirst) === -1 ? newUrl : newUrl + url.slice(indexLast); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#subscribeForm").on("submit", function (event) { | |
event.preventDefault(); | |
let email = $('#id_email').val(); | |
let csrfToken = $("[name=csrfmiddlewaretoken]").val(); | |
const requestUrl = window.location.origin + $(this).attr('action'); | |
$.ajax({ | |
url: requestUrl, | |
type: "POST", | |
data: { 'email': email, 'csrfmiddlewaretoken' : csrfToken, }, | |
success: function (data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SITE_URL = 'http://35.205.142.86'; | |
// COMPANIES/BRANDS | |
const COMPANY_CATEGORIES_API_URL = `${SITE_URL}/api/v1/companies/categories`; | |
const SEARCH_COMPANIES_BY_CATEGORIES_URL = `${COMPANY_CATEGORIES_API_URL}?title=`; | |
// REVIEWS/COMPLAINTS | |
const REVIEW_CATEGORIES_API_URL = `${SITE_URL}/api/v1/reviews/categories`; | |
const REVIEW_COMPANIES_API_URL = `${SITE_URL}/api/v1/reviews/companies`; | |
const REVIEW_KEYWORDS_API_URL = `${SITE_URL}/api/v1/reviews/keywords`; |
OlderNewer