Posts

Showing posts with the label CodingForEntrepreneurs

Go Live with Django & Heroku

I was following Justin Mitchels blog post about Going Live with Django and Heroku I need to populate the database with a significant amount of data and I’ve been using python manage.py loaddata --format json arch2json_all.json Installed 221994 object(s) from 1 fixture(s) In development with sqlite3 this works great. Switch to my production branch push things up to Heroku $ git push heroku master $ heroku run python manage.py makemigrations $ heroku run python manage.py migrate Run into problems when I try to load the fixture. $ heroku run bash $ python manage.py loaddata --format json arch2json_all.json django.db.utils.DataError: Problem installing fixture '/app/items/fixtures/arch2json_all.json': Could not load items.Monolithic(pk=None): value too long for type character varying(1024) Looking in the usual locations I find a couple potential answers. https://stackoverflow.com/questions/9036102/databaseerror-value-too-long-for-type-character-varying100 Could it be a  ...

S3 Static & Media Files for Django (more problems)

Trying to setup S3 for static files for my django project but only in Production mode. In local (development) mode I want to use local files. From one of Coding For Entrepreneurs django videos I got this python snippet to support a production environment and a local environment. settings/__init__.py from .base import * from .production import * try: from .local import * except: pass I followed the steps from the  C oding For Entrepreneurs  blog. I did steps #4 , #5 , #6 and I assume step #7 means to put the from <your-project>.aws.conf import * Into the settings/production.py ? And to leave it out of the settings/local.py ? Using the above settings/__init__.py on my local (development) environment the {% static %} template tag is replaced by https://s3.us-east-2.amazonaws.com/ S3 bucket url If I comment out the from .production import * from settings/init.py from .base import * #from .production import * try: from .local import * except: pass I get the local.py STATIC...

S3 Static & Media Files for Django: Suspicious Operation: Attempted access to 'denied' while loading static files

This summary is not available. Please click here to view the post.