Jump to content

Django for Designers: Difference between revisions

imported>Aldeka
imported>Aldeka
Line 40:
You'll know it worked because afterwards, you'll see <source lang="bash">(env)</source> at the front of all your terminal lines in that terminal window!
 
====StartSet up your projectgit repo====
 
If you're following this tutorial at PyCon, in your terminal, run:
Line 67:
 
<source lang="bash">$ git branch</source>
 
====Start your project====
 
Let's create your first Django project, called "mysite".
 
<source lang="python">$ django-admin.py startproject mysite</source>
 
You'll see we made a folder called "mysite", with some files in it. Let's check them out!
 
<source lang="bash">
$ cd mysite
$ ls
__init__.py
manage.py
settings.py
urls.py
</source>
 
These files are:
 
* __init__.py: An empty file that tells Python that this directory should be considered a Python module. Because of the __init__.py file, you can use import to import myproject.
* manage.py: A command-line utility that lets you interact with this Django project in various ways. You can read all the details about manage.py in django-admin.py and manage.py.
* settings.py: Settings/configuration for this Django project.
* urls.py: The URL declarations for this Django project; a “table of contents” of your Django-powered site.
 
====Set up your settings and database====
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.