0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00
wagtail/docs/getting_started/creating_your_project.rst

85 lines
1.9 KiB
ReStructuredText
Raw Normal View History

2015-02-11 18:30:03 +01:00
===========================
Starting your first project
===========================
2015-02-11 18:30:03 +01:00
Once you've installed Wagtail, you are ready start your first project.
2015-02-11 18:30:03 +01:00
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
2015-02-11 18:30:03 +01:00
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
==========
2015-02-11 18:30:03 +01:00
Firstly, open up a command line shell in your new projects directory.
* **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
2015-02-11 18:30:03 +01:00
* **2. Activate the virtual environment**
2015-02-11 18:30:03 +01:00
**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
-------------
TODO
2015-02-11 18:30:03 +01:00
:doc:`using_vagrant`