- Use
Django-Cookiecutterfor a base project template - App name should be a plural of the main model in the app, like
subscriptions,payments - Always use
BaseModelwithid(UUID),created_at&updated_at. Every model sub-classes this model - Always use
AbstractUserall the time, even though you don't need one - Always use multiple
settings.pyfiles, likebase.py,production.py - Use
DJANGO_SETTINGS_MODULEvariable in your.envfile - Always use a
.envfile for managing keys and other secret info - Always have multiple
requirements.txtfiles:requirements/base.txt,requirements/dev.txt
This file contains hidden or 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
| # Installation - Celery 4.4.7 | |
| pip install celery | |
| pip install django-celery-beat | |
| pip install django-celery-results | |
| # <project-folder>/__init__.py | |
| from .celery import app as celery_app | |
| __all__ = ('celery_app',) | |
| # <project-folder>/celery.py |
This file contains hidden or 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
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name teenarp.com www.teenarp.com; | |
| return 301 https://www.teenarp.com$request_uri; | |
| expires max; | |
| } |
This file contains hidden or 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
| # $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $ | |
| # This is the sshd server system-wide configuration file. See | |
| # sshd_config(5) for more information. | |
| # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
| # The strategy used for options in the default sshd_config shipped with | |
| # OpenSSH is to specify options with their default value where | |
| # possible, but leave them commented. Uncommented options override the |
This file contains hidden or 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
| #!/bin/bash | |
| ssh -D 8123 -f -C -q -N praneeth@<IP-Address> |
This file contains hidden or 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
| <html> | |
| <head> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
| </head> | |
| <body> | |
| <div class="txt1">ACCOUNT SUSPENDED</div> | |
| <div class="txt2">This account has been suspended.</div> | |
| <div class="logo"><img src="http://blog.codepen.io/wp-content/uploads/2012/06/Black-Large.png" width="200px"></div> | |
| <div id="orbit-system"> |
This file contains hidden or 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
| user nginx; | |
| worker_processes 2; | |
| worker_rlimit_nofile 65535; | |
| error_log /var/log/nginx/error.log warn; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 65535; |
This file contains hidden or 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
| # settings.py - Django 2.2 | |
| SECURE_CONTENT_TYPE_NOSNIFF = True | |
| SECURE_BROWSER_XSS_FILTER = True | |
| SECURE_SSL_REDIRECT = True | |
| SESSION_COOKIE_SECURE = True | |
| CSRF_COOKIE_SECURE = True | |
| EMAIL_USE_TLS = True | |
| SERVER_EMAIL = '[email protected]' |
This file contains hidden or 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
| <div class="col-md-4 d-flex justify-content-center"></div> |
This file contains hidden or 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
| redis-server /usr/local/etc/redis.conf |