Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Verification for the project name #35

Merged
merged 2 commits into from

3 participants

@DNX

Added verification for the project name in setup_project command as django's startproject command do.

@brosner
Owner

Please use double quotes.

@lukeman
Owner

Thanks Darii.

@lukeman lukeman merged commit 5e72ace into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 pinax/core/management/commands/setup_project.py
View
6 pinax/core/management/commands/setup_project.py
@@ -91,7 +91,11 @@ def project_list(self):
def setup_project(self, destination, base, options):
user_project_name = os.path.basename(destination)
-
+
+ if not re.search(r"^\w+$", user_project_name):
+ sys.stderr.write("Error: %r is not a valid app name. Please use only numbers, letters and underscores.\n" % (user_project_name))
+ sys.exit(1)
+
if os.path.exists(destination):
raise CommandError("Destination path already exists [%s]" % destination)
Something went wrong with that request. Please try again.