23👍
You’re not in the proper directory…In the case you described, you should have:
mkdir newproject
(not sure why you’re doing this…but we’ll continue with it)cd newproject
django-admin.py startproject newproject
cd newproject
← A key missing part from what you did. You need to change into the directory where manage.py resides. Verify it by usingls
at the command prompt after switching into the directory.python manage.py runserver
Use ls
often, if you need, to double check where you are in the directory tree.
5👍
You are not in the correct directory. You need to do cd newproject and the execute your runserver command.
- How to check whether virtualenv was created with '–no-site-packages'?
- Django: How to save original filename in FileField?
- Where do I import the `DoesNotExist` exception in Django 1.10 from?
4👍
For me it was because the manage.py didn’t get created and the problem was that:
In windows instead of typing “django-admin.py” just type “django-admin” and it will create the manage.py file
- Pillow installation error: command 'gcc' failed with exit status 1
- Check request type in Django
- Testing a session variable
3👍
you need to change your directory to the directory of the project.
- open your environment by typing
activate environment_name
- change the directory to the folder in which you want to create the
project bycd Folder_Name
- then create your project by
django-admin startproject
Project_Name - then change the directory to your project folder
- if you also want to create an app then type
python manage.py
startapp App_name - to confirm if it works type
python manage.py runserver
, then
you should get a link in the terminal. copy and paste that link in
the browser and you should see a successful page.
- Return list of objects as dictionary with keys as the objects id with django rest framerwork
- Making Twitter, Tastypie, Django, XAuth and iOS work to Build Django-based Access Permissions
2👍
The reason of this problem is because you’re in the first project directory “parent directory”, and you have to go to your project “newproject” that has the manage.py file.
The way to this is simple:
-
cd “name of your project”, E.g. cd newproject
-
python manage.py runserver
2👍
You need to include a .
after you create the project.
Eg: django-admin.py startproject newproject .
This will allow you to run python manage.py runserver
from where you are.
- How do I get union keys of `a` and `b` dictionary and 'a' values?
- Why can I access an object during it's post_save Signal, but not when I trigger code within that signal that calls it on another process
- How do I create a proper user with django allauth?
- Django Newsletter App
- Testing a session variable
1👍
That can happen because manage.py doesn’t have permissions.
Check the existence of manage.py throughout newproject, If exist you can fix it with:
$cd newproject
$chmod +x manage.py
Finally, try to execute python manage.py runserver
1👍
I was having the same problem, when Windows 10 changed credentials, Docker lost the access to drives. The fix for this issue, I reset the credentials in docker-desktop > shared Drives > reset credentials at bottom.
1👍
can’t open file ‘manage.py’: [Errno 2] No such file or directory”
here is the solution
step 1: command -> django-admin startproject project_name
step 2: command -> cd project_name
step 3: command -> python manage.py startapp app_name
try it may fix your problem
1👍
You should navigate to the inner directory where your manage.py resides. For example:
If you have created projectname as
Django-admin startproject loginapp
Step 1: Go to loginapp
Step 2: Click on it
Step 3: You will find another loginapp and manage.py folder inside that
Step 4: Use this rootpath commandprompt
Step 5: Enter py manage.py runserver
Now it will work
- Is there a way to render a html page without view model?
- How to debug a Django MultiValueDictKeyError on Formset POST
0👍
I ran into the same error seller. But this is what I discovered
1: open your terminal in your project environment
2: install Django using: pip install django (if you are on windows)
3: then create your Django project using : django-admin startproject newproject . (django-admin start-project followed by project name give a space and add period (.) )
So it goes like this
django-admin startproject new project .
The period/fullstop (.) At the end tells djando the area in which the file should be created which is inside the project file its self you are working on. After this is done you are free to go. You can now run your server and enjoy
Run server using: python manage.py runserver
- Django admin enable sorting for calculated fields
- How can I set a minimum password length when using the built-in Django auth module?
- Django raising 404 with a message
- Cannot get environment variables in Django settings file
0👍
Make sure to put a period at the end of your command e.g
Django-admin startproject new project .
The period at the end (.) will solve the problem
0👍
02/2023
After CD to the project folder, I copy the command ‘python manage.py runserver’ command and enter. But the error still appears.
Solution:
Type ‘mana’ and use the tab to auto-complete the filename in the folder.
- Is it possible to create subparsers in a django management command?
- Django – remove trailing zeroes for a Decimal in a template
- Docker compose could not open directory permisson denied
-1👍
There could be invalid interpreter selected .Try selecting the proper interpreter
- Is there a way to render a html page without view model?
- Django REST framework – multiple lookup fields?
- Celerybeat not executing periodic tasks
- Best way to make Django's "user" system have "friends"
- Using crontab with django