Can't run django server from Pycharm - python

I recently fromated my computer and installed win 10.
I have installed pycharm and python 3.4 with django 1.8.6 .
Then I loaded a django project, which I had on my computer before formatting it and backed it up on Google Drive.
I can run my app through command line with the command "python manage.py runserver" (I am running this command while I'm in the project path), and it's working very well like that.
But I need to run it through pycharm in order to use the debugger.
I've tried to use the "Edit configuration" button, but with no success.
Any help will be appreciated.
I have attached an image.
Edit configuration window:

I had to add a new configuration and not to edit the existing one.
I followed the steps from this post:
How to setup Django project in PyCharm

Related

Intellij complains of incorrect configuration for django project

Whenever I run my python django application in Intellij, it shows me a dialog box saying configuration is incorrect and gives me an option to edit or run anyway.
Following is the screenshot of my configuration. Not sure what is it that I am missing.
Update: It does show intermittently in the same configuration dialog box that Django project root is not configured and I am not sure how I can do that. Also, when I run the project anyway, it says,
No manage.py file specified in Settings->Django Support
I am not sure how is the above issue fixable directly but after pressing run on manage.py to create a new configuration and providing it script parameters runserver 127.0.0.1:8000, it worked without errors.
In the above older configuration, Intellij was running a different command
python3.5 /Users/myuser/.virtualenvs/myorg/bin/django-admin.py runserver 8000

PyCharm PRO for Mac GAE upload not working

My colleague and I both have Macs, and we both have PyCharm Professional, same version (2016.3.2) and build (December 28, 2016). We use a repository to keep our project directories in sync, and they are currently identical. Under Preferences, we both have "Enable Google App Engine support" checked, and we both have the same directory shown as "SDK directory", with the same files in that directory.
When I choose menu option Tools > Google App Engine > Upload App Engine app..., the App Config Tool panel appears at the bottom of my PyCharm window. The first line is:
/usr/bin/python
/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/appcfg.py
update .
and the last line is:
appcfg.py >
I can also run that update command from a Terminal window.
Meanwhile, my colleague can also run the update command from a Terminal window. But when he runs menu option Tools > Google App Engine > Upload App Engine app..., the App Config Tool panel only shows:
appcfg.py >
We've researched this extensively and made many attempts at repair, no luck so far. Any help will be most appreciated.
I did a clean install recently, and not using the AppEngineLauncher anymore - not sure it even ships with the newer SDK.
My GAE is located here:
/usr/local/google-cloud-sdk/platform/google_appengine
Looks like you might be using an older version of AppEngine SDK

Profiling Django with PyCharm

My app is pretty slow even in a dev environment so I would like to figure out what's slowing it down so I can try and fix it.
I know about the debug toolbar and according to what it reports neither the database queries nor the downloaded sources are the issue, so it must be the business logic.
However, I cannot run the PyCharm profiler with the Django server because, well, it's not like running a script.
How may I profile Django with PyCharm?
You should probably set configuration properly.
Then click on Edit Configurations...
The main thing is to set Interpreter (your virtual environment). You don't have to set Custom Run Command if you use python manage.py runserver
Then you can run Django server directly from PyCharm ann Profiler too.

Django Pinax-Project-Account github setup

So I am fairly new to Github and Django for that matter, I was digging around for a template of a website using Django offering user authentication and cam across this
pinax-project-account
I setup django and python for use within my cmd and using a virtual env and I stepped through the setup list but I'm stuck using:
chmod +x manage.py
I understand this is for use in Unix just wondering how I get the same desired function in windows? as if I skip this step it won't work at all
You don't need to do that, as Windows has no executable bit. Instead of running
./manage.py whatever
just run
python manage.py whatever
making sure that python.exe is on your PATH.

App Engine problems using the command line

I am developing an App Engine project on Windows using Eclipse and Python 2.5 and Django 0.96. Everything in my app, including Django, is working nicely.
My problems arise when I try to use command line. For example, I'm told that if I want to clear the local datastore I can enter "python manage.py reset" but when I do so the response is "python: can't open file 'manage.py'".
I feel as if I have missed a configuration step. I have checked my system variables and "Path" includes "C:\Python25" (which I had added manually) but nothing Django or App Engine related. My .py extension is associated with C:\Python25\python.exe.
In my quest to solve this, and in trying to understand what manage.py is, I see that I might have had to create a Django project using "django-admin.py startproject [myproject]" but because everything works nicely from Eclipse I'm not sure if this is necessary now. In any case, if I try to enter this from the command line I get "'django-admin.py' is not recognized..."
Please, what am I missing?
If you're using Django 0.96 templates within a 'normal' App Engine app, then manage.py isn't involved at all.
/path/to/dev_appserver.py --clear_datastore .
is what you want, assuming you're CD'd to the root of your app.

Categories

Resources