kopia lustrzana https://github.com/wagtail/wagtail
Docs updates
rodzic
5d6aa0c6ca
commit
3cdedf12f2
|
@ -1,38 +1,79 @@
|
|||
=====================
|
||||
Creating your project
|
||||
=====================
|
||||
===========================
|
||||
Starting your first project
|
||||
===========================
|
||||
|
||||
.. contents:: Contents
|
||||
:local:
|
||||
Once you've installed Wagtail, you are ready start your first project.
|
||||
|
||||
|
||||
The ``wagtail start`` command
|
||||
=============================
|
||||
|
||||
The easiest way to start a new project with wagtail is to use the ``wagtail start`` command. This command is installed into your environment when you install Wagtail (see: :doc:`installation`).
|
||||
|
||||
The command works the same way as ``django-admin.py startproject`` except that the produced project is pre-configured for Wagtail. It also contains some useful extras which are documented :doc:`here <getting_started/the_template>`.
|
||||
|
||||
To create a project, cd into a directory where you would like to create your project and run the following command:
|
||||
Wagtail provides a command to get you started called ``wagtail start``. Open up a command line shell in your project folder and type:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
wagtail start mysite
|
||||
|
||||
|
||||
This should create a new folder called ``mysite``. Its contents are similar to what ``django-admin.py startproject`` creates but ``wagtail start`` comes with some useful extras that are documented :doc:`here <../reference/project_template>`.
|
||||
|
||||
|
||||
Running it
|
||||
==========
|
||||
|
||||
TODO
|
||||
|
||||
cd mysite
|
||||
pip install -r requirements.txt
|
||||
python manage.py migrate
|
||||
python manage.py createsuperuser
|
||||
python manage.py runserver
|
||||
Firstly, open up a command line shell in your new projects directory.
|
||||
|
||||
|
||||
Your site is now accessible at http://localhost:8000, with the admin backend available at http://localhost:8000/admin/ .
|
||||
* **1. Create a virtual environment**
|
||||
|
||||
This is only required when you first run your project. This creates a folder to install extra Python modules into.
|
||||
|
||||
**Linux/Mac OSX:** :code:`pyvenv venv`
|
||||
|
||||
**Windows:** :code:`c:\Python34\python -m venv myenv`
|
||||
|
||||
|
||||
https://docs.python.org/3/library/venv.html
|
||||
|
||||
|
||||
**Python 2.7**
|
||||
|
||||
``pyvenv`` is only included with Python 3.3 onwards. To get virtual environments on Python 2, use the ``virtualenv`` package:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install virtualenv
|
||||
virtualenv venv
|
||||
|
||||
|
||||
* **2. Activate the virtual environment**
|
||||
|
||||
**Linux/Mac OSX:** :code:`source venv/bin/activate`
|
||||
|
||||
**Windows:** :code:`venv/Scripts/activate.bat`
|
||||
|
||||
https://docs.python.org/3/library/venv.html
|
||||
|
||||
|
||||
* **3. Install PIP requirements**
|
||||
|
||||
:code:`pip install -r requirements.txt`
|
||||
|
||||
|
||||
* **4. Create the database**
|
||||
|
||||
By default, this would create an SQLite database file within the project directory.
|
||||
|
||||
:code:`python manage.py migrate`
|
||||
|
||||
|
||||
* **5. Create an admin user**
|
||||
|
||||
:code:`python manage.py createsuperuser`
|
||||
|
||||
|
||||
* **6. Run the development server**
|
||||
|
||||
:code:`python manage.py runserver`
|
||||
|
||||
Your site is now accessible at ``http://localhost:8000``, with the admin backend available at ``http://localhost:8000/admin/``.
|
||||
|
||||
|
||||
Using Vagrant
|
||||
|
@ -40,5 +81,4 @@ Using Vagrant
|
|||
|
||||
TODO
|
||||
|
||||
|
||||
:doc:`getting_started/using_vagrant`
|
||||
:doc:`using_vagrant`
|
||||
|
|
|
@ -7,3 +7,4 @@ Getting started
|
|||
|
||||
installation
|
||||
creating_your_project
|
||||
using_vagrant
|
||||
|
|
|
@ -14,10 +14,15 @@ Whether you just want to try out the demo site, or you're ready to dive in and c
|
|||
Install Python
|
||||
==============
|
||||
|
||||
We recommend installing Python 3.4, but Wagtail also works with Python 2.7 and 3.3.
|
||||
|
||||
|
||||
|
||||
Install Wagtail
|
||||
===============
|
||||
|
||||
``pip install wagtail``
|
||||
|
||||
|
||||
Optional extras
|
||||
===============
|
||||
|
|
|
@ -8,9 +8,9 @@ Below are some useful links to help you get started with Wagtail.
|
|||
|
||||
* **First steps**
|
||||
|
||||
:doc:`Installation <getting_started/installation>`
|
||||
:doc:`getting_started/installation`
|
||||
|
||||
:doc:`Starting a project <getting_started/creating_your_project>`
|
||||
:doc:`getting_started/creating_your_project`
|
||||
|
||||
|
||||
* **Creating your Wagtail site**
|
||||
|
@ -29,3 +29,21 @@ Below are some useful links to help you get started with Wagtail.
|
|||
* **Using Wagtail**
|
||||
|
||||
:doc:`Editors guide <editor_manual/index>`
|
||||
|
||||
|
||||
Index
|
||||
-----
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:titlesonly:
|
||||
|
||||
getting_started/index
|
||||
core_components/index
|
||||
contrib_components/index
|
||||
howto/index
|
||||
reference/index
|
||||
support
|
||||
editor_manual/index
|
||||
releases/index
|
||||
|
|
|
@ -6,3 +6,4 @@ Reference
|
|||
:maxdepth: 2
|
||||
|
||||
management_commands
|
||||
project_template
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
The project template
|
||||
====================
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
mysite/
|
||||
core/
|
||||
static/
|
||||
|
@ -46,7 +48,7 @@ Location: ``/Vagrantfile`` and ``/vagrant/``
|
|||
|
||||
If you have Vagrant installed, these files let you easily setup a development environment with PostgreSQL and Elasticsearch inside a virtual machine.
|
||||
|
||||
See below section `With Vagrant`_ for info on how to use Vagrant in development
|
||||
See :doc:`../getting_started/using_vagrant` for info on how to use Vagrant in development
|
||||
|
||||
If you do not want to use Vagrant, you can just delete these files.
|
||||
|
Ładowanie…
Reference in New Issue