Skip to content

Instantly share code, notes, and snippets.

MEDIA_STATIC_ROOT = os.path.join(PROJECT_PATH, '..', 'site_media', 'static')
MEDIA_STATIC_URL = '/site_media/static/'
MEDIA_ROOT = os.path.join(PROJECT_PATH, os.pardir, '..', 'site_media', 'dynamic')
MEDIA_URL = '/site_media/dynamic/'
MEDIASYNC = {
'MEDIA_ROOT': MEDIA_STATIC_ROOT,
'MEDIA_URL': MEDIA_STATIC_URL,
'BACKEND':'mediasync.backends.s3',
'AWS_KEY':'XXXXXXXXXXXXXXXXXX',
'AWS_SECRET':'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
MEDIA_STATIC_ROOT = os.path.join(PROJECT_PATH, '..', 'site_media', 'static')
MEDIA_STATIC_URL = '/site_media/static/'
MEDIA_ROOT = os.path.join(PROJECT_PATH, os.pardir, '..', 'site_media', 'dynamic')
MEDIA_URL = '/site_media/dynamic/'
MEDIASYNC = {
'MEDIA_ROOT': MEDIA_STATIC_ROOT,
'MEDIA_URL': MEDIA_STATIC_URL,
'BACKEND':'mediasync.backends.s3',
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/home/XXXXXXXXX/webapps/XXXXXXXXX/lib/python2.5/django/core/management/__init__.py", line 362, in execute_manager
utility.execute()
File "/home/XXXXXXXXX/webapps/XXXXXXXXX/lib/python2.5/django/core/management/__init__.py", line 303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/XXXXXXXXX/webapps/XXXXXXXXX/lib/python2.5/django/core/management/base.py", line 195, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/XXXXXXXXX/webapps/XXXXXXXXX/lib/python2.5/django/core/management/base.py", line 222, in execute
MEDIA_STATIC_ROOT = os.path.join(PROJECT_PATH, '..', 'site_media', 'static')
MEDIA_STATIC_URL = '/site_media/static/'
MEDIA_ROOT = os.path.join(PROJECT_PATH, os.pardir, '..', 'site_media', 'dynamic')
MEDIA_URL = '/site_media/dynamic/'
MEDIASYNC = {
'MEDIA_ROOT': MEDIA_STATIC_ROOT,
'MEDIA_URL': MEDIA_STATIC_URL,
'BACKEND':"mediasync.backends.s3",
'AWS_KEY':"XXXXXXXXXXXXXXX",
'AWS_SECRET':"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
$('#slideshow').loopedSlider({
addPagination: true,
slides: ".slides",
containerClick: true,
autoStart: 6000,
fadespeed: 2000,
});
behavior: url(http://path-to-file.com/ie-css3.htc); /* Add me to any box or text shadow and rounded corner object to execute in IE7 and 8 */
@davemerwin
davemerwin / gist:5265211
Created March 28, 2013 17:33
This is the settings for displaying Symbolset fonts so that Firefox will show them. Replace "domainname" with your domain name.
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff woff
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "http://*.domainname.org"
</IfModule>
</FilesMatch>
Can an admin GET any endpoint?
Can an admin POST any endpoint?
Can an admin PUT any endpoint?
Can an admin PATCH any endpoint?
Can an admin DELETE any endpoint?
Can a user GET thier endpoint?
Can a user POST thier endpoint?
Can a user PUT thier endpoint?
Can a user PATCH thier endpoint?
@davemerwin
davemerwin / Django Rest Framework Complete Relational Example
Last active October 31, 2020 09:45
This is a (mostly) complete relationship example of a parent child relationship via Django Rest Framework
# This example will allow you to manipluate a Parent and a Child via various endpoints
# /api - All endpoints
# /api/parents - Parents list
# /api/parents/(?P<pk>\d+) - Parent detail
# /api/parents/(?P<pk>\d+)/children - List of children of parent
# /api/children - Child list
# /api/children/(?P<pk>\d+) - Child Detail
# Models - models.py
# Pretty simple setup. Children have a FK to parent
@davemerwin
davemerwin / Step By Step Virtualenv, Django, Postgres, NGINX, Gunicorn, HTTPS on DigitalOcean
Last active March 5, 2024 01:50
This is every step, in detail, to create a Django App with Postgres, NGINX, Gunicorn, and HTTPS on Digital Ocean. The only thing I don't go over is how to create a droplet and manage the domain.
Reference:
Django/Postgres/Nginx/Gunicorn in Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
Encryption: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
Where you see "user", "myproject" and "myprojectuser" replace that with what is relevent to what you are working on.
User Setup
$ ssh root@SERVER_IP_ADDRESS
Complete login process