Browse Source

Pin version of coderedcms in for new projects (#337)

* Pin version of coderedcms in project_template's requirements.txt
Vince Salvino 4 năm trước cách đây
mục cha
commit
d23d90b6c0

+ 7 - 1
coderedcms/bin/coderedcms.py

@@ -61,11 +61,14 @@ class CreateProject(TemplateCommand):
             os.path.join(codered_path, 'project_template'),
             options['template']
         )
+
         # Check if provided template is built-in to coderedcms,
         # otherwise, do not change it.
         if os.path.isdir(template_path):
             options['template'] = template_path
-        options['extensions'] = ['py', 'md']
+
+        # Treat these files as Django templates to render the boilerplate.
+        options['extensions'] = ['py', 'md', 'txt']
         options['files'] = ['Dockerfile']
 
         # Set options
@@ -89,6 +92,9 @@ class CreateProject(TemplateCommand):
             options['domain'] = 'localhost'
             options['domain_nowww'] = options['domain']
 
+        # Add additional custom options to the context.
+        options['coderedcms_release'] = coderedcms.release
+
         # Print a friendly message
         print(message % {
             'project_name': project_name,

+ 5 - 3
coderedcms/project_template/basic/requirements.txt

@@ -1,8 +1,10 @@
-coderedcms
+coderedcms=={{coderedcms_release.0}}.{{coderedcms_release.1}}.*
 
 # django_sendmail_backend enables sending email from your web host server.
 # Remove this if using a different email backend.
 django_sendmail_backend
 
-# To use with a MySQL database (offered by most web hosts), uncomment the following.
-#mysqlclient
+# To use with MariaDB or MySQL, uncomment the line below:
+#mysqlclient
+# To use with PostgreSQL, uncomment the line below:
+#psycopg2

+ 5 - 3
coderedcms/project_template/sass/requirements.txt

@@ -1,8 +1,10 @@
-coderedcms
+coderedcms=={{coderedcms_release.0}}.{{coderedcms_release.1}}.*
 
 # django_sendmail_backend enables sending email from your web host server.
 # Remove this if using a different email backend.
 django_sendmail_backend
 
-# To use with a MySQL database (offered by most web hosts), uncomment the following.
-#mysqlclient
+# To use with MariaDB or MySQL, uncomment the line below:
+#mysqlclient
+# To use with PostgreSQL, uncomment the line below:
+#psycopg2

+ 3 - 0
docs/releases/v0.19.0.rst

@@ -8,6 +8,9 @@ Bug fixes
 * Support custom image models by correctly using  ``WAGTAILIMAGES_IMAGE_MODEL``
   versus hard-coding ``wagtailimages.Image``.
 
+* ``coderedcms start`` now pins the version of CodeRed CMS in the generated
+  ``requirements.txt`` file.
+
 
 New features
 ------------