2015-02-11 18:30:03 +01:00
===========================
Starting your first project
===========================
2014-09-11 17:18:45 +02:00
2015-02-11 18:55:35 +01:00
Once you've installed Wagtail, you are ready start your first project. Wagtail projects are ordinary Django projects with a few extra apps installed.
2014-09-11 17:18:45 +02:00
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:
2014-09-11 17:18:45 +02:00
.. 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>` .
2015-02-11 17:15:52 +01:00
Running it
==========
2014-09-11 17:18:45 +02:00
2015-02-11 18:30:03 +01:00
Firstly, open up a command line shell in your new projects directory.
2015-02-22 12:29:24 +01:00
1. **Create a virtual environment**
2015-02-11 18:30:03 +01:00
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
2014-09-11 17:18:45 +02:00
2015-02-22 12:29:24 +01:00
2. **Activate the virtual environment**
2014-09-11 17:18:45 +02:00
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
2015-02-22 12:29:24 +01:00
3. **Install PIP requirements**
2015-02-11 18:30:03 +01:00
:code: `pip install -r requirements.txt`
2015-02-22 12:29:24 +01:00
4. **Create the database**
2015-02-11 18:30:03 +01:00
By default, this would create an SQLite database file within the project directory.
:code: `python manage.py migrate`
2015-02-22 12:29:24 +01:00
5. **Create an admin user**
2015-02-11 18:30:03 +01:00
:code: `python manage.py createsuperuser`
2015-02-22 12:29:24 +01:00
6. **Run the development server**
2015-02-11 18:30:03 +01:00
:code: `python manage.py runserver`
Your site is now accessible at `` http://localhost:8000 `` , with the admin backend available at `` http://localhost:8000/admin/ `` .
2014-09-11 17:18:45 +02:00
2015-02-11 17:15:52 +01:00
Using Vagrant
-------------
2014-09-11 17:18:45 +02:00
2015-02-11 18:30:03 +01:00
:doc: `using_vagrant`