django-deployment

Django Move Project from Windows Host to Linux Host (and Deploy)

萝らか妹 提交于 2019-12-25 00:38:13
问题 I'm trying to Move my Django App to a real Server (or deploy it there, self-hosted) but everything, I have tried so far, does nothing except displaying errors. I'm using the SQLite database because the app won't get much traffic at all. For Example: If I try to deploy the app on my Windows machine I get security errors he won't pass. py -3 manage.py check --deploy System check identified some issues: WARNINGS: ?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If

Django TemplateDoesNotExist in production server when it works in development

删除回忆录丶 提交于 2019-12-24 09:08:12
问题 I get the following error. It's ONLY IN PRODUCTION where I deploy Django application using apache + mod_wsgi. IT WORKS PERFECTLY IN DEVELOPMENT server(my computer): TemplateDoesNotExist at / base.html postmortem. as you can see only one of my two folders from settings are being searched: Django tried loading these templates, in this order: Using loader django.template.loaders.filesystem.Loader: Using loader django.template.loaders.app_directories.Loader: /home/bot_frontend/horses/templates

I am trying to deploy my first django app on heroku and getting error a pre-receive hook declined

泄露秘密 提交于 2019-12-24 02:28:15
问题 I have unsettling the buildpacks but it didn't work and I do have requirements.txt and procfile as well as virtual env. (deploy) C:\Users\Samar\Desktop\deploy\blog>git push heroku master Counting objects: 127, done. Delta compression using up to 4 threads. Compressing objects: 100% (122/122), done. Writing objects: 100% (127/127), 45.25 KiB | 0 bytes/s, done. Total 127 (delta 47), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: ----->

How do I add authentication and endpoint to Django Celery Flower Monitoring?

瘦欲@ 提交于 2019-12-21 03:34:10
问题 I've been using flower locally and it seems easy enough to setup and run, but I can't see how I would set it up in a production environment. In particular, how can I add authentication and how would I define a url to access it? 回答1: For custom address, use the --address flag. For auth, use the --basic_auth flag. See below: # celery flower --help Usage: /usr/local/bin/celery [OPTIONS] Options: --address run on the given address --auth regexp of emails to grant access --basic_auth colon

Django Gunicorn not load static files

你离开我真会死。 提交于 2019-12-17 20:05:23
问题 i'm trying to deploy my django project with gunicorn and nginx, but i need some help. when i code gunicorn myproject.wsgi:application I manage to see my website in the localhost page but without any css. Why gunicorn does not load my css files that are into the static folder of my project? Guinicorn_start script: https://dpaste.de/TAc4 Gunicorn output: https://dpaste.de/C6YX 回答1: Gunicorn will only serve the dynamic content, i.e. the Django files. So you need to setup a proxy server such as

File uploads in Heroku deployment with Django

依然范特西╮ 提交于 2019-12-12 05:31:33
问题 So I was finally able to set up local + prod test project I'm working on. # wsgi.py from dj_static import Cling, MediaCling application = Cling(MediaCling(get_wsgi_application())) application = DjangoWhiteNoise(application) I set up static files using whitenoise (without any problems) and media (file uploads) using dj_static and Postgres for local + prod. Everything works fine at first... static files, file uploads. But after the Heroku dynos restart I lose all the file uploads. My question

Deploying Django app's local postgres database to heroku?

泄露秘密 提交于 2019-12-11 15:07:53
问题 I am unsuccesfully getting my django app deployed on heroku to use my local postgres db. My DATABASE settings are as follows: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'mydb', 'USER': 'foo', 'PASSWORD': 'bar', 'HOST': 'localhost', 'PORT': '', } } Everything runs fine locally. Following the instructions from https://devcenter.heroku.com/articles/django, I add the following bit a code to the bottom of my settings file: import dj_database_url

How to debug Django exceptions in OpenShift applications

独自空忆成欢 提交于 2019-12-11 08:54:41
问题 Background: I am deploying a django application with Python 2.7.5 && Django 1.6. Currently I am able to render all pages, but one. The only error I am able to see when tailing the logs is: "GET /test/ HTTP/1.1" 500 2011 "http://myPrivateApp.rhcloud.com/myPrivatePage/" Obviously this log message doesn't tell me much other than it failed and I cannot find any django related logs within the repos. After playing around with the other pages, I highly suspect the issue is related to an exception

Django 2.2 staticfiles do not work in development

可紊 提交于 2019-12-08 11:15:12
问题 I'm making a new django app where a user can upload images and then they can be displayed on a page. I've read the django docs 10000 times through and I still don't understand why my images aren't loading (DEBUG = True) All my images are going to where they're supposed to be and in the admin in my models django has the right path that leads to the image but it just won't load properly. my setup in settings.py: STATIC_URL = '/static/' STATIC_ROOT = 'static' # live cdn such as AWS S3

Django app deployment not loading static files

╄→гoц情女王★ 提交于 2019-12-04 01:53:07
问题 I have a django app which has angular and bootstrap. This is how my settings are defined: # Django settings for studentsite project. import os PROJECT_DIR = os.path.dirname(__file__) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'texascompletesdb', # Or path to database file if using