Reputation: 11
Basically I downloaded django project from SCM, Usually I run the project with with these steps
But this project does not contains manage.py , how to run this project in my local machine???
br
Upvotes: 1
Views: 6664
Reputation: 2192
First create a virtual environment and install Django. Now you have django-admin.py
available in your system.
django-admin is Django’s command-line utility for administrative tasks.
$ django-admin startproject name [directory]
create a Django app directory structure for the given app name in the current directory or the given destination.
You can provide the path to a directory with a custom app template file or a path to a compressed file (.tar.gz, .tar.bz2, .tgz, .tbz, .zip) containing the app template files.
$ django-admin startproject --template=/Users/jezdez/Code/my_app_template myapp
Django will also accept URLs (http, https, ftp) to compressed archives with the app template files, downloading and extracting them on the fly.
For example, taking advantage of GitHub’s feature (or other SCM) to expose repositories as zip files, you can use a URL like:
$ django-admin startproject --template=https://github.com/githubuser/django-app-template/archive/master.zip myapp
$ cd my_proj
$ touch manage.py
Put this content into manage.py like @Sayse said:
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
# CHANGED manage.py will use development settings by
# default. Change the DJANGO_SETTINGS_MODULE environment variable
# for using the environment specific settings file.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings.development")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
Install dependencies and run migrations.
$ pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py runserver
Hope I help!
Upvotes: 0
Reputation: 599610
Most likely, this is not supposed to be a complete project, but a plugin application. You should create your own project in the normal way with django-admin.py startproject
and add the downloaded app to INSTALLED_APPS.
Upvotes: 5
Reputation: 253
You can use uwsgi to run a django project.
First install uwsgi using:
pip install uWSGI
Go to project folder and enter this in terminal:
# Replace server with whatever is your project name
uwsgi --http :8000 --module Server.wsgi
Upvotes: 2
Reputation: 43300
You'll have to create a manage.py file manually if you wanted to use its commands in the same way you're accustomed to. You can modify django's manage.py template to include your project's settings.
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{ project_name }}.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
Upvotes: 5