i have installed Python2.6 and Django1.2.4 on windows vista. or so i think django is installed.
i test it this by opening the python shell(command prompt from the python folder) and typed this:
import django
django.get_version()
The result was "1.2.4". From this i understand that firstly python works, and second that django is installed, recognized.
Following the tutorial from Django website i get stuck on the first thing: creating a project
django-admin.py startproject mysite
I wrote this in a new command prompt window, chdir my way to a folder i decided it'll keep the project and then wrote the line above. The error is this:
E:\Workspace>django-admin.py startproject mysite
'django-admin.py' is not recognized as an internal or external command,
operable program or batch file.
I tried with writting "python" before the line but no.
I added in the Environmental Variables , in the PATH, the path to the bin folder of django and the path to python. I have the django-admin.py file in the Python/Scripts folder.
I understand this is a very easy , newbie mistake, but it currently blocks me. If somebody has gone through this error or knows about it, a bit of help would be much appreciated.
Thank you either way!
Did you to add the Python/Scripts to the PATH environmental variable? You'll need to restart any command prompts you have opened for the PATH change to take effect.
The same happened with me also and it is resolved by adding PATH environmental variable of Python\scripts.
Related
I want to run pylint recursively on all my project apps from the root of the app. If i use : pylint . on the root of the project base, it gives me the error that there is no init.
How can I run the pylint from my project root without having to specify all the apps one by one.
EDIT
Thank you heartily for the downvotes. But since I am a novice at that and still couldnt find a solution to my issue, can the downvoters please explain or the give the oh-so-obvious solution? If this is how pylint is designed to be called recursively on each app, then can you point me to the documentation?
So by default the pylint is requires the module name or the file name to be linted to be provided to it as args and it does not automatically recursively search from the pwd. It would however lint every python file in a module if a module name is provided.
In order to run the pylint without the hassle of having to maintain the apps, I am using :
PyCQA/prospector
When I use PyCharm's manage.py terminal to do a makemigrations or migrate I have the following warning message:
PyCharm can't check if the following file been updated: [filepath]
for a hundred of files located inside my webpack and babel-preset-es2015 folders, within my static/node_modules folder
The command is executed properly, but I would like to get rid of these hundreds of red warnings in the terminal. Especially since I think the migrations takes longer to be executed since I have those.
Can I somehow tell PyCharm to stop checking my node_modules or even static folders?
It's not a particularly brilliant solution but you can just comment out the line in _jb_utils.py, if you can find it. For me on OS X it was here:
~/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/172.4343.24/PyCharm.app/Contents/helpers/pycharm/_jb_utils.py
Obviously you will have to redo this every time you update PyCharm though.
I am currently working on the cadasta - an open source organisation's - Django project.
They require you to run their platform in a virtual machine (virtualbox) using vagrant.
As I enter their repository, and run their server using ./runserver, I am all of a sudden getting a CompileError which says:
File to import not found or unreadable: bootstrap-sass/assets/stylesheets/bootstrap/variables. Parent style sheet: /vagrant/cadasta/core/static/css/_variables.scss.
on line 74 of core/static/css/_variables.scss
#import "bootstrap-sass/assets/stylesheets/bootstrap/variables";
Following this link: https://github.com/jrief/djangocms-cascade/issues/130,
I found that libsass is already installed, and so I tried installing bootstrap-sass inside the VM, but it did no good. Everything was working fine until I renamed the cadasta-platform directory (i.e their github repo that I cloned, and so the main project is included inside this folder only.) and refreshed. I even tried running the server again, but couldn't get through this error. I suppose renaming the directory shouldn't be the cause?
I have no clue on how to proceed. Please help.
EDIT: After renaming the project folder to the same name solved this error. If anyone would ever like to answer this question, please explain why renaming the project directory produces an error like this? As I believe, I think renaming should not be an issue?
I have this script to download images. But the problem is it saves the files in the same directory with the script. How can i change to to save in another directory? Id love for it to be here G:\Downloads\PICTURES
Here is the script http://pastebin.com/raw.php?i=2PnuMNnW
I didnt make this, so thanks to the person who wrote it.
As can be found in the Python Docs:
import os
os.chdir(/path/to/directory)
Change the current working directory to path.
I have written a Django project which runs fine on the dev server. Although I am the only one working on it, I realized I should get some sort of version control going and placed the project on a network SVN. I assume the new process for working this project should be: checkout code from SVN, make changes, test, update, and commit back to SVN.
However, when I check out the code and attempt to run the dev server from the checked out SVN location, I get an error that "has no module named yadda.yadda". But, the module is there and it works fine when I run it from the original directory. Any thoughts? Any suggestions on a better work process?
Does your $PYTHONPATH shell variable reference a relative path? If so, the relative path may be incorrect when you change to the new directory.
You can also diff the contents of the two directories to ensure that your versioned copy is a duplicate of the original.
Check if your module has init.py
As George said check if module is on python path (import sys and print sys.path)