Command not found for start new project - django

I am starting out with Django on my Mac, I installed Django2 and installed PyCharm
But when I try to run command from terminal to create a new project on desktop:
django-admin.py startproject name or
django-admin startproject name
then I get "command not found"
Pycharm shows my env at /Users/admin/PycharmProjects/untitled/venv
Please help
Thank you

I am not familiar with the environment on the Mac, but i think the setup are almost the same. It seems that you have not activated your environment.
I use the virtual env on an ubuntu and i have to activate the environmet before i can start creating projects and apps. I hope that helps.

https://www.jetbrains.com/help/pycharm-edu/creating-virtual-environment.html
I think this may help. You can specify your python environment in pycharm.

Related

Dont work command 'django-admin.py startproject blog .'. IDE just show script and nothing happens

I try to create a new Django project in Pycharm IDE. After correctly installing Django I try to do this command in the terminal django-admin.py startproject blog ., but IDE shows me this script in a new window and nothing happening. How can I fix this?

Django Saleor installing Dashboard 2.0 on windows

I am trying to install Saleor Dashboard 2.0 on my Windows 10 machine for a dev environment.
So far I have
git cloned the git clone dashboard into the same folder as the Saleor project
Then cd saleor/dashboard and ran npm i
The instructions were not really clear on how to configure the API_URI to http://localhost:8000/graphql/. It is not in the settings.py and the instructions were not clear on where this is.
Setting environment variable on Windows somehow didn't work for me.
I changed the value of below variable in src/config.ts and it worked !!
export const API_URI = "http://127.0.0.1:8000/graphql/";
But ideally it should work by setting system environment variable.
Please fill free to update here if anyone is able to run it with system env variable (without changing the code).
Thanks!!
try the following command in the command line.(this will not work in powershell)
set API_URI = "http://localhost:8000/graphql/"

Using Windows to run a virtual environment Created on Ubuntu

so i have been developing a website with a backend database. The following is my current setup and it is working great:
Currently using Ubuntu 16.04
I created a virtualenv and downloaded Django and postgreSQL within the virtual environment.
I also downloaded and am using Python 3.5.2 within the virtual environment.
My entire folder structure is on GitHub so that I can edit the code on the go (Again, everything working fine on Ubuntu).
The problem comes when I want to start doing some editing on Windows 10 using Powershell. I am unsure of how to run the 'activate.sh', 'activate.csh', or 'activate.fish' file in order to run the virtual environment and initialize my server using 'python manage.py runserver' so I can start editing my website.
Has anyone run into the problem and found out how to fix this? Any help on how to get started working on Windows would be great.
If you need any more details id be glad to provide them.
Thanks!
Assuming that you have created a virtualenv on ubuntu without relocatable option. You will have to firstly create a new virtual environment on Windows because they have differences on OS variations. So navigate to the directory where you would like to create the new virtual environment on Windows and run the following command:-
virtualenv .
(Note the . specifies current directory option)
After this there will be three directories created in your directory namely
1) Include
2) Lib
3) Scripts
As now the activate.bat file is in Scripts you can activate your virtualenv by the following command:
Scripts\activate
After the environment is activated you can pip install -r requirements.txt and then run your manage.py script as usual.
For further reference you can read:-
https://virtualenv.pypa.io/en/stable/userguide/

Virtualenv "workon" command online working in one terminal tab.

I'm working on a django project.
I hav virtualenv and virtualenvwrapper setup. When I invoke
workon myprojectname
I cannot invoke it again in another terminal tab or window. Any ideas why?
Does it have anything to do with postactivate hooks? I wouldn't think so.
Thanks for the help.
Have you added the virtualenvwrapper commands to your startup shell file?
For Example, if you're using Terminal on Mac, add the following lines to your ~/.bash_profile:
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
http://virtualenvwrapper.readthedocs.org/en/latest/install.html#shell-startup-file

How can I get started developing with Django on Cloud9?

So Cloud9 looks really cool, and you can create python files in it, but I can't figure out how to get it to run a Django project. I imported one from my github account into the IDE, but it says I need to install Django (a django.core import error) so I need to help getting going. Any Ideas? Any skeleton projects on the web that I missed that will do this?
After some research and looking for an answer on different blogs and sites I finally found a solution:
Create a new workspace
Execute easy_install django to install Django
Create new Django project python ./../bin/django-admin.py startproject myproject
Start dev server python ./myproject/manage.py runserver $IP:$PORT
Access http://projectname.username.c9.io
VoilĂ !!!
I hope this helps
Just write commands in shell as it is:
sudo pip install -r requirements.txt (you should have there django)
than
python manage.py runserver $IP:$PORT
you will have app on https://projectname-username.c9.io
You may also have to add the proper path: <workspace_name>-<username>.c9users.io to the ALLOWED_HOSTS list in django_project/settings.py file, as suggested by the error message returned by django server. Tested on Django 2.0