I\'m following the Django tutorial https://docs.djangoproject.com/es/1.10/intro/tutorial01/
I\'ve created a \"mysite\" dummy project (my very first one) and try to
Make sure which python version you connect the django with (Make sure to activate the virtual env if you are using any).
When you install django using just
pip install django
then you have to run
python manage.py startapp <yourApp name>
else if you have used:
pip3 install django
then you have to run
python3 manage.py startapp <yourapp name>
Refer:
For running Python version 3, you need to use python3
instead of python
.
So, the final command will be:
python3 manage.py runserver
You must activate virtual environment where you have installed django. Then run this command - python manage.py runserver
you should activate your virtual environment . In terminal -> source env/bin/activate now there will be ----> (env) in your terminal displayed !
now it will work -> runserver .
No need to delete exc part !
I was experiencing the same but this was solved by running with specific python 3.6 as below:
python3.6 manage.py runserver
It's best to create a virtual environment and run your Django code inside this virtual environment, this helps in not changing your existing environments. Here are the basic steps to start with the virtual environment and Django.
Create a new Directory and cd into it.
mkdir test
, cd test
Install and Create a Virtual environment.
python3 -m pip install virtualenv
virtualenv venv -p python3
Activate Virtual Environment: source venv/bin/activate
Install Django: pip install django
Start a new project: django-admin startproject myproject
cd to your project and Run Project:
cd myproject
,
python manage.py runserver
You can see your project here : http://127.0.0.1:8000/