English 中文(简体)
我在詹戈怎么办项目? Beginner
原标题:How do I make a project in Django? Beginner
  • 时间:2010-06-02 23:03:47
  •  标签:
  • django

Okay I just started with Django and it s totally different from PHP. I installed Python 2.6 and Django.

两者都位于我的C轮驱动力。

C:
   Django
          build
          django
             bin
               django-admin.py
          docs
   Python26

我正在做以下工作:django网站:tutorial, 当他们说要写django-admin.py开始我的现场,从我的洞穴指挥线开始,我发现错误。

My django-admin.py is in the django/bin folder. I installed Python via python setup.py. How do I create a project with django?

感谢:

最佳回答

你们现在要从指挥线,而不是在传译员内部管理!

参考:

From the command line, cd into a directory where you’d like to store your code, then run the command django-admin.py startproject mysite. This will create a mysite directory in your current directory.

因此,C迅速:

python django-admin.py startproject mysite

你们也许需要补充通往django-admin的道路。

问题回答

象你这样的人没有添加C:python26,或者在你安装了你在PATH的座右铭......,你可以把这条路从碎条或右lick的我的计算机上走,然后从财产上进入环境变形......在座右侧的平线和干go。 y

it is very easy to make a python django project run terminal in you linux or mac box
first:

django-admin.py startproject mysite

我的现场是一个项目名称。

second: in python django project, each and every feature should be start in an app, so our next work is create a app. here polls is a app entered your project folder and run

python manage.py startapp polls
python manage.py syncdb

then just run the project python default run on 8000 port. you also define port like this way

python manage.py runserver 6006

http://127.0.0.1:6006

下一步是整合项目和管理项目。 页: 1

Your virtual Environment will contain these three folder:
1)Include
2)Lib
3) Scripts
(Read about them from django official website)
What you need to do is use all these 3 things.
On your command line cd into your virtual environment folder.Then use this code:
python Scriptsdjango-admin.py startproject mysite

产出:将在您的虚拟环境中建立一个名为“米场”的夹。 由于这套双手在虚拟环境中,你将能够使用所有三个组成部分。

Boilerplate Code To create django as well create django app you have to follow many common commands. for simplicity, kindly follow the below single-line commands separated by semicolon:

django-admin startproject project_name; cd project_name;python3 manage.py startapp app_name; cd app_name; mkdir templates

这些指挥部将为集延戈建立通用的结构。





相关问题
How to get two random records with Django

How do I get two distinct random records using Django? I ve seen questions about how to get one but I need to get two random records and they must differ.

Moving (very old) Zope/Plone Site to Django

I am ask to move data from a (now offline) site driven by Plone to a new Django site. These are the version informations I have: Zope Version (unreleased version, python 2.1.3 ) Python Version 2.1....

Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

Flexible pagination in Django

I d like to implement pagination such that I can allow the user to choose the number of records per page such as 10, 25, 50 etc. How should I go about this? Is there an app I can add onto my project ...

is it convenient to urlencode all next parameters? - django

While writing code, it is pretty common to request a page with an appended "next" query string argument. For instance, in the following template code next points back to the page the user is on: &...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

热门标签