PyCharm can't connect to interpreter in docker - django

I use PyCharm 2016.1.4 on a Mac. I followed the instructions on this page, and I want to connect PyCharm to a Django project which runs in docker via docker-compose.
I added the configuration file and service name but when I press OK I get this error:
Can you help me solve this problem?

Related

How do I continue working on an existing django project in pycharm from ddesktop computer to my laptop?

I created a django project in pycharm from my desktop computer. Now that I want to work on that same project from my laptop I'm not able to do so. What are the commands to be written in the terminal for continuing the project in pycharm from my laptop? (how do I work in that existing virtual environment and run the server now?)
If you want to work on a same project in multi device, the best option in using git which is distributed version-control system for tracking changes in source code during software development, for more information use the link below:
git
if you want to run your project on a virtual server, you have multi option, which on of them is using pycharm, pycharm has builtin tools for run your project, the other option is using builtin django and python virtual server that could run with this command : python manage.py runserver. for complete information about how run django project virtually, use this link:
The development server
Configure PyCharm for Python/Django

How can I edit a Django project in Ubuntu EC2 after it was cloned from Git?

I created an Ubuntu EC2 instance and uploaded my Django project (formerly uploaded to git) by following the steps used in the YouTube tutorial here. The Django project worked fine on my local computer using the 127.0.0.1:8000 url & port. I want to keep developing it on the Ubuntu EC2 instance, but after adding a new url, view, and template, the project breaks. As a test, I copied edits and new files back to my local computer and tried to recreate the problem, but it worked fine. Is it not possible to edit Django projects on Ubuntu EC2? Will I have to solely develop in Git and re-push to EC2 every time I want to updated my website?
Thanks!
You only need to restart gunicorn:
systemctl restart gunicorn
you only need to restart nginx when you change any related nginx configurations
I was able to figure it out - it is necessary to restart nginx and gunicorn after making changes with the following code:
sudo service nginx restart; sudo service gunicorn restart

Pycharm Django Supervisor Manage.py

I'm using Pycharm Professional edition to maintain a Django web application hosted on a remote Linux OS. Until now I've used Expandrive to mount the remote volume as a local windows mapped drive and can use remote debugging.
However I would like to develop locally and deploy to the server which I've got working but struggling to configure the run/debug configuration in conjunction with the Django settings in preferences considering I use supervisor to control all the processes.
Here's a screenshot of my deployment configuration (connection)
Here's a screenshot of my deployment configuration (mappings)
Here's a screenshot of run/debug configuration
When I enable django support, point to my manage.py script and run the configuration it tries to run using manage.py whereas I want it to use the supervisor script. So I therefore get this:
However the real problem is I would like to control the remote supervisor from pycharm

Unable to setup Django in production on EC2 instance running Ubuntu 14.04

I have set up an EC2 instance with Ubuntu and able to login via ssh.
Now I have installed Apache, MySQL (worked fine) and Django also tried to configure it to run with apache. I have tried doing so with mod-wsgi but it still shows a apache default page instead of django (Congratulation ! It works) page. Can someone please provide me instructions for how to setup all this after login into EC2 via SSH.
Here is a tutorial provided by Django.
You need to make sure the apache config file is in /etc/apache2/sites-enabled/ or wherever your apache configuration files rest.
Another silly problem and this might be your issue is whenever I start a new instance of EC2 there is always a config called "000-default" already in the apache sites-enabled. This needs to be DELETED or DISABLED for apache to read from your config instead.
Hopefully this helps!
For a example check the Step 2 of this link. yum + git + pip + python requirements

Django manage.py commands with Google App Engine and Vagrant

I have a Google App Engine app and I'm running Windows with Vagrant. I have an Ubuntu installation which I access via vagrant ssh. On that machine I installed the Google App Engine SDK for Python and I can successfully deploy my app with:
appcfg.py update myapp --oauth2 --noauth_local_webserver
The --noauth_local_parameter allows me to copy the oauth URL and paste in the browser on my Windows machine, because on the Linux machine I have no GUI. Everything is working fine.
But now I want to use the Django manage.py syncdb command, to create the tables in Google Cloud SQL. The problem is, when I execute that command, the text-based w3n browser starts for the authorization, and then I get the error message that the browser does not support javascript.
I'd like to run the manage.py commands with the --noauth_local_webserver flag, but that is not supported by the manage.py commands. How can I solve this? I have already installed an Ubuntu virtual machine with GUI and given the app the permission and manage.py works fine on that machine, but when I try to execute the command on the Vagrant (non GUI) machine, it stills want to open the browser for permission.
Hm, I manually copied the oauth .dat file to the vagrant server, and manage.py syncdb is now working, but the website still can't connect in the browser; it says:
No valid OAuth 2.0 credentials. Before using the Google SQL Service backend on dev_appserver, you must first run "manage.py syncdb" and proceed through the given instructions to fetch an OAuth 2.0 token.
It seems to be the same errors as here. In my case it seemed that the necessary GOOGLE_SQL_OAUTH2_REFRESH_TOKEN environment variable was not set. I copied this refresh token from the .dat file and set it in the app.yaml:
env_variables:
GOOGLE_SQL_OAUTH2_REFRESH_TOKEN: "..."
Now everything is working fine.