Forums

Mezzanine issue using Mezzanine "out of the box" on PA

Using Mezzanine with Django 1.3.7 as it stands in /usr/lib or "out of the box" as I am calling it - i.e. your PA version. Got everything set up but I am getting an error in urls.py: 2014-03-09 16:33:16,540 : urlpatterns = patterns('', 2014-03-09 16:33:16,540 :NameError: name 'patterns' is not defined Strange, my urls.py has an import for patterns - first thing I looked at, but I have never seen this since urls.py was set up plain vanilla by mezzanine-project.

I was fooling around with the latest version of Mezzanine in a virtualenv (which did not work) and finally stopped before I started to pull out my hair. I don't have a lot left after far too many years in IT.

Any ideas?

Also, this appears to be in filebrowser_safe package. Seems it is already out there. Don't know what could be wrong. Thanks, dc

Ok, forget this last post. I finally found Harry's post about setting up the new version of Mezzanine in a virtualenv. It works now, however, as per my previous post the old Mezz in batteries included may be broken in filebrowser_safe package.


Still have a problem serving my static files though! I have tried a couple of different ways and no avail.


Some comments:

  1. Harry's tutorial at https://www.pythonanywhere.com/forums/topic/1178/ belongs in the help section. It's my fault for not searching under Mezzanine in the first place in the forums.

  2. The tutorial should explain what you are getting with a plain vanilla Mezzanine install, i.e. Sqlite3 as "dev.db", and DEBUG = True. Debug on is not good for security and someone new to Mezzanine might overlook this.

  3. As per comment 2 one could remove local_settings.py and fill in settings.py.

  4. Also, add "allowed sites" to settings.py will keep Django from whining.

  5. When adding mysql to settings.py make sure you install mysqldb. Also USE CREATEDB --NOINPUT instead of syncdb. For some crazy reason, using syncdb will create an error when one executes, with an error that does not make much sense.

  6. Related to #5 above, pip install has no site packages as the default. Change the initial install to include the site-packages and there will be no need for #5.

  7. Leave this spot open for comments on Postgresql ( I will tackle that when I get the static pages serving).

  8. Harry's tutorial should be enshrined in the help section because he is internationally known (I live in another country) and it is well done except for the above comments.

Thanks, dc

[edited by admin for formatting]

thanks for the suggestions! v helpful. we'll work them into an updated guide and put it in the help section. also, am dreadfully embarrassed by the "internationally famous" bit.

"Known for what" is the key question. I served overseas with the Army, so I suppose I'm internationally known as well ;-)

As to my static pages, Mezzanine comes with a line of code such as: STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL.strip("/")) as of now, I have this commented out because I'm not sure how PA will use this. STATIC_URL = "/static/" is there also which should be fine for PA.

However, still no CSS. Need some advice here so I can figure out what PA needs to serve these files. After that, on to Postgres 8-[

dc

Found a typo in static. Solved css problem.
dc

Cool. I've started converting that forum post into a wiki entry on mezzanine. Comments welcomed!

As far as PA is concerned, I think that having the ability to get Mezzanine up and running quickly is a good offering for customers/users of PA to have handy. Mezzanine is a far better product than the one that I used a couple of years ago. You can get a blog or gallery going quickly. Blogs, in particular, have always been an issue with Python - we don't have a Wordpress. This could end the howls for PHP on PA and thus Wordpress.

I think you should incorporate how to set up MySql as the database instead of sqlite into your guide harry as it was useful for me :)

personally i've been converted by the idea of static site generators, for blogging... but i guess that's a solution for nerds only isn't it?

In my previous post, I mention the following for setting up a production version of Mezzanine:

<p> <ol> <li> Get rid of local_settings.py. Usually, if developing locally and then deploying, local_settings.py is in the .gitignore (or .hgignore as you prefer), and is not deployed at all. If you develop on PA, then you must get rid of it. I usually rename to local_settings.bkup </li> <li> Edit settings.py and head for the database section. Fill out the variables with details for your mysql database. Here are some things to be aware of:</li>

<li> Use the database section of the PA dashboard to create your database.</li> <li> Your hostname will be mysql.server, database name is name = yourlogin$yourprojectname format</li> <li> You don't need the use port (default is 3306).</li>

<li>Add the Allowed hosts variable (don't forget to quote it) or Django will whine a lot.</li> </ol>

thanks! all helpful stuff.

incidentally, you should use markdown to do styling, lists, codeblocks etc in your forum posts. there are links to instructions at the bottom of the text input box...